-
Notifications
You must be signed in to change notification settings - Fork 0
/
musicvideo.ps1
34 lines (30 loc) · 1.44 KB
/
musicvideo.ps1
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
34
$Config = Get-Content -Raw "$PSScriptRoot/Config.json5" | ConvertFrom-Json
$Command = @(
'--verbose',
'--format', "bestvideo[vcodec^=avc]+bestaudio[acodec^=mp4a]/bestvideo+bestaudio/best",
'--force-ipv4',
'--sleep-requests', '1',
'--sleep-interval', '5',
'--max-sleep-interval', '6',
'--ignore-errors',
'--no-continue',
'--no-overwrites',
'--no-write-info-json' # THIS COMMA IS PURPOSFULLY MISSING!!
$Config.AlwaysUseCookiesFile ? ('--cookies', $Config.CookiesFilePath) : ('--cookies-from-browser', $Config.CookiesBrowser),
'--check-formats',
'--throttled-rate', '100K',
'--retries', 'infinite',
'--concurrent-fragments', $Config.MediaConcurrentFragments,
'--embed-chapters',
'--no-part',
'--embed-metadata',
'--parse-metadata', '%(upload_date>%Y-%m-%d)s:%(meta_date)s', # format date as yyyy-MM-dd
'--parse-metadata', ':(?P<meta_synopsis>)', # don't store description in synopsis
'--parse-metadata', ':(?P<meta_description>)', # don't store description in description
'--parse-metadata', 'description:(?s)(?P<meta_comment>.+)', # store description in comment
'--replace-in-metadata', '"meta_comment" "\n" "\r\n"', # replace \n with \r\n for display compat. with mp3tag (would otherwise render as one line)
'--sponsorblock-mark', 'all,-poi_highlight,-filler',
'--output', "$($Config.OutputBase)/musicvideo/[%(upload_date>%Y-%m-%d)s] [yt-%(id)s] %(title)s - %(uploader)s.%(ext)s" # THIS COMMA IS PURPOSFULLY MISSING!!
$args
)
yt-dlp @Command *>&1