[split] Feature Request - Video trailers for artists
#1
Thanks for all your work in Kodi’s music section! Recently I started to think in ways to improve the music part of my skin and thought it would be cool to let the user play online music videos of their songs. I learned that theaudiodb.com offers a lot of links to music videos and @ronie told me there’s no problem scraping that info, but a field in the library is needed… 

https://forum.kodi.tv/showthread.php?tid...pid3085716

…is there any chance of getting this, kind of trailer for movies, but music video for songs in this case?

Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#2
@manfeed I split this off because I think it deserves it's own thread to discuss it further!

1) do you envisage this just for artists, or would it need extending at some point to albums and/or songs?  I ask because no point in half implementing something.
2) How does this get returned to a skin?  A single listitem can only contain one path AFAIK, so what would you need to show say 5 video links ?

Looking at theaudiodb, for AC/DC there are 4 video links.  Do you envisage scraping them all or just the first?  Looking at the video side of things it seems that there is just the one trailer stored.

FWIW, I think this is a good idea and have some images in my head of how it could look but skinning ls a black art to me, so I would need to know exactly what core needs to supply for a skin to be able to take advantage of it.  Reasonably sure that ronie can make the scraper fit the requirements so it's mainly down to what needs storing in the db and what labels a skin would need to show that info.
Learning Linux the hard way !!
Reply
#3
Thanks for your interest! Actually I think the music video field should be in the songs table of the music library. Like I said I think of this feature like a trailer for a movie. Someone could say that many movies have several trailers, but for the time being everybody seems content having in Kodi just one trailer stored for each movie. The same could be done for songs, there’s no need to complicate things. Let’s say there would be a field in the songs table of the library named videoclip, that could be accessed with ListItem.Videoclip. That would be enough for a skinner to make wonders, since they could be showed grouped by albums or artists…
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#4
There are two different levels at play here as far as I can see.  One is the artist level, which links 1 or more videos (or none) and the song level which links the video of the actual song.  The former could be stored in the artist table (either one video link or multiple video links) while the latter could easily be stored in the song table.  The latter is certainly easier to implement in the db and gui.  I'll need to figure out the interaction between the scraper and core to see how stuff gets returned.

I'm all for improving the music library where we can!!
Learning Linux the hard way !!
Reply
#5
Great!  Nod
I think that the videos that you see at the artist level of themusicdb are taken from the songs, they are there on display as a sample of what is available. Maybe @docwra can confirm this... In fact if you select an artist with many videos (Taylor Swift for instance...) you can see 4 different videos each time you visit her artist page. What's more, you can only add/change videos at the song level, so I would say you only have to work in the song table...
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#6
Makes sense to pick random videos to put on the artist page if you have enough available.  I'm just looking at things from a design point of view.  We don't have a song scraper AFAIK, just album and artist. Neither of those are "track aware" and as far as I can tell, no mvid info is returned with either an album lookup or an artist lookup.

However, it is possible to fetch all the videos for an artist using the artist MBID.  As files are scanned first before being scraped, then as long as they have been tagged with MBID's it would be possible for the artist scraper to fetch the list of available videos.  Unfortunately, the list does not contain the musicbrainztrackID mbid, else it would have been extremely simple to tie a video link to a song.  Therefore we would have to match up links and songs by title alone.  This might work alright given that we know the artist, but then Peter Gabriel released 4 albums all called "Peter Gabriel" so who's to say that a particular artist hasn't released two or more completely different songs under the same title......idk....

It might work fine, but I would have preferred a unique identifier to do it with.  In my head, matching on a string leaves room for errors. I guess the only way to know for sure is to try it!!
Learning Linux the hard way !!
Reply
#7
Sure awesome suggestion...

Return all music videos for an artist (using internal ID). Also works with MusicBrainz ID on Kodi's private scraper API key.
php:
https://theaudiodb.com/api/v1/json/2/mvid.php?i=112024
mvid-mb.php?i=(MbArtistID} 

YouTube clips are indeed allocated to each individual track. They can be looked up easily with the above or by doing an artist/track search on our API or finding the internal ID or MusicBrainz recording ID.

php:
searchtrack.php?s={Artist_Name}&t={Single_Name}
https://theaudiodb.com/api/v1/json/2/tra...h=32793500
track-mb.php?i={mb_recording_id}

Let me know if anything is needed, eager to get this working as it would really open up Kodi to Streamable Music Videos.
Reply
#8
Well, the only way I can see to implement this is to use the artist scraper to grab all the associated videos in an array and then map those later to songs.  Neither the album or artist scraper is "aware" of what songs are related to an album or artist so core would need to figure out that relationship.

However, given an array of songs (containing title, video link at the least), it should be possible.....I think.....

@docwra Would it be possible to return the Musicbrainz Recording ID for the video or do you not store that?  Given that ID, it would be easy to link a video to a song.  EG, the track MBID for AC/DC's Rock & Roll Train is 35eca894-c66c-4205-850b-77b72f579680.  If that were returned in the json results it would be easy to map the video link to a song, assuming that all tracks are actually tagged with mbids.  Failing that, a fallback to artist/track name could be used but the MBID is a definitive value and would be my preferred method of mapping.

Adding a new field to the db is straightforward, as is getting the info from it into a listitem.  Getting the data from a website and populating the db with it is less straightforward though.

I think it's a great idea and I can see in my head how I would want it to look in the gui but I/we need to sort out the implementation details first.

So I think
  • Artist scraper grabs all videos for a particular artist
  • Core adds links to videos where a track for that artist exists in the db
  • Listitem contains link to video when said track is highlighted
For best results, this depends on theaudiodb being able to supply the Musicbrainz_RecordingID if possible.
Learning Linux the hard way !!
Reply
#9
I'm sorry I can't be of much help... music library and scrapers are also a black art to me... 

Anyway, I got to make this work for local music videos only identifying them by the artist, album and title provided by the music video library after having scraping them, and it works quite well as you can see...

https://streamable.com/7eeeqy

...obviously when dealing with Peter Gabriel and his 4 albums named after himself I'll be in trouble, but I don't think there must be that many artists so self-centered or lacking imagination... Rofl so if no better way can be achieved, I think that this could be the second best option.
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#10
@manfeed, @docwra  There is a testbuild for Win64 here. This will add 2 new listitems, ListItem.SongVideoURL & ListItem.SongVideoThumb.

This build should include a modified generic artist scraper that will fetch all the mvid links from theaudiodb and match them up to any songs in your library by the artist it is currently scraping. SongVideoThumb is only populated if there is a corresponding thumb returned by theaudiodb. SongVideoURL is formatted up the same as the video library trailers...plugin://plugin.video.youtube/?action=play_video&videoid=etAIpkdhU9Q.

It would be wise to install it in portable mode, but I guess you already know that as this is not yet finished. It does work well enough for initial testing purposes though.  It does not support song artists currently (and I'm not sure it ever will!), just album artists. It does however include json support and import/export of links via nfo files.

My pathetic skinning skills allowed me to test with confluence a little bit.  Thumb in bottom right with video URL underneath it (didn't know how to link it to an action!!).

Image


To get going quickly and avoid having to scan albums in again, if you install it in portable mode and then copy in your existing music82.db into Database in your userdata folder before you run it.  The db will be upgraded and then make sure that the artist scraper is the generic artist scraper.  You can then refresh artists individually from the artistinfo dialog or all of them from the context menu on the artists node.  The re-scrape should pick up the video links for the artist(s) .

There will be bugs!  Please let me know if you find them or just what works and what doesn't, thanks.
Learning Linux the hard way !!
Reply
#11
@black_eagle 

This is beyond my wildest dreams!

I had a bit of a hard time trying to scrape the music correctly, but this is the result of a quick test...

https://streamable.com/sse8us

I'll tell you more when I can test it more... Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#12
Tested on Coldplay discography and works as expected. No issues. Very nice!!

Only thing I can think of is maybe falling back to the album cover if the single doesn't exist. Then again if it causes more API hits then maybe not... Might be a good reason for people to upload single covers.

Image
Reply
#13
I think there's no need to scrape the album art as fallback, since that can be easily dealt with in the skins, it's just a matter of a visible condition, if no video music image exists, then show album image...
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#14
@black_eagle 

A couple of questions so far...

As you can see in the image the first song as a video, but it's not been scraped, maybe the reason is the '...' at the start of the songs's title ?

Image

Another topic is that @ronie had recently made some changes in the Generic Scrapers since there were more images in theaudiodb that weren't being scraped... Do your versions of the scrapers contain those changes?

Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#15
@manfeed Hmmm, not sure for 1 yet, guess I need to extend my TS collection!  If it's on the audiodb then it should be returned in the mvid list for Taylor.  But then, as the matching is done on artist and track name, the album track title has to match exactly the mvid title returned from tadb.  This is partly why I wasn't keen on matching up this way, it leaves room for error.  Different punctuation or capitalization for instance can throw it off.  Capitalization is already taken care of but punctuation items or accents on letters etc could potentially stop tracks matching up correctly.

2) Scraper is whatever version it reports + my changes to it.  The only thing I version bumped was the music db itself although for a proper PR, the json schema would need bumping too along with the scraper version.  That said, I'm sure ronie would write neater/better python code than mine.  I just basically copied the discography part for tadb and then adjusted it for mvids.
(2022-02-18, 14:24)docwra Wrote: No issues.

Oh, there will be, no doubt.  You just haven't found one yet Wink
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
[split] Feature Request - Video trailers for artists0