Socket
Book a DemoInstallSign in
Socket

@lavalink/encoding

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lavalink/encoding

Decode lavaplayer tracks locally

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
13
-13.33%
Maintainers
2
Weekly downloads
 
Created
Source

Lavaplayer Track Info

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

Installation

npm i @lavalink/encoding

Usage

import { decode } from "@lavalink/encoding";

const track = "QAAAkwIANFNrcmlsbGV4ICYgSGFic3RyYWt0IC0gQ2hpY2tlbiBTb3VwIFtPZmZpY2lhbCBBdWRpb10ABU9XU0xBAAAAAAADLIAACzIyTVdyV1BWX1FNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9MjJNV3JXUFZfUU0AB3lvdXR1YmUAAAAAAAAAAA==";

console.log(decode(track));
console.log(decode(new Uint8Array(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

import { encode, decode } from "@lavalink/encoding";

const track = "QAAAkwIANFNrcmlsbGV4ICYgSGFic3RyYWt0IC0gQ2hpY2tlbiBTb3VwIFtPZmZpY2lhbCBBdWRpb10ABU9XU0xBAAAAAAADLIAACzIyTVdyV1BWX1FNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9MjJNV3JXUFZfUU0AB3lvdXR1YmUAAAAAAAAAAA==";

console.log(encode(decode(track)) === track); // true

Keywords

lavaplayer

FAQs

Package last updated on 04 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts