yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
81.96k stars 6.39k forks source link

`--download-archive` breaks downloading multiple unmerged formats #1470

Closed wlritchi closed 2 years ago

wlritchi commented 2 years ago

Checklist

Description

With --download-archive and multiple formats to download (without merging), only the first format is downloaded; the rest are skipped with "has already been recorded in the archive".

Verbose log

[debug] Command-line config: ['-Uv', '--no-config', '--download-archive', 'foo.txt', '-f', 'bestvideo,bestaudio', '--', 'BaW_jenozKc']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8[debug] yt-dlp version 2021.10.22
[debug] Python version 3.9.7 (CPython 64bit) - Linux-5.14.8-arch1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4, rtmpdump 2.4
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] Loading archive file 'foo.txt'
yt-dlp is up to date (2021.10.22)
[debug] [youtube] Extracting URL: BaW_jenozKc
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, id
[info] BaW_jenozKc: Downloading 2 format(s): 248, 251
[debug] Invoking downloader on "https://r3---sn-ux3n588t-mjhe.googlevideo.com/videoplayback?expire=1635497724&ei=nGJ7YZvbA4yPiwSPwqaIAw&ip=23.233.7.162&id=o-AFZxuZbG7xrcdvQtG3btbGfBRI27b9HizVC0fkqeW3Ob&itag=248&source=youtube&requiressl=yes&mh=Rf&mm=31%2C29&mn=sn-ux3n588t-mjhe%2Csn-tt1eln7e&ms=au%2Crdu&mv=m&mvi=3&pl=17&initcwndbps=1271250&vprv=1&mime=video%2Fwebm&gir=yes&clen=988479&dur=9.833&lmt=1544741703689523&mt=1635475971&fvip=3&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=5432432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgK_2J_PDnEyk96SGpwj1XHjId4KDKfre-2g0LHuvb9jYCIQCwG0954V7su5SjtigFLDKnYmliVFkSo8A75-yOImLmkQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAKCpcwZ-IG9XK9ZrgHjpoFWfCT7XhRle3i7EHnl7GIK8AiEAgvVLdWDud1io4TGWGxt3GOL-2BOzcQpsN8DLjymPNTc%3D"
[download] Destination: youtube-dl test video ''_ä↭𝕐 [BaW_jenozKc].webm
[download] 100% of 965.31KiB in 00:00
[download] youtube-dl test video "'/\ä↭𝕐 has already been recorded in the archive
Lesmiscore commented 2 years ago

for reference, this behavior is same as youtube-dl

$ ./ytdl-original --verbose --download-archive archive.txt -f bestvideo,bestaudio -- BaW_jenozKc
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--download-archive', 'archive.txt', '-f', 'bestvideo,bestaudio', '--', 'BaW_jenozKc']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.9.5 (CPython) - Linux-5.11.0-34-generic-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.3.2-0, ffprobe 4.3.2-0
[debug] Proxy map: {}
[youtube] BaW_jenozKc: Downloading webpage
[info] BaW_jenozKc: downloading video in 2 formats
[debug] Invoking downloader on 'https://r3---sn-oguelnsz.googlevideo.com/videoplayback?expire=1635527488&ei=39Z7YZzLObXt2roPqoC9uAk&ip=2401%3Ac080%3A1000%3A4d16%3A5400%3A3ff%3Afe8b%3Ad04e&id=o-ADBxRgonQvZjNrQKm_uO0r4uSwlZIVGZNE9Lg7YnfU-a&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&source=youtube&requiressl=yes&mh=Rf&mm=31%2C29&mn=sn-oguelnsz%2Csn-oguesnze&ms=au%2Crdu&mv=m&mvi=3&pl=48&initcwndbps=687500&vprv=1&mime=video%2Fmp4&ns=keV6kqsdiAGQjhG6gkTQBTUG&gir=yes&clen=2208750&dur=9.800&lmt=1387961822987808&mt=1635505495&fvip=3&keepalive=yes&fexp=24001373%2C24007246&c=WEB&n=0GXD-FcUcFHIF1Uw&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgTz8cUVid6JI60JtGHPc1Lb4B04Rq-pI3gmvcfZc6AdECIQDB4wiApc7tYGa9sQ72sHy4oIFQtZnGxKI7a0vopXVSnw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAO57W56AiqMDAQDiLezn3_2AkZnZldM0jUvnKuWFAiFiAiEAlDMxoKyesLwgL8xj7QW5Nqkqnwja2PIuaUp9kXfzrlg%3D'
[download] Destination: youtube-dl test video ''_ä↭𝕐-BaW_jenozKc.mp4
[download] 100% of 2.11MiB in 00:29
[download] youtube-dl test video "'/\ä↭𝕐 has already been recorded in archive

but, I'm against making this behavior "same as youtube-dl, so it's intended". it is counter-intuitive to me too.

pukkandan commented 2 years ago

Agreed. I will have to go through the youtube-dl issue tracker and git history to make sure this wasn't specifically intended to be this way. But assuming there is no good reason for this, I agree this should be changed

pukkandan commented 2 years ago

Related: https://github.com/ytdl-org/youtube-dl/issues/17031 https://github.com/ytdl-org/youtube-dl/issues/15781 https://github.com/ytdl-org/youtube-dl/pull/7480 https://github.com/ytdl-org/youtube-dl/pull/7467 https://github.com/ytdl-org/youtube-dl/issues/7022