@dvxch/yandex-music
    Preparing search index...

    Function getFileInfoSign

    • Create the signature for a /get-file-info (lossless download) request.

      The signature is HMAC-SHA256(key, "{ts}{trackId}{quality}{codecs}{transport}") with commas stripped, Base64-encoded, with the trailing character removed — matching the Android client. The same codecs/transport strings must be sent in the query for the signature to validate.

      Parameters

      • trackId: string | number

        The track the request is scoped to.

      • quality: string = 'lossless'

        Requested quality (for example lossless). Defaults to lossless.

      • codecs: string = FILE_INFO_CODECS

        Requested codecs string. Defaults to FILE_INFO_CODECS.

      • transport: string = FILE_INFO_TRANSPORT

        Requested transport string. Defaults to FILE_INFO_TRANSPORT.

      • key: string = DEFAULT_SIGN_KEY

        The signing key. Defaults to DEFAULT_SIGN_KEY.

      Returns FileInfoSign

      The timestamp/value pair to send alongside the request.