Thursday 5 September 2019

How to query a playlist properly and safely

I want to extract the information from a YouTube playlist but querying the whole playlist at once seems to be quite unreliable even if I use the ignoreerrors flag, because sometimes it gets stuck, especially if the internet connection is a bit shaky. Should I just download the playlist one by one by setting the playliststart and playlistend values and processing it in a loop?

My current code looks like this:

simulate_ydl_opts = {
    'format': "251",
    'playlistend': 50,
    'ignoreerrors': True,
    'simulate':True
}
youtube_dl_object = youtube_dl.YoutubeDL(simulate_ydl_opts)
test_info=youtube_dl_object.extract_info("https://www.youtube.com/user/Rasenfunk")



from How to query a playlist properly and safely

No comments:

Post a Comment