oddluck / limnoria-plugins

Limnoria plugins I wrote or forked.
Do What The F*ck You Want To Public License
39 stars 17 forks source link

SpiffyTitles - YouTube Music artists and albums aren't handled resulting to simple title "YouTube Music" #41

Open Mikaela opened 3 years ago

Mikaela commented 3 years ago

Pasting a YouTube Music artist or album link will simply return to "YouTube Music" instead of the actual title.


2021-W32-5 22:46:28 +0300 <+Aminda> https://music.youtube.com/channel/UCA1tzQiUweOGdzynVXRCTzQ 2021-W32-5 22:46:30 +0300 <~katyusha> ^ YouTube Music
2021-W32-5 22:46:33 +0300 <+Aminda> https://music.youtube.com/playlist?list=OLAK5uy_k_IIpFnaYoUxL7oE6RnloghQD9eFA0BBU 2021-W32-5 22:46:34 +0300 <~katyusha> ^ YouTube Music 2021-W32-5 22:46:41 +0300 <+Aminda> https://music.youtube.com/watch?v=zAB5WU1g7lg 2021-W32-5 22:46:41 +0300 <~katyusha> ^ ► YouTube :: Schala's Theme (From "Chrono Trigger") :: Duration: 03:02 :: Views: 3,007 :: Uploader: Kara Comparetto - Topic :: Uploaded: 2020-01-28 :: 44 ▲ :: 8 ▼ ::0 comments


The bot console returns:

2021-W32-5 22:41:43 +0300 ERROR 2021-08-13T21:41:40 supybot SpiffyTitles: error getting video id from https://music.youtube.com/channel/UCq69aDJl1r6ZmgFyMAoD6jg 2021-W32-5 22:46:30 +0300 ERROR 2021-08-13T21:46:28 supybot SpiffyTitles: error getting video id from https://music.youtube.com/channel/UCA1tzQiUweOGdzynVXRCTzQ 2021-W32-5 22:46:33 +0300 ERROR 2021-08-13T21:46:33 supybot SpiffyTitles: error getting video id from https://music.youtube.com/playlist?list=OLAK5uy_k_IIpFnaYoUxL7oE6RnloghQD9eFA0BBU

oddluck commented 3 years ago

Yeah, looks like youtube music uses a different set of api calls, I'll have to look into the documentation. Thanks for pointing this out, new to me.

Mikaela commented 3 years ago

I forgot to say it before, but I think this may be related or also result in fixing https://github.com/oddluck/limnoria-plugins/issues/26.

oddluck commented 3 years ago

Separate issues is fine, it's all ultimately an API endpoint issue and needing to code for each one. Was less of a concern before YouTube started using javascript to render page titles, and the plugin just provided additional data as a bonus. Now YouTube just provides the site name and no title data. Channel links will need to be passed through the channel endpoint, playlists through the playlist endpoint, and now music through the music endpoint, etc. In addition, new template types will need to be added to the config; channelTemplate, playlistTemplate, musicTemplate, and so on. It's not hard to do, just been really busy with other stuff lately, I'll try to get working on it as soon as I can. Most time consuming part is reading the API docs so you know what variables to reference and what calls to make. Though if someone has basic python knowledge it's within the capabilities of even the novice programmer I think... assuming anyone else wants to take a crack at it.