lk/networking/scraping/youtube-dl.md

33 lines
664 B
Markdown
Raw Permalink Normal View History

2022-01-16 18:20:39 +00:00
---
2022-11-06 13:28:09 +00:00
title: "Download videos"
2022-06-18 12:26:06 +00:00
tags: [ "Documentation", "Scraping" ]
2022-01-16 18:20:39 +00:00
---
2022-11-06 13:28:09 +00:00
Install `yt-dlp`.
```bash
yt-dlp --write-auto-sub *<URL>*
```
2020-01-02 00:04:35 +00:00
It will default to English, but you can specify another language with the flag --sub-lang:
```bash
youtube-dl --sub-lang sv --write-auto-sub *<URL>*
```
2020-01-02 00:04:35 +00:00
You can list all available subtitles with:
```bash
yt-dlp --list-subs *<URL>*
```
2020-01-02 00:04:35 +00:00
2022-11-06 13:28:09 +00:00
It's also possible to skip the video and only download the subtitle if you add the flag --skip-download:
2020-01-02 00:04:35 +00:00
```bash
yt-dlp --sub-lang sv --write-auto-sub --skip-download *<URL>*
```
2020-01-02 00:04:35 +00:00
2022-06-18 12:26:06 +00:00
## Alternative
Try `yt-dlp` for some additional features and workarounds.
2022-11-06 13:28:09 +00:00
It uses the same flags as yt-dlp.