Skip to content

BannerBomb/lavaplayer-track-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lavaplayer Track Info

Decode lavaplayer tracks locally, from a Buffer or base64 string.

Installation

npm i lavaplayer-track-info

Usage

const { decodeTrack } = require("lavaplayer-track-info");

const track = "QAAAkwIANFNrcmlsbGV4ICYgSGFic3RyYWt0IC0gQ2hpY2tlbiBTb3VwIFtPZmZpY2lhbCBBdWRpb10ABU9XU0xBAAAAAAADLIAACzIyTVdyV1BWX1FNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9MjJNV3JXUFZfUU0AB3lvdXR1YmUAAAAAAAAAAA==";

console.log(decodeTrack(track));
console.log(decodeTrack(Buffer.from(track, "base64")));

Both log

{ flags: 1,
  version: 2,
  title: 'Skrillex & Habstrakt - Chicken Soup [Official Audio]',
  author: 'OWSLA',
  length: 208000n,
  identifier: '22MWrWPV_QM',
  isStream: false,
  uri: 'https://www.youtube.com/watch?v=22MWrWPV_QM',
  source: 'youtube',
  position: 0n }

Encoding tracks

const { encodeTrack, decodeTrack } = require("lavaplayer-track-info");

const track = "QAAAkwIANFNrcmlsbGV4ICYgSGFic3RyYWt0IC0gQ2hpY2tlbiBTb3VwIFtPZmZpY2lhbCBBdWRpb10ABU9XU0xBAAAAAAADLIAACzIyTVdyV1BWX1FNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9MjJNV3JXUFZfUU0AB3lvdXR1YmUAAAAAAAAAAA==";

console.log(encodeTrack(decodeTrack(track)).toString("base64") === track);

Logs true

About

Decode lavaplayer tracks locally

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published