ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.77k stars 10.07k forks source link

Playlist thumbnail, Python package #28579

Open lazyuselessman opened 3 years ago

lazyuselessman commented 3 years ago

Checklist

youtube_dl version

>pip show youtube_dl

Name: youtube-dl
Version: 2021.3.25
Summary: YouTube video downloader
Home-page: https://github.com/ytdl-org/youtube-dl
Author: Ricardo Garcia
Author-email: ytdl@yt-dl.org
License: Unlicense
Location: \venv\lib\site-packages
Requires:
Required-by:

Python script

from json import dump
from youtube_dl import YoutubeDL

url = 'https://www.youtube.com/playlist?list=OLAK5uy_lR-TqR-DobKiF9DtVzELCPz7_v-bUr5fM'
info_filename = './info.json'

info =  YoutubeDL({}).extract_info(url, download=False)
with open(info_filename, 'w') as info_file:
    dump(info, info_file, indent=4)

Result info.json

{
    "_type": "playlist",
    "entries": [
        ...
    ],
    "id": "OLAK5uy_lR-TqR-DobKiF9DtVzELCPz7_v-bUr5fM",
    "title": "LAUNCH",
    "extractor": "youtube:tab",
    "webpage_url": "https://www.youtube.com/playlist?list=OLAK5uy_lR-TqR-DobKiF9DtVzELCPz7_v-bUr5fM",
    "webpage_url_basename": "playlist",
    "extractor_key": "YoutubeTab"
}

Question

Does it possible to retrieve playlist thumbnails urls with current youtube_dl python package? Does it possible to download playlist thumbnails with current youtube_dl python package?

ghost commented 3 years ago

Playlist thumbnails are not part of the extraction, it seems.