download-youtube-videos.sh
· 1.0 KiB · Bash
原始文件
#!/bin/bash
path="/path/to/youtube"
sudo chown -R airikr:airikr "${path}"
yt-dlp \
--progress \
--ignore-errors \
--check-formats \
--format "bv*[height<1080][ext=mp4]+ba" \
--cookies-from-browser firefox:av9irb5a.profile \
--merge-output mkv \
--write-info-json \
--write-annotations \
--write-thumbnail \
--convert-thumbnails jpg \
--embed-thumbnail \
--embed-chapters \
--embed-info-json \
--ignore-errors \
--add-metadata \
--parse-metadata "%(title)s:%(meta_title)s" \
--parse-metadata "%(uploader)s:%(meta_artist)s" \
--restrict-filenames \
--concurrent-fragments 3 \
--sponsorblock-mark all,-preview,-filler,-interaction \
--dateafter now-7days \
--playlist-end 10 \
--no-playlist \
--compat-options no-youtube-unavailable-videos \
--match-filter "!is_live & live_status!=is_upcoming & availability=public & title!*=WAN" \
--download-archive "${path}/downloaded.txt" \
-a "${path}/channels.txt" \
-o "${path}/%(channel)s/%(upload_date>%Y-%m-%d)s - %(title)s [%(id)s].%(ext)s"
sudo chown -R jellyfin:jellyfin "${path}"
| 1 | #!/bin/bash |
| 2 | path="/path/to/youtube" |
| 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}" |