youtube api - retrieve "music in this video" info from video metadata?
Asked Answered
P

1

8

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..

enter image description here

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!

Penetrating answered 6/6, 2018 at 3:32 Comment(2)
Same here, and no unfortunately no way to get these metas. Maybe in the future with YouTube Music, if they are improving the data API with it...Interrex
@Interrex this is the issue tracker I post about this problem.Goggin
S
5

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']))
Sublimation answered 27/7, 2019 at 11:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.