nickp10 / youtube-music-ts-api Goto Github PK
View Code? Open in Web Editor NEWAn unofficial YouTube Music API written in TypeScript for easy integration into your projects
License: MIT License
An unofficial YouTube Music API written in TypeScript for easy integration into your projects
License: MIT License
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.
exports.js
from the 1.6.0 npm package differs greatly when compared to exports.js
built from the 1.6.0 repo commit.
(left is from npm, right is built from repo)
To build from repo (tested with Node 14/16/18):
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?
Following the example in the readme will cause a TypeError: YouTubeMusic is not a constructor
This error should not occur
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);
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)
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 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.
package.json
does not specify the node/npm version using engines
and the project does not include an .nvmrc
file -- can you specify what the minimum or required node/npm versions should be
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.