AimerNeige hat die Gist bearbeitet 1 year ago. Zu Änderung gehen
1 file changed, 1 insertion
bilibili-download.sh
| @@ -9,6 +9,7 @@ user_urls=( | |||
| 9 | 9 | "https://space.bilibili.com/6768352/video" # 粥粥的奇妙冒险 | |
| 10 | 10 | "https://space.bilibili.com/11742550/video" # 哈米伦的弄笛者 | |
| 11 | 11 | "https://space.bilibili.com/4128618/video" # 大大大灯泡 | |
| 12 | + | "https://space.bilibili.com/7086255/channel/collectiondetail?sid=611502" # 超想吃番茄 - 原神二创 | |
| 12 | 13 | # more videos link here | |
| 13 | 14 | ) | |
| 14 | 15 | cookies_path=./cookies.txt # export with https://addons.mozilla.org/en-US/firefox/addon/get-cookies-txt-locally/ | |
AimerNeige hat die Gist bearbeitet 1 year ago. Zu Änderung gehen
1 file changed, 44 insertions
bilibili-download.sh(Datei erstellt)
| @@ -0,0 +1,44 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | ||
| 3 | + | user_urls=( | |
| 4 | + | "https://space.bilibili.com/8776737/video" # 阿江君 | |
| 5 | + | "https://space.bilibili.com/20247643/video" # 拉环儿_ | |
| 6 | + | "https://space.bilibili.com/23945810/video" # 爱抽卡的白熊 | |
| 7 | + | "https://space.bilibili.com/287551041/video" # 一万根韭菜 | |
| 8 | + | "https://space.bilibili.com/15232589/video" # 白木哒哒哒 | |
| 9 | + | "https://space.bilibili.com/6768352/video" # 粥粥的奇妙冒险 | |
| 10 | + | "https://space.bilibili.com/11742550/video" # 哈米伦的弄笛者 | |
| 11 | + | "https://space.bilibili.com/4128618/video" # 大大大灯泡 | |
| 12 | + | # more videos link here | |
| 13 | + | ) | |
| 14 | + | cookies_path=./cookies.txt # export with https://addons.mozilla.org/en-US/firefox/addon/get-cookies-txt-locally/ | |
| 15 | + | outdir_root=/volumes/jellyfin/media/Bilibili | |
| 16 | + | outpath="$outdir_root/%(uploader)s/%(title)s.%(ext)s" | |
| 17 | + | video_format="bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" | |
| 18 | + | # video_format="bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" # if you want 4k or higher | |
| 19 | + | ||
| 20 | + | for url in "${user_urls[@]}"; do | |
| 21 | + | user_id=$(echo "$url" | grep -oP '(?<=bilibili.com/)[^/]+') # Extract the user ID from the URL | |
| 22 | + | archive="$outdir_root/archives/$user_id.txt" | |
| 23 | + | echo "Starting download $url" | |
| 24 | + | date | |
| 25 | + | yt-dlp \ | |
| 26 | + | -f $video_format \ | |
| 27 | + | --download-archive $archive \ | |
| 28 | + | --cookies $cookies_path \ | |
| 29 | + | --write-description \ | |
| 30 | + | --write-info-json \ | |
| 31 | + | --write-annotations \ | |
| 32 | + | --write-thumbnail \ | |
| 33 | + | --write-sub \ | |
| 34 | + | --all-subs \ | |
| 35 | + | --ignore-errors \ | |
| 36 | + | --merge-output-format mp4 \ | |
| 37 | + | --add-metadata \ | |
| 38 | + | --embed-subs \ | |
| 39 | + | --embed-thumbnail \ | |
| 40 | + | --sleep-interval 50 \ | |
| 41 | + | --max-sleep-interval 100 \ | |
| 42 | + | -o $outpath $url | |
| 43 | + | sleep 600 | |
| 44 | + | done | |