I have done some search on the web but could not find a way to retrieve information about a piece of music used in a video (NOT music video), using youtube api.
For example, in the description of this video or this video, there is a separate section about "music in this video", and there one can find information about the title of the song, the artist, the album, license, etc..
What I would like to do is to retrieve this information using youtube api. Unfortunately, so far I have not had any success spotting this piece of information using youtube api. The metadata returned simply does not contain the music information (I can retrieve information such as commentCount, dislikeCount, etc..).
Is it possible to retrieve the information of music used in a video, if such information is present in the video description? Thanks in advance!
There is no documented official API method, but you can use youtube-dl from a Python program to get this information, e. g.
import youtube_dl
url = 'https://www.youtube.com/watch?v=6_b7RDuLwcI'
ydl = youtube_dl.YoutubeDL({})
with ydl:
video = ydl.extract_info(url, download=False)
print('{} - {}'.format(video['artist'], video['track']))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With