[Improvement] Improve subscription-daemon.py by adding a flag to youtube-dl object
nguyenhung opened this issue · 0 comments
nguyenhung commented
Subscription-daemon.py uses youtube_dl.extract_info
to get all the videos info in a playlist. The data is redundant for downloaded videos.
We can improve the process by adding 'extract_flat': True
flag to the youtube-dl options
https://github.com/l1ving/youtube-dl/blob/ab6ade71e5ef7060db209dd89a139f655fcfa328/youtube_dl/YoutubeDL.py#L226
import youtube_dl
ydl_opts = {
'default_search':'youtube',
'extract_flat': True,
}
youtubeDLObject = youtube_dl.YoutubeDL(ydl_opts)
playlistOrChannelData = youtubeDLObject.extract_info('https://www.youtube.com/playlist?list=PLOJU8YJjFwGOeOx32q45CjrAq4hAOpxBk', download=False)
print(playlistOrChannelData)