-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubDown
More file actions
33 lines (26 loc) · 793 Bytes
/
Copy pathsubDown
File metadata and controls
33 lines (26 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <youtube_url>"
exit 1
fi
URL="$1"
yt-dlp -v -N 64 -ci --cookies "cookies.txt" \
--user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" \
--list-subs "$URL"
echo ""
echo "Enter language code or pattern (wildcards * ? allowed):"
read -r SUB_LANG
if [ -z "$SUB_LANG" ]; then
exit 1
fi
yt-dlp -v -N 64 -ci --cookies "cookies.txt" \
--user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" \
--write-subs \
--write-auto-subs \
--skip-download \
--sub-langs "$SUB_LANG" \
--sub-format srt \
-o "%(title)s [%(id)s] - %(subtitle)s.%(ext)s" \
"$URL"
echo ""
echo "Done."