aboutsummaryrefslogtreecommitdiff
path: root/_posts/notes/2023-05-13-download-youtube-videos.md
blob: 9ed8221633a177d1f3f9e3c8dade5c5e8da67d67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
title: Download list of YouTube files
permalink: /download-youtube-videos.html
date: 2023-05-13T12:00:00+02:00
layout: post
type: note
draft: false
tags: [youtube]
---

If you need to download a list of YouTube videos and don't want to download the
actual YouTube list (which `yt-dlp` supports), you can use the following method.

```js
// Used to get list of raw URL's from YouTube's video tab'.
// Copy them into videos.txt.
document.querySelectorAll('#contents a.ytd-thumbnail.style-scope.ytd-thumbnail').forEach(el => console.log(el.href))
```

Download and install https://github.com/yt-dlp/yt-dlp.

```sh
# This will download all videos in videos.txt.
yt-dlp --batch-file videos.txt -N `nproc` -f webm
```