GithubHelp home page GithubHelp logo

nickp10 / youtube-music-ts-api Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 5.0 999 KB

An unofficial YouTube Music API written in TypeScript for easy integration into your projects

License: MIT License

JavaScript 3.44% TypeScript 96.56%

youtube-music-ts-api's People

Contributors

foxxmd avatar larbear avatar nickp10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

youtube-music-ts-api's Issues

Getting library history?

I would like get a list (playlist?) of an authenticated user's recently played tracks.

In ytmusicapi there is a get_history() api call but it hints this is just a playlist from the user's library. The source code for this method makes a request with the body {'browseId': 'FEmusic_history'}...

Is this something I can achieve using your library with getPlaylist()?

I realize this might be something I can test myself but I don't have a YT Music account yet...I'm doing the legwork to see if it's possible in order to integrate this functionality into my application multi-scrobbler before committing the time to write the actual implementation.

Please let me know if what I'm trying to achieve is feasible...I can potentially contribute a PR for this if its possible with a few changes/additions to your library.

Reproducible build on 1.6.0

exports.js from the 1.6.0 npm package differs greatly when compared to exports.js built from the 1.6.0 repo commit.

diff

(left is from npm, right is built from repo)

To build from repo (tested with Node 14/16/18):

  • Clone the repo
  • npm install
  • npm run prepare

This might be related to #28 as I don't know what npm/node versions should be used.

1.6.0 from npm does work for fixing authentication for user's cookies but the version built from the repo does not. Is this due to not having correct dependency versions (due to npm/node), is there something else that should be done to reproduce the prod build, or is there work missing in the npm version that is not in the repo?

[BUG]: YouTubeMusic is not a constructor

Please describe the current behaviour of the code.

Following the example in the readme will cause a TypeError: YouTubeMusic is not a constructor

Please describe the expected behaviour of the code.

This error should not occur

What are the steps to reproduce the error?

Slightly modified code based off the readme example:

import YouTubeMusic from "youtube-music-ts-api";

import untypedConfig from "../config/config.json" assert { type: "json" };
import type { Config } from "./types/config.js";
const { YouTubeMusicCookie } = untypedConfig as Config;

const cookieStr = YouTubeMusicCookie;
const ytm = new YouTubeMusic(); // "TypeError: YouTubeMusic is not a constructor" on build
const ytma = await ytm.authenticate(cookieStr);
const playlists = await ytma.getLibraryPlaylists();
console.log(playlists);

Additional Information

typescript 5.4.2 (also tested with 5.2.2)
tsx 4.7.1
youtube-music-ts-api 1.7.0
node 21.7.1 (also tested with 18.19.1)

move track

Is there a way of moving a track up or down in a playlist, apart from getting all the tracks, changing the order of a track, deleting all tracks and then adding the rearranged tracks back in ?

getAlbum returning undefined

getAlbum is returning undefined. It appears the response format has changed and is now more similar to the playlist response. Consider re-implementing album-parser.ts:parseAlbumDetailResponse to be more like playlist-parser.ts:parsePlaylistDetailResponse based on the updated response.

getLibraryPlaylists returning browseId

getLibraryPlaylists is returning the browseId and not the playlistId, they appear to be nearly identical strings except my browseId's have 'VL' prepended to them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.