Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
/ lucida-module-yandex Public archive

Yandex.Music support for Lucida downloader library

License

Notifications You must be signed in to change notification settings

synzr/lucida-module-yandex

Repository files navigation

THIS LIBRARY IS MOVED TO GIT.GAY

THIS REPOSITORY IS DEPRECATED AND ARCHIVED!

lucida-module-yandex

Lint Versioning Release

Yandex.Music module for Lucida downloader library.

Installation

# npm
npm install lucida-module-yandex

# pnpm
pnpm add lucida-module-yandex

Roadmap

  • Account status fetch implementation
  • Instant search for lucida.search()
  • Metadata fetcher implementation
  • Working getStream() implementation
  • Basic codebase refactoring
  • CI/CD via GitHub Actions
  • Optional MTS Music API proxy
  • Deprecated API as fallback after bad signature error
  • Lyrics downloader
  • Documentation of modern "download info" API

Usage example

import Lucida from 'lucida'
import Yandex from 'lucida-module-yandex'

const lucida = new Lucida({
  modules: {
    yandex: new Yandex({
      // the OAuth token (required)
      token: 'y0_0000000000000000000000000000000000000000000000000000000',
      // custom user agent (optional; can be used to bypass SmartCaptcha)
      customUserAgent: 'curl/8.10.1',
      // use MTS Music API proxy for API requests (optional; can be used to bypass SmartCaptcha)
      useMTSProxy: false,
      // force to use the deprecated API to download the audio (optional)
      forceDeprecatedAPI: false,
      // the deprecated API fallback (optional, enable by default)
      deprecatedAPIFallback: true,
      // the HTTP proxy URL (optional; can be used to bypass SmartCaptcha)
      proxyUrl: 'http://user:pass@localhost:8080'
    })
  }
})

async function main() {
  const { yandex: yandexAccount } = await lucida.checkAccounts()
  console.log('Yandex account status:', yandexAccount)

  const boomboxSearch = await lucida.search('бумбокс', 10)
  console.log('Бумбокс (Artist):', boomboxSearch.yandex.artists.shift().url)

  const album = await lucida.getByUrl('https://music.yandex.ru/album/1111940')
  console.log('Поэзия (Album) - ПОЛЮСА:', album.metadata.trackCount, 'track(s)')

  const track = await lucida.getByUrl(
    'https://music.yandex.ru/album/1111940/track/32656060'
  )
  console.log(
    'Поэзия (Track) - ПОЛЮСА:',
    track.metadata.durationMs / 1000,
    'second(s)'
  )

  const streamResponse = await track.getStream()
  console.log('Track mime type:', streamResponse.mimeType)
  console.log('Track size in bytes:', streamResponse.sizeBytes)

  const playlist = await lucida.getByUrl(
    'https://music.yandex.ru/users/yearbyyear/playlists/1235'
  )
  console.log(
    'International 2010s Pop Music (Playlist):',
    playlist.metadata.trackCount,
    'track(s)'
  )
}

void main()

About

Yandex.Music support for Lucida downloader library

Resources

License

Stars

Watchers

Forks

Packages

No packages published