---
# System prepended metadata

title: Python youtube-dl yt-dlp 2021-04-10
tags: [yt-dlp, Python, youtube-dl, YouTube]

---

---
lang: ja-jp
breaks: true
---
# Python youtube-dl yt-dlp 2021-04-10

https://github.com/ytdl-org/youtube-dl

https://github.com/ytdl-org/youtube-dl/blob/master/README.md#readme

```shell=
cd /d %~dp0
call C:\Users\xxxxxxxx\anaconda3\Scripts\activate.bat C:\Users\xxxxxxxx\anaconda3
set URL="https://youtu.be/xxxxxxxx"
youtube-dl %URL% --list-formats
youtube-dl --write-sub --write-auto-sub --all-subs %URL% -f "bestvideo+bestaudio/best"
```

```shell=
pip install --upgrade youtube-dl
```


## ダウンロードが遅い場合は、`yt-dlp` を試してみる

> yt-dlp/yt-dlp
> https://github.com/yt-dlp/yt-dlp

```shell=
pip install -U yt-dlp
```

```shell=
cd /d %~dp0
call C:\Users\xxxxxxxx\anaconda3\Scripts\activate.bat C:\Users\xxxxxxxx\anaconda3
set URL="https://youtu.be/xxxxxxxx"
yt-dlp %URL% --list-formats
yt-dlp --write-sub --write-auto-sub --all-subs %URL% -f "bestvideo+bestaudio/best"
```

:::info
パラメータを色々と試してみる。
```shell=
yt-dlp --write-sub --write-auto-sub --sub-langs "en.*,ja" --cookies-from-browser edge %URL% -f "bestvideo+bestaudio/best"
```
:::

```shell=
pip install --upgrade yt-dlp
```

## Youtube動画をダウンロードするバッチ

```bat=

cd /d %~dp0

call %userprofile%\anaconda3\Scripts\activate.bat %userprofile%\anaconda3

pip install --upgrade yt-dlp
pip install --upgrade youtube-dl

set URL="https://youtu.be/XXXXXXXX"
youtube-dl %URL% --list-formats
yt-dlp --write-sub --write-auto-sub --all-subs %URL% -f "bestvideo+bestaudio/best"

pause

```

###### tags: `Python` `youtube-dl` `yt-dlp` `YouTube`
