yt-dlp: Intermittent Issue: "WARNING - Cannot Update utime of File", Followed by Failure to Move File from Temp Folder to Final Path
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 have updated yt-dlp to nightly or master (update instructions)
- 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
The issue is that the file downloads successfully and appears to be complete and in the correct format, but it intermittently fails when attempting to update the file’s utime.
As a result, the file is not moved to the final path and remains in the temp folder. Interestingly, for the same video, this sometimes works without any issues.
When it doesn’t work, running the exact same code again immediately, it will move the file from the temp folder to its final location, without downloading.
Note: these are the file left in the /temp folder ->
/temp/My Video Download!.mp4 /temp/My Video Download!.png
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': TruetoYoutubeDLparams instead - Copy the WHOLE output (starting with
[debug] Command-line config) and insert it below
Complete Verbose Output
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version stable@2024.10.07 from yt-dlp/yt-dlp [1a176d874] (pip) API
[debug] params: {'ignore_no_formats_error': True, 'noplaylist': True, 'outtmpl': 'My Video Download!.%(ext)s', 'ffmpeg_location': '/usr/bin/ffmpeg', 'writethumbnail': True, 'quiet': False, 'extract_flat': True, 'format': 'bestvideo+bestaudio/best', 'updatetime': False, 'extractor_args': {'youtubetab': {'skip': ['authcheck']}}, 'paths': {'home': '/data', 'temp': '/temp'}, 'no_overwrites': True, 'verbose': True, 'merge_output_format': 'mp4', 'cookiefile': '/cookies.txt', 'postprocessors': [{'key': 'SponsorBlock', 'categories': ['sponsor']}, {'key': 'ModifyChapters', 'remove_sponsor_segments': ['sponsor']}, {'key': 'FFmpegThumbnailsConvertor', 'format': 'png', 'when': 'before_dl'}, {'key': 'FFmpegMetadata'}, {'key': 'EmbedThumbnail'}], 'compat_opts': set(), 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}}
[debug] Python 3.12.7 (CPython x86_64 64bit) - Linux-6.1.0-26-amd64-x86_64-with (OpenSSL 3.3.2 3 Sep 2024)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, mutagen-1.47.0, requests-2.32.3, sqlite3-3.45.3, urllib3-2.2.3, websockets-13.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1838 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=example
[youtube] example Downloading webpage
[debug] [youtube] Extracted SAPISID cookie
[debug] [youtube] Copying __Secure-3PAPISID cookie to SAPISID cookie
[youtube] example Downloading ios player API JSON
[youtube] example Downloading mweb player API JSON
[debug] Loading youtube-nsig.2f238d39 from cache
[debug] [youtube] Decrypted nsig
[debug] Loading youtube-nsig.2f238d39 from cache
[debug] [youtube] Decrypted nsig
[youtube] example Downloading m3u8 information
[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, size, br, asr, vext, aext, hasaud, id
[info] example Downloading 1 format(s): 625+140
[info] Downloading video thumbnail 42 ...
[info] Writing video thumbnail 42 to: /temp/My Video Download!.webp
[ThumbnailsConvertor] Converting thumbnail "/temp/My Video Download!.webp" to png
[debug] ffmpeg command line: /usr/bin/ffmpeg -y -loglevel repeat+info -f image2 -pattern_type none -i 'file:/temp/My Video Download!.webp' -update 1 -movflags +faststart 'file:/temp/My Video Download!.png'
Deleting original file /temp/My Video Download!.webp (pass -k to keep)
[hlsnative] Downloading m3u8 manifest
[debug] Invoking hlsnative downloader on
[download] Destination: /temp/My Video Download!.f140.m4a
[Merger] Merging formats into "/temp/My Video Download!.mp4"
[debug] ffmpeg command line: /usr/bin/ffmpeg -y -loglevel repeat+info -i 'file:/temp/My Video Download!.f625.mp4' -i 'file:/temp/My Video Download!.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:/temp/My Video Download!.temp.mp4'
Deleting original file /temp/My Video Download!.f140.m4a (pass -k to keep)
Deleting original file /temp/My Video Download!.f625.mp4 (pass -k to keep)
[SponsorBlock] Fetching SponsorBlock segments
[debug] SponsorBlock query: https://sponsor.ajay.app/api/skipSegments
[SponsorBlock] Found 2 segments in the SponsorBlock database
[debug] ffprobe command line: /usr/bin/ffprobe -hide_banner -show_format -show_streams -print_format json 'file:/temp/My Video Download!.mp4'
[ModifyChapters] Removing chapters from /temp/My Video Download!.mp4
[debug] Concat spec = 0.0-254.000000, 342.000000-934.000000, 953.849000-inf
[debug] Writing concat spec to /temp/My Video Download!.temp.mp4.concat
[debug] ffmpeg command line: /usr/bin/ffmpeg -y -loglevel repeat+info -hide_banner -nostdin -f concat -safe 0 -i 'file:/temp/My Video Download!.temp.mp4.concat' -map 0 -dn -ignore_unknown -c copy -c:s mov_text -movflags +faststart 'file:/temp/My Video Download!.temp.mp4'
Deleting original file /temp/My Video Download!.uncut.mp4 (pass -k to keep)
[Metadata] Adding metadata to "/temp/My Video Download!.mp4"
[debug] ffmpeg command line: /usr/bin/ffmpeg -y -loglevel repeat+info -i 'file:/temp/My Video Download!.mp4' -i 'file:/temp/My Video Download!.meta' -map 0 -dn -ignore_unknown -c copy -map_metadata 1 -write_id3v1 1 -metadata 'title=My Video Download!' -metadata date=20240922 -metadata 'description=example' -metadata 'purl=https://www.youtube.com/watch?v=example' -metadata 'comment=https://www.youtube.com/watch?example' -metadata artist=example -metadata:s:1 language=eng -movflags +faststart 'file:/temp/My Video Download!.temp.mp4'
WARNING: Cannot update utime of file
ERROR - Error downloading: My Video Download! - [Errno 2] No such file or directory: '/temp/My Video Download!.temp.mp4' -> '/temp/My Video Download!.mp4'
Similar to #7542
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (9 by maintainers)
I’m not seeing this issue as much, so maybe something has been changed in the recent update. Either way, I’ve also added a custom post processor to trim the metadata. So hopefully the issue is resolved.
Thanks @bashonly