Skip to content

[Improvement] Improve subscription-daemon.py by adding a flag to youtube-dl object #14

@nguyenhung

Description

@nguyenhung

Subscription-daemon.py uses youtube_dl.extract_info to get all the videos info in a playlist. The data is redundant for downloaded videos.

https://github.com/katznboyz1/youtube-dl-server/blob/1b958d63afd82c4aa29539540b35a0d37c12ee24/subscription-daemon.py#L81

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions