Created
November 24, 2023 07:52
-
-
Save johnroyer/db9b42a1d453359cd4125f07e5b13bc9 to your computer and use it in GitHub Desktop.
script for download youtube video via yt-dlp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Usage: | |
| # dl.sh "https://www.youtube.com/watch?v=ec-IgIkEkmA" | |
| # | |
| # 限制檔案名稱長度,主要是為了避開 FAT、NTFS 的限制 | |
| /path/to/yt-dlp/yt-dlp.sh \ | |
| -o '%(title).150s-%(id)s.%(ext)s' \ | |
| -f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" \ | |
| --write-subs --sub-langs "zh-TW" --sub-format "srt/vtt" \ | |
| -q \ | |
| "$@" > /dev/null 2>&1 & |
l1n6yun
commented
Apr 9, 2025

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment