{"categories":["Python"],"version":"1.0","description":"yt-dlp \u3092\u4f7f\u3048\u3070\u53ef\u80fd\u3060\u3063\u305f\u3002 import sys from yt_dlp import YoutubeDL def download_video(video_url): ydl_opts = { \"format\": \"best\", } with YoutubeDL(ydl_opts) as ydl: ydl.download([video_url]) def download_audio(video_url): ydl_opts = { \"format\": \"m4a/bestaudio/best\", \"postprocessors\": [{ \"key\": \"FFmpegExtractA\u2026","width":"100%","url":"https://tnakamura.hatenablog.com/entry/2023/04/17/yt-dlp","provider_url":"https://hatena.blog","blog_title":"present","author_url":"https://blog.hatena.ne.jp/griefworker/","author_name":"griefworker","published":"2023-04-17 18:00:00","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftnakamura.hatenablog.com%2Fentry%2F2023%2F04%2F17%2Fyt-dlp\" title=\"Python \u3067 YouTube \u304b\u3089\u52d5\u753b\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b - present\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://tnakamura.hatenablog.com/","provider_name":"Hatena Blog","height":"190","image_url":null,"title":"Python \u3067 YouTube \u304b\u3089\u52d5\u753b\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b"}