Get Meta Data And Mrl From Youtube, Soundcloud, And Other Platforms
Currently I am using LibVLC to get the metadata and MRL of online videos and music. But this is a lot of stupid overhead just to get this information. ... from vlc import Instance
Solution 1:
After some testing, I decided to use youtube_dl, because it is very easy to use and supports a lot of platforms: http://ytdl-org.github.io/youtube-dl/supportedsites.html
Here is my example code:
#!/usr/bin/env python3import youtube_dl as ydl
url = "https://www.youtube.com/watch?v=6qEzh3wKVJc"with ydl.YoutubeDL(
{
"forcejson": True,
"noplaylist": True,
"format": "bestaudio"
}
) as parser:
meta = parser.extract_info(
url,
download=False
)
print(meta['thumbnail'])
print(meta['title'])
print(meta['url'])
Post a Comment for "Get Meta Data And Mrl From Youtube, Soundcloud, And Other Platforms"