Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to merge formats with error: No such file or directory #6536

Closed
9 of 10 tasks
JChris246 opened this issue Mar 14, 2023 · 12 comments
Closed
9 of 10 tasks

Failed to merge formats with error: No such file or directory #6536

JChris246 opened this issue Mar 14, 2023 · 12 comments
Assignees
Labels
bug Bug that is not site-specific regression Works in youtube-dl/older yt-dlp

Comments

@JChris246
Copy link
Contributor

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2023.03.04 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Provide a description that is worded well enough to be understood

Example url: https://www.youtube.com/watch?v=nqccaxxsTGM

Trying to download a video from youtube in 2 resolutions 1920x1080 and 1280x720, with the command: yt-dlp -f 299+140,298+140 -o '%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s' nqccaxxsTGM but when it is time to merge the audio and video for the second video, the merge fails No such file or directory error. The files in the folder after running the command:

  • "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4"
  • "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"
  • "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a"

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-v', '-f', '299+140,298+140', '-o', '%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s', 'nqccaxxsTGM']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (zip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.15.0-56-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Optional libraries: Cryptodome-3.15.0, certifi-2019.11.28, secretstorage-2.3.1, sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[youtube] Extracting URL: nqccaxxsTGM
[youtube] nqccaxxsTGM: Downloading webpage
[youtube] nqccaxxsTGM: Downloading android player API JSON
[debug] Loading youtube-nsig.21246a91 from cache
[debug] [youtube] Decrypted nsig v7XG9xYaNZ0xsYHE3 => -4J-XxaVzn_W5g
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] nqccaxxsTGM: Downloading 2 format(s): 299+140, 298+140
[debug] Invoking dashsegments downloader on "https://rr1---sn-4avf-cbps.googlevideo.com/videoplayback?expire=1678774086&ei=5roPZNvGEYKykAPauLiwAQ&ip=206.231.127.80&id=o-AJWEV4PyfPLSho8IN9pTaBWcfbwPrZbte3Z8C95ncAH0&itag=299&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-4avf-cbps%2Csn-hp57ynse&ms=au%2Crdu&mv=m&mvi=1&pl=23&initcwndbps=1243750&spc=H3gIhlzCOJcTU5hSydNM0vyVM7qsKcY&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=295809166&dur=1306.938&lmt=1677101340839861&mt=1678752324&fvip=2&keepalive=yes&fexp=24007246&c=ANDROID&txp=5535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAKP2vdrbslxgWs0x6P9-Ldr0VIlbimMdf0YCBGuQ6i3HAiEAhZ5SFIqhyZD0jqSvEdcWaYFVvz-5t3HOWdUWDqWRQKs%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO8MJaKL1QVJhf846WzalfwuSKrzT-dFqZ_AIcFZZ5keAiAigwTLu8jm751PHWbkKqHaJo6fmZu2s3L-aUy4VgkX6Q%3D%3D"
[dashsegments] Total fragments: 29
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4
[download] 100% of  282.11MiB in 00:00:49 at 5.71MiB/s
[debug] Invoking dashsegments downloader on "https://rr1---sn-4avf-cbps.googlevideo.com/videoplayback?expire=1678774086&ei=5roPZNvGEYKykAPauLiwAQ&ip=206.231.127.80&id=o-AJWEV4PyfPLSho8IN9pTaBWcfbwPrZbte3Z8C95ncAH0&itag=140&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-4avf-cbps%2Csn-hp57ynse&ms=au%2Crdu&mv=m&mvi=1&pl=23&initcwndbps=1243750&spc=H3gIhlzCOJcTU5hSydNM0vyVM7qsKcY&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=21153088&dur=1307.004&lmt=1677051121100746&mt=1678752324&fvip=2&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAM9bPZytXf-MkeG4770STqLfRwryD-fe3pnndkDyxAeEAiArzkMjtp2nP3-VirHzoA9JCKQRuOGcdLt5l5nxF0N3gg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO8MJaKL1QVJhf846WzalfwuSKrzT-dFqZ_AIcFZZ5keAiAigwTLu8jm751PHWbkKqHaJo6fmZu2s3L-aUy4VgkX6Q%3D%3D"
[dashsegments] Total fragments: 3
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:02 at 8.84MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4' -i 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.temp.mp4'
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a (pass -k to keep)
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4 (pass -k to keep)
[debug] Invoking dashsegments downloader on "https://rr1---sn-4avf-cbps.googlevideo.com/videoplayback?expire=1678774086&ei=5roPZNvGEYKykAPauLiwAQ&ip=206.231.127.80&id=o-AJWEV4PyfPLSho8IN9pTaBWcfbwPrZbte3Z8C95ncAH0&itag=298&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-4avf-cbps%2Csn-hp57ynse&ms=au%2Crdu&mv=m&mvi=1&pl=23&initcwndbps=1243750&spc=H3gIhlzCOJcTU5hSydNM0vyVM7qsKcY&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=74344129&dur=1306.938&lmt=1677101110217570&mt=1678752324&fvip=2&keepalive=yes&fexp=24007246&c=ANDROID&txp=5535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAIbp_htcXYQ2algKO_Up9EyC2Fj3O31VxiZYQ1Td8PfTAiEA8nqQgo8_HpBKM7rSuj28iYiEskNKh5ldrtRVLnDInFQ%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO8MJaKL1QVJhf846WzalfwuSKrzT-dFqZ_AIcFZZ5keAiAigwTLu8jm751PHWbkKqHaJo6fmZu2s3L-aUy4VgkX6Q%3D%3D"
[dashsegments] Total fragments: 8
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4
[download] 100% of   70.90MiB in 00:00:12 at 5.84MiB/s
[debug] Invoking dashsegments downloader on "https://rr1---sn-4avf-cbps.googlevideo.com/videoplayback?expire=1678774086&ei=5roPZNvGEYKykAPauLiwAQ&ip=206.231.127.80&id=o-AJWEV4PyfPLSho8IN9pTaBWcfbwPrZbte3Z8C95ncAH0&itag=140&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-4avf-cbps%2Csn-hp57ynse&ms=au%2Crdu&mv=m&mvi=1&pl=23&initcwndbps=1243750&spc=H3gIhlzCOJcTU5hSydNM0vyVM7qsKcY&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=21153088&dur=1307.004&lmt=1677051121100746&mt=1678752324&fvip=2&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAM9bPZytXf-MkeG4770STqLfRwryD-fe3pnndkDyxAeEAiArzkMjtp2nP3-VirHzoA9JCKQRuOGcdLt5l5nxF0N3gg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAO8MJaKL1QVJhf846WzalfwuSKrzT-dFqZ_AIcFZZ5keAiAigwTLu8jm751PHWbkKqHaJo6fmZu2s3L-aUy4VgkX6Q%3D%3D"
[dashsegments] Total fragments: 3
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:02 at 9.32MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.mp4"
ERROR: [Errno 2] No such file or directory: "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a"
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 1518, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 1615, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 1674, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 2779, in process_video_result
    self.process_info(new_info)
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 3323, in process_info
    replace_info_dict(self.post_process(dl_filename, info_dict, files_to_move))
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 3502, in post_process
    info = self.run_all_pps('post_process', info, additional_pps=info.get('__postprocessors'))
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 3484, in run_all_pps
    info = self.run_pp(pp, info)
  File "/usr/local/bin/youtube-dl/yt_dlp/YoutubeDL.py", line 3462, in run_pp
    files_to_delete, infodict = pp.run(infodict)
  File "/usr/local/bin/youtube-dl/yt_dlp/postprocessor/common.py", line 24, in run
    ret = func(self, info, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/yt_dlp/postprocessor/common.py", line 129, in wrapper
    return func(self, info)
  File "/usr/local/bin/youtube-dl/yt_dlp/postprocessor/ffmpeg.py", line 831, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/bin/youtube-dl/yt_dlp/postprocessor/ffmpeg.py", line 324, in run_ffmpeg_multiple_files
    return self.real_run_ffmpeg(
  File "/usr/local/bin/youtube-dl/yt_dlp/postprocessor/ffmpeg.py", line 331, in real_run_ffmpeg
    oldest_mtime = min(
  File "/usr/local/bin/youtube-dl/yt_dlp/postprocessor/ffmpeg.py", line 332, in <genexpr>
    os.stat(encodeFilename(path)).st_mtime for path, _ in input_path_opts if path)
FileNotFoundError: [Errno 2] No such file or directory: "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a"
@JChris246 JChris246 added bug Bug that is not site-specific triage Untriaged issue labels Mar 14, 2023
@gamer191
Copy link
Collaborator

I haven't attempted to reproduce the issue, but it appears the issue is that the audio formats saves as (red line), and then yt-dlp looks for (green line)

-ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
+ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a

Technically it's behaving entirely as intended-both formats are saved using the output template, and thus can't be merged, since they have a different template. I'm not sure how this will be fixed, because prioritising the video's filename, or the audio's filename, could both have unintended effects

@JChris246
Copy link
Contributor Author

Note this used to work fine before😅 (probably up to version [2023.02.17])

@Lesmiscore
Copy link
Contributor

2023.02.17:

$ ../yt-dlp.2023.02.17 -f 299+140,298+140 -o '%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s' nqccaxxsTGM
[youtube] Extracting URL: nqccaxxsTGM
[youtube] nqccaxxsTGM: Downloading webpage
[youtube] nqccaxxsTGM: Downloading android player API JSON
[youtube] nqccaxxsTGM: Downloading player 21246a91
[info] nqccaxxsTGM: Downloading 2 format(s): 299+140, 298+140
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4
[download] 100% of  282.11MiB in 00:00:12 at 22.59MiB/s
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:00 at 22.67MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4 (pass -k to keep)
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a (pass -k to keep)
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4
[download] 100% of   70.90MiB in 00:00:03 at 23.22MiB/s
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:00 at 22.40MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.mp4"
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4 (pass -k to keep)
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a (pass -k to keep)

2023.03.04:

$ yt-dlp -f 299+140,298+140 -o '%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s' nqccaxxsTGM
[youtube] Extracting URL: nqccaxxsTGM
[youtube] nqccaxxsTGM: Downloading webpage
[youtube] nqccaxxsTGM: Downloading android player API JSON
[info] nqccaxxsTGM: Downloading 2 format(s): 299+140, 298+140
[dashsegments] Total fragments: 29
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4
[download] 100% of  282.11MiB in 00:00:13 at 20.86MiB/s
[dashsegments] Total fragments: 3
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:00 at 22.86MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a (pass -k to keep)
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4 (pass -k to keep)
[dashsegments] Total fragments: 8
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4
[download] 100% of   70.90MiB in 00:00:04 at 15.33MiB/s
[dashsegments] Total fragments: 3
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:00 at 23.48MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.mp4"
ERROR: [Errno 2] No such file or directory: "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a"
$ ls
"ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4"   "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"
"ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a"

Right, it used to work

@Lesmiscore Lesmiscore added triage Untriaged issue regression Works in youtube-dl/older yt-dlp and removed triage Untriaged issue labels Mar 14, 2023
@bashonly
Copy link
Member

bashonly commented Mar 14, 2023

Not sure exactly why yet but this is related to the constructed dash formats

if you --update-to nightly and download the https protocol formats it works:

yt-dlp --extractor-args "youtube:include_duplicate_formats" -f "299-0+140-0,298-0+140-0" -o "%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s" nqccaxxsTGM

EDIT: I can reproduce the issue with DASH formats from other sites. Maybe an old bug that was just brought to light by the dashy youtube formats?

HLS formats do not seem to be affected

@Lesmiscore Lesmiscore removed the regression Works in youtube-dl/older yt-dlp label Mar 14, 2023
@gamer191
Copy link
Collaborator

gamer191 commented Mar 14, 2023

what happens if you run --print resolution -f 298-0+140-0,298-0-dashy+140-0-dashy (I have no clue if this is accurate syntax)? Also --print resolution -f 298-0,140-0,298-0-dashy,140-0-dashy?

@JChris246
Copy link
Contributor Author

yt-dlp --print resolution -f 298-0+140-0,298-0-dashy+140-0-dashy nqccaxxsTGM
ERROR: [youtube] nqccaxxsTGM: Requested format is not available. Use --list-formats for a list of available formats

yt-dlp --print resolution -f 298-0,140-0,298-0-dashy,140-0-dashy nqccaxxsTGM
ERROR: [youtube] nqccaxxsTGM: Requested format is not available. Use --list-formats for a list of available formats

yt-dlp --print resolution -f 298,140 nqccaxxsTGM
1280x720
audio only

@bashonly
Copy link
Member

bashonly commented Mar 14, 2023

This seems to fix the issue for me

diff --git a/yt_dlp/downloader/dash.py b/yt_dlp/downloader/dash.py
index 4328d739c..1dca1991f 100644
--- a/yt_dlp/downloader/dash.py
+++ b/yt_dlp/downloader/dash.py
@@ -30,7 +30,7 @@ def real_download(self, filename, info_dict):
             except TypeError:
                 fragment_count = None
             ctx = {
-                'filename': fmt.get('filepath') or filename,
+                'filename': filename,
                 'live': 'is_from_start' if fmt.get('is_from_start') else fmt.get('is_live'),
                 'total_frags': fragment_count,
             }

It looks like fmt.get('filepath') or was added in this commit:
adbc4ec#diff-be726c7557b840218a1b9ebd2bc0f9510a1832bb68ea87a8863530c3cbc8b302

@pukkandan pukkandan self-assigned this Mar 14, 2023
@pukkandan
Copy link
Member

The above patch will break --live-from-start since the two requested_formats will be downloaded to the same filename.

The actual issue is that when the first 298+140 is downloaded, the infodict for 140 is being mutated with filepath. Then the downloader for 299+140 takes that filepath. A proper fix would be either to prevent the mutation, or pop the filepath after download.

@pukkandan pukkandan added the regression Works in youtube-dl/older yt-dlp label Mar 14, 2023
@harakiwi

This comment was marked as off-topic.

@pukkandan

This comment was marked as off-topic.

@Lesmiscore
Copy link
Contributor

Lesmiscore commented Apr 26, 2023

$ ./yt-dlp.sh -v -f 299+140,298+140 -o '%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s' nqccaxxsTGM
[debug] Command-line config: ['-v', '-f', '299+140,298+140', '-o', '%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s', 'nqccaxxsTGM']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: 62beefa81
[debug] Python 3.10.7 (CPython x86_64 64bit) - Linux-5.19.0-38-generic-x86_64-with-glibc2.36 (OpenSSL 3.0.5 5 Jul 2022, glibc 2.36)
[debug] exe versions: ffmpeg 5.1.1 (setts), ffprobe 5.1.1, rtmpdump 2.4
[debug] Optional libraries: mutagen-1.45.1, pycrypto-3.10.1, sqlite3-2.6.0, websockets-10.1
[debug] Proxy map: {}
[debug] Loaded 1805 extractors
[youtube] Extracting URL: nqccaxxsTGM
[youtube] nqccaxxsTGM: Downloading webpage
[youtube] nqccaxxsTGM: Downloading android player API JSON
[youtube] nqccaxxsTGM: Downloading player d87d581f
[debug] Saving youtube-nsig.d87d581f to cache
[debug] [youtube] Decrypted nsig OTiF-m50c8OcJdG9r => vimjbcEvzqwbnA
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] nqccaxxsTGM: Downloading 2 format(s): 299+140, 298+140
[debug] Invoking http downloader on "https://rr4---sn-oguesnds.googlevideo.com/videoplayback?expire=1682505072&ei=EKlIZLOBH9eL2_gPtNy5mA4&ip=111.98.62.182&id=o-AGVTAhFTpjw3LeVvvLo4y5AMtfKsgJ9NUpoodIoULkpV&itag=299&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-oguesnds%2Csn-oguelnze&ms=au%2Crdu&mv=m&mvi=4&pl=23&initcwndbps=1320000&spc=qEK7B-y2iNpunsvSJTuWU_qX4ILZ1R4&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=295809166&dur=1306.938&lmt=1677101340839861&mt=1682483097&fvip=3&keepalive=yes&fexp=24007246&c=ANDROID&txp=5535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhANbBcso3GDM3erl8UTWmJnLcodDod-skdeiRXlSh9NgxAiEAhvq-FOq1iMf22zHQIroERrBCFrbR14IQpJt-cFv5Vnk%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIge7iAUV5o1ELPhPRE4BKB6t5AcONiTVprqP_klcSNc9ECIQCcT7SUO9XGT_XRbf3NYcPviOpuoGiHQ4-MgNqq1Ogr1Q%3D%3D"
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4
[download] 100% of  282.11MiB in 00:01:35 at 2.95MiB/s
[debug] Invoking http downloader on "https://rr4---sn-oguesnds.googlevideo.com/videoplayback?expire=1682505072&ei=EKlIZLOBH9eL2_gPtNy5mA4&ip=111.98.62.182&id=o-AGVTAhFTpjw3LeVvvLo4y5AMtfKsgJ9NUpoodIoULkpV&itag=140&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-oguesnds%2Csn-oguelnze&ms=au%2Crdu&mv=m&mvi=4&pl=23&initcwndbps=1320000&spc=qEK7B-y2iNpunsvSJTuWU_qX4ILZ1R4&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=21153088&dur=1307.004&lmt=1677051121100746&mt=1682483097&fvip=3&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRAIgVUBIkwYcrRdWA40BuUsdMIDVfXXnN8yYCw2rZgKkCD8CIAwfCYlJbu3TreFFkgJtY7F39-cLcLAufgWqgaS02dzM&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIge7iAUV5o1ELPhPRE4BKB6t5AcONiTVprqP_klcSNc9ECIQCcT7SUO9XGT_XRbf3NYcPviOpuoGiHQ4-MgNqq1Ogr1Q%3D%3D"
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:07 at 2.87MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4' -i 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.temp.mp4'
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f140.m4a (pass -k to keep)
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.f299.mp4 (pass -k to keep)
[debug] Invoking http downloader on "https://rr4---sn-oguesnds.googlevideo.com/videoplayback?expire=1682505072&ei=EKlIZLOBH9eL2_gPtNy5mA4&ip=111.98.62.182&id=o-AGVTAhFTpjw3LeVvvLo4y5AMtfKsgJ9NUpoodIoULkpV&itag=298&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-oguesnds%2Csn-oguelnze&ms=au%2Crdu&mv=m&mvi=4&pl=23&initcwndbps=1320000&spc=qEK7B-y2iNpunsvSJTuWU_qX4ILZ1R4&vprv=1&svpuc=1&mime=video%2Fmp4&gir=yes&clen=74344129&dur=1306.938&lmt=1677101110217570&mt=1682483097&fvip=3&keepalive=yes&fexp=24007246&c=ANDROID&txp=5535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRAIgB0NZFlLC_VMOmO7tM24b6Nb_TxjAYo4m8e_vPPCb0n4CIHO9Km8nI7LYSlkYxPC3UAd-1X6qsasSG4_d5cz5a4I9&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIge7iAUV5o1ELPhPRE4BKB6t5AcONiTVprqP_klcSNc9ECIQCcT7SUO9XGT_XRbf3NYcPviOpuoGiHQ4-MgNqq1Ogr1Q%3D%3D"
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4
[download] 100% of   70.90MiB in 00:00:26 at 2.70MiB/s
[debug] Invoking http downloader on "https://rr4---sn-oguesnds.googlevideo.com/videoplayback?expire=1682505072&ei=EKlIZLOBH9eL2_gPtNy5mA4&ip=111.98.62.182&id=o-AGVTAhFTpjw3LeVvvLo4y5AMtfKsgJ9NUpoodIoULkpV&itag=140&source=youtube&requiressl=yes&mh=dP&mm=31%2C29&mn=sn-oguesnds%2Csn-oguelnze&ms=au%2Crdu&mv=m&mvi=4&pl=23&initcwndbps=1320000&spc=qEK7B-y2iNpunsvSJTuWU_qX4ILZ1R4&vprv=1&svpuc=1&mime=audio%2Fmp4&gir=yes&clen=21153088&dur=1307.004&lmt=1677051121100746&mt=1682483097&fvip=3&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRAIgVUBIkwYcrRdWA40BuUsdMIDVfXXnN8yYCw2rZgKkCD8CIAwfCYlJbu3TreFFkgJtY7F39-cLcLAufgWqgaS02dzM&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIge7iAUV5o1ELPhPRE4BKB6t5AcONiTVprqP_klcSNc9ECIQCcT7SUO9XGT_XRbf3NYcPviOpuoGiHQ4-MgNqq1Ogr1Q%3D%3D"
[download] Destination: ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a
[download] 100% of   20.17MiB in 00:00:08 at 2.41MiB/s
[Merger] Merging formats into "ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4' -i 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:ASMR You'"'"'ll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.temp.mp4'
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f298.mp4 (pass -k to keep)
Deleting original file ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.f140.m4a (pass -k to keep)
$ ls
"ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1280x720_60.mp4"
"ASMR You'll doze off in 5 minutes 😴-nqccaxxsTGM-1920x1080_60.mp4"

Closing as this is somehow fixed in master. Update to latest nightly to get this fixed.

@bashonly
Copy link
Member

bashonly commented Apr 26, 2023

the bug hasn't been fixed, it just no longer presents itself with Youtube since the default behavior was reverted from dashy to https

to reproduce now with nightly/master:
yt-dlp -v --extractor-args "youtube:include_duplicate_formats" -f 299-dashy-0+140-dashy-0,298-dashy-0+140-dashy-0 -o "%(title)s-%(id)s-%(resolution)s_%(fps)s.%(ext)s" nqccaxxsTGM

@bashonly bashonly reopened this Apr 26, 2023
@pukkandan pukkandan added regression Works in youtube-dl/older yt-dlp and removed regression Works in youtube-dl/older yt-dlp labels Apr 26, 2023
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is not site-specific regression Works in youtube-dl/older yt-dlp
Projects
None yet
Development

No branches or pull requests

6 participants