Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ytmusic

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytmusic

Unofficial Youtube Music Api

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by10%
Maintainers
1
Weekly downloads
 
Created
Source

Unofficial YouTube Music API

GitHub last commit GitHub npm bundle size Snyk Vulnerabilities for GitHub Repo

Simple API Project for NodeJS written in TypeScript inspired by sigma67's python library

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development.

Prerequisites

  1. NodeJS 10+
  2. NPM
  3. Google Account

Installing

Using npm

NPM

Building it yourself

Clone github repo

  $ git clone https://github.com/vladdenisov/ytmusic-api 

Install dependencies

  $ npm i

Build it

  $ npm run build

You will see dist folder, where all built files are stored.

Usage

Get the auth cookie from requests to YTMusic in your browser:

  • Open YouTube Music in browser
  • Go to the developer tools (Ctrl-Shift-I) and find an authenticated POST request. You can filter for /browse to easily find a suitable request.
  • Copy cookie from Request Headers
Using in code

Import lib to your code:

  const { YTMUSIC } = require('ytmusic')
  // or if you build it yourself
  const { YTMUSIC } = require('path/to/ytmusic/dist/index.js')

Create new Instance of api with your cookie:

  const api = new YTMUSIC("cookie")

  // or if you want it to use not default account, specify userID (refer to docs to get it): 
  const api = new YTMUSIC("cookie", "userID")

Use it:

  const data = await api.getPlaylist('RDCLAK5uy_k1Wu8QbZASiGVqr1wmie9NIYo38aBqscQ')
  console.log(data.title)
  // { text: '80s Pop-Rock Anthems' }

Built With

  • TypeScript - JavaScript that scales.
  • node-fetch - A light-weight module that brings window.fetch to Node.js

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Just contribute <3

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

FAQs

Package last updated on 04 Jan 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc