npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lucida-module-yandex

v0.11.2

Published

Yandex.Music module for Lucida downloader library.

Downloads

235

Readme

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

  • [x] Account status fetch implementation
  • [x] Instant search for lucida.search()
  • [x] Metadata fetcher implementation
  • [x] Working getStream() implementation
  • [x] Basic codebase refactoring
  • [x] CI/CD via GitHub Actions
  • [x] Optional MTS Music API proxy
  • [x] 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)
      oauthToken: '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)
      forceDeprecatedDownloadInfoAPI: false
    })
  }
})

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()