Last active 1 month ago

This script downloads videos from 7 days to today from selected YouTube channels. Downloaded videos will be logged in download.txt to prevent re-downloading them.

airikr revised this gist 11 months ago. Go to revision

1 file changed, 10 insertions, 5 deletions

download-youtube-videos.sh

@@ -5,10 +5,9 @@ path="/path/to/youtube"
5 5 sudo chown -R airikr:airikr "${path}"
6 6
7 7 yt-dlp \
8 - --check-formats \
9 8 --progress \
10 9 --ignore-errors \
11 - --download-archive "${path}/downloaded.txt" \
10 + --check-formats \
12 11 --format "bv*[height<1080][ext=mp4]+ba" \
13 12 --cookies-from-browser firefox:av9irb5a.edgren \
14 13 --merge-output mkv \
@@ -16,17 +15,23 @@ yt-dlp \
16 15 --write-annotations \
17 16 --write-thumbnail \
18 17 --convert-thumbnails jpg \
19 - --add-metadata \
20 - --convert-thumbnail jpg \
21 18 --embed-thumbnail \
22 19 --embed-chapters \
23 20 --embed-info-json \
21 + --ignore-errors \
22 + --add-metadata \
23 + --parse-metadata "%(title)s:%(meta_title)s" \
24 + --parse-metadata "%(uploader)s:%(meta_artist)s" \
24 25 --restrict-filenames \
25 26 --concurrent-fragments 3 \
26 27 --sponsorblock-mark all,-preview,-filler,-interaction \
27 28 --dateafter now-7days \
28 29 --playlist-end 10 \
30 + --no-playlist \
31 + --compat-options no-youtube-unavailable-videos \
32 + --match-filter "!is_live & live_status!=is_upcoming & availability=public" \
33 + --download-archive "${path}/downloaded.txt" \
29 34 -a "${path}/channels.txt" \
30 - -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s"
35 + -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s" 2>&1 | tee "${path}/output.log"
31 36
32 37 sudo chown -R jellyfin:jellyfin "${path}"

airikr revised this gist 11 months ago. Go to revision

1 file changed, 1 insertion

download-youtube-videos.sh

@@ -1,4 +1,5 @@
1 1 #!/bin/bash
2 + # */3 * * * /bin/bash -c "download-youtube-videos.sh"
2 3 path="/path/to/youtube"
3 4
4 5 sudo chown -R airikr:airikr "${path}"

airikr revised this gist 11 months ago. Go to revision

1 file changed, 1 insertion, 1 deletion

download-youtube-videos.sh

@@ -23,7 +23,7 @@ yt-dlp \
23 23 --restrict-filenames \
24 24 --concurrent-fragments 3 \
25 25 --sponsorblock-mark all,-preview,-filler,-interaction \
26 - --dateafter 20250201 \
26 + --dateafter now-7days \
27 27 --playlist-end 10 \
28 28 -a "${path}/channels.txt" \
29 29 -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s"

airikr revised this gist 11 months ago. Go to revision

1 file changed, 31 insertions

download-youtube-videos.sh(file created)

@@ -0,0 +1,31 @@
1 + #!/bin/bash
2 + path="/path/to/youtube"
3 +
4 + sudo chown -R airikr:airikr "${path}"
5 +
6 + yt-dlp \
7 + --check-formats \
8 + --progress \
9 + --ignore-errors \
10 + --download-archive "${path}/downloaded.txt" \
11 + --format "bv*[height<1080][ext=mp4]+ba" \
12 + --cookies-from-browser firefox:av9irb5a.edgren \
13 + --merge-output mkv \
14 + --write-info-json \
15 + --write-annotations \
16 + --write-thumbnail \
17 + --convert-thumbnails jpg \
18 + --add-metadata \
19 + --convert-thumbnail jpg \
20 + --embed-thumbnail \
21 + --embed-chapters \
22 + --embed-info-json \
23 + --restrict-filenames \
24 + --concurrent-fragments 3 \
25 + --sponsorblock-mark all,-preview,-filler,-interaction \
26 + --dateafter 20250201 \
27 + --playlist-end 10 \
28 + -a "${path}/channels.txt" \
29 + -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s"
30 +
31 + sudo chown -R jellyfin:jellyfin "${path}"
Newer Older