zS1L3NT / ts-npm-ytmusic-api

A type-safe and basic YouTube Music API wrapper
https://npmjs.com/package/ytmusic-api
GNU General Public License v3.0
81 stars 17 forks source link

feat: implement Next Song retrieval and parsing #35

Open mcanam opened 3 months ago

mcanam commented 3 months ago

This method comes from youtube-music-api to get a list of songs in the UP NEXT tab.

Test Results ``` bash bun test v1.1.18 (5a0b9352) src/tests/core.spec.ts: ✓ Query: Lilac > Search suggestions [369.11ms] ✓ Query: Lilac > Search Songs [683.22ms] ✓ Query: Lilac > Search Videos [548.53ms] ✓ Query: Lilac > Search Artists [506.44ms] ✓ Query: Lilac > Search Albums [676.66ms] ✓ Query: Lilac > Search Playlists [472.35ms] ✓ Query: Lilac > Search All [552.58ms] ✓ Query: Lilac > Get Next [863.58ms] ✓ Query: Lilac > Get lyrics of the first song result [801.04ms] ✓ Query: Lilac > Get details of the first song result [979.70ms] ✓ Query: Lilac > Get details of the first video result [802.75ms] ✓ Query: Lilac > Get details of the first artist result [772.81ms] ✓ Query: Lilac > Get the songs of the first artist result [2409.16ms] ✓ Query: Lilac > Get the albums of the first artist result [954.01ms] ✓ Query: Lilac > Get details of the first album result [804.46ms] ✓ Query: Lilac > Get details of the first playlist result [656.16ms] ✓ Query: Lilac > Get the videos of the first playlist result [768.51ms] ✓ Query: Weekend > Search suggestions [160.46ms] ✓ Query: Weekend > Search Songs [669.77ms] ✓ Query: Weekend > Search Videos [542.16ms] ✓ Query: Weekend > Search Artists [683.79ms] ✓ Query: Weekend > Search Albums [603.01ms] ✓ Query: Weekend > Search Playlists [615.39ms] ✓ Query: Weekend > Search All [685.32ms] ✓ Query: Weekend > Get Next [646.49ms] ✓ Query: Weekend > Get lyrics of the first song result [817.00ms] ✓ Query: Weekend > Get details of the first song result [946.69ms] ✓ Query: Weekend > Get details of the first video result [802.54ms] ✓ Query: Weekend > Get details of the first artist result [838.22ms] ✓ Query: Weekend > Get the songs of the first artist result [2237.54ms] ✓ Query: Weekend > Get the albums of the first artist result [1080.17ms] ✓ Query: Weekend > Get details of the first album result [751.35ms] ✓ Query: Weekend > Get details of the first playlist result [824.91ms] ✓ Query: Weekend > Get the videos of the first playlist result [1098.36ms] ✓ Query: Eill > Search suggestions [111.23ms] ✓ Query: Eill > Search Songs [767.89ms] ✓ Query: Eill > Search Videos [569.02ms] ✓ Query: Eill > Search Artists [712.98ms] ✓ Query: Eill > Search Albums [555.77ms] ✓ Query: Eill > Search Playlists [396.92ms] ✓ Query: Eill > Search All [595.76ms] ✓ Query: Eill > Get Next [509.68ms] ✓ Query: Eill > Get lyrics of the first song result [799.23ms] ✓ Query: Eill > Get details of the first song result [890.07ms] ✓ Query: Eill > Get details of the first video result [760.93ms] ✓ Query: Eill > Get details of the first artist result [841.71ms] ✓ Query: Eill > Get the songs of the first artist result [1841.29ms] ✓ Query: Eill > Get the albums of the first artist result [1236.95ms] ✓ Query: Eill > Get details of the first album result [876.98ms] ✓ Query: Eill > Get details of the first playlist result [656.01ms] ✓ Query: Eill > Get the videos of the first playlist result [1063.01ms] ✓ Query: Eminem > Search suggestions [110.57ms] ✓ Query: Eminem > Search Songs [543.26ms] ✓ Query: Eminem > Search Videos [540.89ms] ✓ Query: Eminem > Search Artists [552.93ms] ✓ Query: Eminem > Search Albums [553.60ms] ✓ Query: Eminem > Search Playlists [677.39ms] ✓ Query: Eminem > Search All [639.54ms] ✓ Query: Eminem > Get Next [829.32ms] ✓ Query: Eminem > Get lyrics of the first song result [734.23ms] ✓ Query: Eminem > Get details of the first song result [781.16ms] ✓ Query: Eminem > Get details of the first video result [856.85ms] ✓ Query: Eminem > Get details of the first artist result [922.05ms] ✓ Query: Eminem > Get the songs of the first artist result [2683.68ms] ✓ Query: Eminem > Get the albums of the first artist result [1280.90ms] ✓ Query: Eminem > Get details of the first album result [783.78ms] ✓ Query: Eminem > Get details of the first playlist result [833.31ms] ✓ Query: Eminem > Get the videos of the first playlist result [910.74ms] ✓ Query: Lisa Hannigan > Search suggestions [195.81ms] ✓ Query: Lisa Hannigan > Search Songs [539.98ms] ✓ Query: Lisa Hannigan > Search Videos [481.86ms] ✓ Query: Lisa Hannigan > Search Artists [568.36ms] ✓ Query: Lisa Hannigan > Search Albums [569.34ms] ✓ Query: Lisa Hannigan > Search Playlists [623.87ms] ✓ Query: Lisa Hannigan > Search All [553.31ms] ✓ Query: Lisa Hannigan > Get Next [388.62ms] ✓ Query: Lisa Hannigan > Get lyrics of the first song result [853.25ms] ✓ Query: Lisa Hannigan > Get details of the first song result [693.51ms] ✓ Query: Lisa Hannigan > Get details of the first video result [716.74ms] ✓ Query: Lisa Hannigan > Get details of the first artist result [777.36ms] ✓ Query: Lisa Hannigan > Get the songs of the first artist result [1961.72ms] ✓ Query: Lisa Hannigan > Get the albums of the first artist result [1204.07ms] ✓ Query: Lisa Hannigan > Get details of the first album result [683.62ms] ✓ Query: Lisa Hannigan > Get details of the first playlist result [638.46ms] ✓ Query: Lisa Hannigan > Get the videos of the first playlist result [731.99ms] Issues: [] 85 pass 0 fail Ran 85 tests across 1 files. [68.17s] ```
zS1L3NT commented 3 months ago

Modifying the SongParser and VideoParser has broken the tests on my end... trying to figure out what the playlistId and params even are in the first place, especially since playlistId does not look like a real YouTube Music playlist id

mcanam commented 3 months ago

Modifying the SongParser and VideoParser has broken the tests on my end...

i tried to run the test on the main branch and it also failed. i think there is a data change from the API again.

trying to figure out what the playlistId and params even are in the first place, especially since playlistId does not look like a real YouTube Music playlist id

yes you are right, playlistId is not the real id of playlist in yt music but the value of query params list as in this url https://music.youtube.com/watch?v=hjpF8ukSrvk&list=RDAMVMhjpF8ukSrvk

my bad, maybe the name needs to be changed so it's not ambiguous.

zS1L3NT commented 3 months ago

Also I added some workflows to make sure the tests work properly so let's try to get this to work!