RandomNinjaAtk / arr-scripts

Extended Container Scripts - Automation scripts to make life easier!
GNU General Public License v3.0
683 stars 71 forks source link

[FEATURE] - Lidarr - Adding support for Youtube Music #91

Open Killface1980 opened 11 months ago

Killface1980 commented 11 months ago

Hello Mr. Ninja,

While using the Arr scripts more and more, I've notived some issues. Like many music videos are not being downloaded due to geoblocking, a deleted user account, a private video. In case a video is downloaded, sometimes IMVDB only has the link to a poor quality version uploaded by a private user 15 years ago, while a hires/HD remaster is residing on the artist's channel. IMVDB seems to take forever with upates (I wonder for how long Massive Attacks 'Angel' is misspelled as 'Angle'), so I quiestion that IMVDB as a reliable source. Also some artists do release videos, while no one keeps track on IMVDB. Adding those videos to Musicbrainz takes forever, and can't replaced the outdated videos yet.

I was using the Tital video script recently and noticed its behaviour. With some artists like Weezer, 4:3 videos have been uploaded in 16:9 format with black bars, which overwrote my good quality YT version, as the file size was bigger :-( Also it takes all videos into account, also live versions or TV broadcasts or one hour long interviews (see Interpol, video "Interpol") I don't want. As Tidal is a mess considering music videos, I'll skip it for now.

So here's the idea: Use Youtube Music to get the official music videos. I've written a python script which is able to get all official music videos of an artist's channel by the channel slug, custom_url or LidarrArtistTag. I'm currently including it into the VideoService, and I'm not sure what's the best way to so. I'm thinking of the following possibilites:

I think I'll get some kind of cache working first like ImvdbCache. See below the log of my current test script for the artist Air. I'm also testing a relevancce system to filter out unpopular videos. Do you have any ideas regarding the best integration approach?

PS Microsoft.PowerShell.Core\FileSystem::\\powerplay\config\Lidarr\Config\extended> python .\search_youtube.py "airfrenchband" test true
Now looking for the artist.
Found potential artist browseid: UCH_Q3OLUXLZNF0qmnY3bCXg
Found browseId: VLOLAK5uy_mrgcsaQTOWns6iFbivTNBT5HOb7xjuqPA
Overview of All Videos - found 28 videos, filtered:
Video 1: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Playground Love (from π‘‡β„Žπ‘’ π‘‰π‘–π‘Ÿπ‘”π‘–π‘› 𝑆𝑒𝑖𝑐𝑖𝑑𝑒𝑠 𝑂𝑆𝑇 - Official Video) - https://www.youtube.com/watch?v=NAgX1jO3No0 -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 3M
Video 2: Type: MUSIC_VIDEO_TYPE_OMV - AIR - All I Need (feat. Beth Hirsch) (from π‘€π‘œπ‘œπ‘› π‘†π‘Žπ‘“π‘Žπ‘Ÿπ‘– - Official Video) - https://www.youtube.com/watch?v=kxWFyvTg6mc -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 1M
Video 3: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Sexy Boy (from π‘€π‘œπ‘œπ‘› π‘†π‘Žπ‘“π‘Žπ‘Ÿπ‘– - Official Video) - https://www.youtube.com/watch?v=wouKI_myXxk -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 4M
Video 4: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Le Soleil est près de moi (Official Video) - https://www.youtube.com/watch?v=ItidwkXHr5g -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 252K                                                                                                                                                                    
Video 5: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Kelly Watch the Stars (from π‘€π‘œπ‘œπ‘› π‘†π‘Žπ‘“π‘Žπ‘Ÿπ‘– - Official Video) - https://www.youtube.com/watch?v=Rui0hzN-EFE -Published 2008-04-03 - Uploaded: 2008-04-03 - Views: 3M
Video 6: Type: MUSIC_VIDEO_TYPE_OMV - AIR - How Does It Make You Feel? (from 10 000 𝘏𝘻 π˜“π˜¦π˜¨π˜¦π˜―π˜₯ - Official Video) - https://www.youtube.com/watch?v=i0vl-7L-2Ow -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 649K
Video 7: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Mer du Japon (from π‘ƒπ‘œπ‘π‘˜π‘’π‘‘ π‘†π‘¦π‘šπ‘β„Žπ‘œπ‘›π‘¦ - Official Video) - https://www.youtube.com/watch?v=Sjq4_sHy06U -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 266K
Video 8: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Sing Sang Sung (from π˜“π˜°π˜·π˜¦ 2 - Official Video) - https://www.youtube.com/watch?v=WuSPRu4lzag -Published2016-04-27 - Uploaded: 2016-04-27 - Views: 982K
Video 9: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Radio Number 1 (from 10 000 𝘏𝘻 π˜“π˜¦π˜¨π˜¦π˜―π˜₯ - Official Video) - https://www.youtube.com/watch?v=4Js8iNk3zEc -Published 2021-11-23 - Uploaded: 2021-11-23 - Views: 71K
Video 10: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Don't Be Light (Official Video) - https://www.youtube.com/watch?v=ysk_dQ39ctE -Published2016-04-28 - Uploaded: 2016-04-28 - Views: 289K                                                                                                                                                                              
Video 11: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Cherry Blossom Girl (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - https://www.youtube.com/watch?v=3nOzKl8AV18 -Published 2019-11-27 - Uploaded: 2019-11-27 - Views: 118K
Video 12: Type: MUSIC_VIDEO_TYPE_OMV - AIR - So Light Is Her Footfall (from πΏπ‘œπ‘£π‘’ 2 - Official Video) - https://www.youtube.com/watch?v=AQM6TC2pkUU -Published 2016-04-27 - Uploaded: 2016-04-27 - Views: 288K
Video 13: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Alpha Beta Gaga (from π˜›π˜’π˜­π˜¬π˜ͺ𝘦 𝘞𝘒𝘭𝘬π˜ͺ𝘦 - Official Video) - https://www.youtube.com/watch?v=oVMHX8imk_8 -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 284K
Video 14: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Once Upon a Time (from π‘ƒπ‘œπ‘π‘˜π‘’π‘‘ π‘†π‘¦π‘šπ‘β„Žπ‘œπ‘›π‘¦ - Official Video) - https://www.youtube.com/watch?v=lFWGStDgBpo -Published 2016-04-28 - Uploaded: 2016-04-28 - Views: 122K
Video 15: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Alpha Beta Gaga (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - https://www.youtube.com/watch?v=GaMJJLmRprA -Published2019-11-20 - Uploaded: 2019-11-20 - Views: 83K
Video 16: Type: MUSIC_VIDEO_TYPE_OMV - AIR - Don't Be Light (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - https://www.youtube.com/watch?v=9P9UgzJUPLg -Published 2019-12-04 - Uploaded: 2019-12-04 - Views: 46K
Video 17: Type: MUSIC_VIDEO_TYPE_OMV - AIR - How Does It Make You Feel? (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - https://www.youtube.com/watch?v=LdfGIszkSMY -Published 2019-12-16 - Uploaded: 2019-12-16 - Views: 30K
True
Average View Count Per Month: 9K
1. Title: AIR - Sexy Boy (from π‘€π‘œπ‘œπ‘› π‘†π‘Žπ‘“π‘Žπ‘Ÿπ‘– - Official Video) - View per month: 51K - Relevance Score: 3.45 - ID: wouKI_myXxk
2. Title: AIR - Playground Love (from π‘‡β„Žπ‘’ π‘‰π‘–π‘Ÿπ‘”π‘–π‘› 𝑆𝑒𝑖𝑐𝑖𝑑𝑒𝑠 𝑂𝑆𝑇 - Official Video) - View per month: 35K - Relevance Score: 2.35 - ID: NAgX1jO3No0
3. Title: AIR - Kelly Watch the Stars (from π‘€π‘œπ‘œπ‘› π‘†π‘Žπ‘“π‘Žπ‘Ÿπ‘– - Official Video) - View per month: 18K - Relevance Score: 1.20 - ID: Rui0hzN-EFE
4. Title: AIR - All I Need (feat. Beth Hirsch) (from π‘€π‘œπ‘œπ‘› π‘†π‘Žπ‘“π‘Žπ‘Ÿπ‘– - Official Video) - View per month: 17K - Relevance Score: 1.15 - ID: kxWFyvTg6mc
5. Title: AIR - Sing Sang Sung (from π˜“π˜°π˜·π˜¦ 2 - Official Video) - View per month: 10K - Relevance Score: 0.72 - ID: WuSPRu4lzag
6. Title: AIR - How Does It Make You Feel? (from 10 000 𝘏𝘻 π˜“π˜¦π˜¨π˜¦π˜―π˜₯ - Official Video) - View per month: 7K - Relevance Score: 0.48 - ID: i0vl-7L-2Ow
7. Title: AIR - Don't Be Light (Official Video) - View per month: 3K - Relevance Score: 0.26 - ID: ysk_dQ39ctE
8. Title: AIR - So Light Is Her Footfall (from πΏπ‘œπ‘£π‘’ 2 - Official Video) - View per month: 3K - Relevance Score: 0.21 - ID: AQM6TC2pkUU
9. Title: AIR - Alpha Beta Gaga (from π˜›π˜’π˜­π˜¬π˜ͺ𝘦 𝘞𝘒𝘭𝘬π˜ͺ𝘦 - Official Video) - View per month: 3K - Relevance Score: 0.21 - ID: oVMHX8imk_8
10. Title: AIR - Radio Number 1 (from 10 000 𝘏𝘻 π˜“π˜¦π˜¨π˜¦π˜―π˜₯ - Official Video) - View per month: 3K - Relevance Score: 0.20 - ID: 4Js8iNk3zEc
11. Title: AIR - Mer du Japon (from π‘ƒπ‘œπ‘π‘˜π‘’π‘‘ π‘†π‘¦π‘šπ‘β„Žπ‘œπ‘›π‘¦ - Official Video) - View per month: 2K - Relevance Score: 0.20 - ID: Sjq4_sHy06U
12. Title: AIR - Le Soleil est près de moi (Official Video) - View per month: 2K - Relevance Score: 0.22 - ID: ItidwkXHr5g
13. Title: AIR - Cherry Blossom Girl (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - View per month: 2K - Relevance Score: 0.17 - ID: 3nOzKl8AV18
14. Title: AIR - Alpha Beta Gaga (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - View per month: 1K - Relevance Score: 0.12 - ID: GaMJJLmRprA
15. Title: AIR - Once Upon a Time (from π‘ƒπ‘œπ‘π‘˜π‘’π‘‘ π‘†π‘¦π‘šπ‘β„Žπ‘œπ‘›π‘¦ - Official Video) - View per month: 1K - Relevance Score: 0.09 - ID: lFWGStDgBpo
16. Title: AIR - Don't Be Light (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - View per month: 1K - Relevance Score: 0.07 - ID: 9P9UgzJUPLg
17. Title: AIR - How Does It Make You Feel? (π΅π‘–π‘›π‘Žπ‘’π‘Ÿπ‘Žπ‘™ 𝐿𝑖𝑣𝑒 - Official Video) - View per month: 657 - Relevance Score: 0.04 - ID: LdfGIszkSMY
RandomNinjaAtk commented 11 months ago

If its a bash script, it can be easily integrated, if you want to develop it.

The problem with multiple sources is your likely to end up with lots of duplicates because each source names them differently.... And the reason I never opted to just pull from the Artists linked channel is because there is no moderation to know if the video is what you want... So using something like IMVDB lets you filter out the noise and hopefully only grab the stuff you should want...

You can write a script within the container /config/extended directory and test from within the container using the CLI. It's how I write/test scripts...

For lots of code samples, just look through the existing scripts because if you take the Tidal script as a base, a lot of the work is likely done for you... Since it already processes each artist, you just need to change the source and etc.

I will welcome a PR for a script or if you can provide code samples, I can possibly look at writing something. But with 3 different video scripts, probably would need to make them all optional and let the user choose using the config file which ones to use if any at all...

Right now I think it does a decent job at using both at the same time... And we're likely to never have a perfect solution because it's a mess to start with...