Last active 1741649047

airikr revised this gist 1741649047. Go to revision

1 file changed, 46 insertions, 33 deletions

download-youtube-videos.sh

@@ -1,36 +1,49 @@
1 1 #!/bin/bash
2 2 path="/path/to/youtube"
3 3
4 - sudo chown -R airikr:airikr "${path}"
5 -
6 - yt-dlp \
7 - --progress \
8 - --ignore-errors \
9 - --check-formats \
10 - --format "bv*[height<1080][ext=mp4]+ba" \
11 - --cookies-from-browser firefox:av9irb5a.profile \
12 - --merge-output mkv \
13 - --write-info-json \
14 - --write-annotations \
15 - --write-thumbnail \
16 - --convert-thumbnails jpg \
17 - --embed-thumbnail \
18 - --embed-chapters \
19 - --embed-info-json \
20 - --ignore-errors \
21 - --add-metadata \
22 - --parse-metadata "%(title)s:%(meta_title)s" \
23 - --parse-metadata "%(uploader)s:%(meta_artist)s" \
24 - --restrict-filenames \
25 - --concurrent-fragments 3 \
26 - --sponsorblock-mark all,-preview,-filler,-interaction \
27 - --dateafter now-7days \
28 - --playlist-end 10 \
29 - --no-playlist \
30 - --compat-options no-youtube-unavailable-videos \
31 - --match-filter "!is_live & live_status!=is_upcoming & availability=public & title!*=WAN" \
32 - --download-archive "${path}/downloaded.txt" \
33 - -a "${path}/channels.txt" \
34 - -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s"
35 -
36 - sudo chown -R jellyfin:jellyfin "${path}"
4 + sudo chown -R user:user "${path}"
5 +
6 + yt-dlp --config-location "ytdlp-config.txt" -a "${path}/channels-1.txt"
7 +
8 + echo
9 + echo "Deleting JSON files"
10 + echo
11 + for file in "${path}"/*/*.json; do
12 + if [ -f "$file" ]; then
13 + sudo rm "$file"
14 + fi
15 + done
16 +
17 + echo "Done"
18 + echo
19 +
20 + sudo chown -R jellyfin:jellyfin "${path}"
21 +
22 +
23 +
24 + # ytdlp-config.txt
25 + --progress
26 + --ignore-errors
27 + --check-formats
28 + --format "bestvideo[height<=1080][ext=mkv]+bestaudio[ext=m4a]/best[ext=mkv]/best"
29 + --merge-output mkv
30 + --write-info-json
31 + --write-annotations
32 + --write-thumbnail
33 + --convert-thumbnails jpg
34 + --embed-thumbnail
35 + --embed-chapters
36 + --embed-info-json
37 + --ignore-errors
38 + --add-metadata
39 + --restrict-filenames
40 + --concurrent-fragments 3
41 + --sponsorblock-mark all,-preview,-filler,-interaction
42 + --dateafter now-7days
43 + --playlist-end 10
44 + --no-playlist
45 + --cookies-from-browser firefox:vzh1hdbr.default-release
46 + --compat-options no-youtube-unavailable-videos
47 + --match-filter "!is_live & live_status!=is_upcoming & availability=public & title!*=WAN"
48 + --download-archive "/path/to/youtube/downloaded.txt"
49 + -o "/path/to/youtube/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s"

airikr revised this gist 1739749075. Go to revision

1 file changed, 3 insertions, 4 deletions

download-youtube-videos.sh

@@ -1,5 +1,4 @@
1 1 #!/bin/bash
2 - # */3 * * * /bin/bash -c "download-youtube-videos.sh"
3 2 path="/path/to/youtube"
4 3
5 4 sudo chown -R airikr:airikr "${path}"
@@ -9,7 +8,7 @@ yt-dlp \
9 8 --ignore-errors \
10 9 --check-formats \
11 10 --format "bv*[height<1080][ext=mp4]+ba" \
12 - --cookies-from-browser firefox:av9irb5a.edgren \
11 + --cookies-from-browser firefox:av9irb5a.profile \
13 12 --merge-output mkv \
14 13 --write-info-json \
15 14 --write-annotations \
@@ -29,9 +28,9 @@ yt-dlp \
29 28 --playlist-end 10 \
30 29 --no-playlist \
31 30 --compat-options no-youtube-unavailable-videos \
32 - --match-filter "!is_live & live_status!=is_upcoming & availability=public" \
31 + --match-filter "!is_live & live_status!=is_upcoming & availability=public & title!*=WAN" \
33 32 --download-archive "${path}/downloaded.txt" \
34 33 -a "${path}/channels.txt" \
35 - -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s" 2>&1 | tee "${path}/output.log"
34 + -o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s"
36 35
37 36 sudo chown -R jellyfin:jellyfin "${path}"

airikr revised this gist 1739057688. 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 1738941892. 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 1738880742. 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 1738877492. 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