开发者

Retrieving artist and song information from youtube

开发者 https://www.devze.com 2023-01-29 09:52 出处:网络
A long time ago, I developed a chrome extension that is able to scrobble the songs you listen to on youtube (via your last.fm account). What I did was simply taking the title of the video and assuming

A long time ago, I developed a chrome extension that is able to scrobble the songs you listen to on youtube (via your last.fm account). What I did was simply taking the title of the video and assuming it had the proper format: "Artist - Track name" (obviously, I would send a request to last.fm, confirming it was a pr开发者_开发技巧oper artist/song pair, before scrobbling). Recently (well, probably a couple of months ago) youtube started to provide artist and song information directly under the video (see image), and I was wondering how best to extract this information.

Retrieving artist and song information from youtube

I was hoping to retrieve the information via the youtube feed api call (http://gdata.youtube.com/feeds/api/videos/videoID?alt=json), but it doesn't apear to be featured in the returned json element. Alternatly, I could try extracting it via xpath, but I figure that might lead to complications when no artist/song information is present. If anybody could help me extract this information, and thereby greatly improving my extension, I would be very grateful.


I don't think YouTube API can provide you with the artist name as the videos can be other things that songs you need to stick with what you have , unless they updated there API

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号