Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Http

Index

Constructors

Properties

Accessors

Methods

Constructors

  • new Http(node: BaseNode, input: string, base?: string): Http

Properties

base: undefined | string
input: string
node: BaseNode
routeplanner: RoutePlanner

Accessors

  • get url(): URL

Methods

  • decode(track: string): Promise<TrackInfo>
  • decode(tracks: string[]): Promise<Track[]>
  • decode(tracks: string | string[]): Promise<TrackInfo | Track[]>
  • Decodes a track.

    example
    const identifier = 'QAAAjQIAJVJpY2sgQXN0bGV5IC0gTmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAADlJpY2tBc3RsZXlWRVZPAAAAAAADPCAAC2RRdzR3OVdnWGNRAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9ZFF3NHc5V2dYY1EAB3lvdXR1YmUAAAAAAAAAAA==';

    const track = await http.decode(identifier);
    console.log(track);
    // Logs: {
    // "identifier": "dQw4w9WgXcQ",
    // "isSeekable": true,
    // "author": "RickAstleyVEVO",
    // "length": 212000,
    // "isStream": false,
    // "position": 0,
    // "title": "Rick Astley - Never Gonna Give You Up",
    // "uri": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    // }

    Parameters

    • track: string

      The track to be decoded.

    Returns Promise<TrackInfo>

  • Decodes multiple tracks.

    note

    This returns an array of Tracks, not a TrackInfo.

    Parameters

    • tracks: string[]

      The tracks to be decoded.

    Returns Promise<Track[]>

  • Parameters

    • tracks: string | string[]

    Returns Promise<TrackInfo | Track[]>

  • do<T>(method: string, url: URL, data?: Buffer): Promise<T>
  • Type parameters

    • T = unknown

    Parameters

    • method: string
    • url: URL
    • Optional data: Buffer

    Returns Promise<T>

Generated using TypeDoc