-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[postprocessor] Add retries to file rename #4975
Comments
I was ending up with a situation where I'd have a Oddly enough, running the command twice for a playlist corrects any of the problem files - deleting the temp files and adding metadata to the others. I'm personally satisfied with that, so this can be closed as far as I'm concerned. This still seems like a potential bug so I'll let someone else close it when they've had the chance to look at it. |
Are you sure you don't have another program that is locking the files? Some AVs and backup programs may do this |
Pretty sure, like I said I disabled Windows Defender. I'd imagine running it the second time would fail in the same way if that were the case |
Well, something's blocking the file from being accessed, and that has nothing to do with yt-dlp. The best I can do is maybe add a retry to the renames |
I have the same issue. I see this consistently any time I use It might not be the worst idea to implement some kind of timed retry. edit |
I experienced the same issue with network-mapped folders. My workaround has been to use a temporary path that is on a normal disk instead. For example, |
To devs: Look into #8088 also, when implementing this |
As well as The problem with retrying is that there's no reason to believe that the inaccessible destination will become accessible within the timescale of a download operation (ie, without delays in the order of hours). However this may be something that works in practice but not in theory, with a judicious choice of default delay. Documentation suggests that it's not just the destination file that must not be open but also any parent directory, even unto the root of the share, which would explain why this problem is both prevalent and difficult to debug. |
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Provide a description that is worded well enough to be understood
I'm using
yt-dlp
as a drop-in replacement foryoutube-dl
simply for it's speed. The command:has no errors. But with
yt-dlp
:each file downloads fine, but errors out when renaming the part file:
It looks like the try_rename function has a minor difference from the same function in
youtube-dl
. I'm not aware of why that might be causing this issue, since it seems that ifos.replace
was causing issues thenos.rename
should as well. Based on what little related info I could find online I've tried:--no-part
which doesn't appear to change anything. It still downloads a temp part file and tries to renameI also note that it's not reliable which songs from any playlist have this error. Sometimes the renaming works, sometimes it doesn't... about 1 out of every 5.
I don't have a ton of time to sink into this so I'm wondering if anyone else on Windows (10) can reproduce this or if it's unique to me.
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)[debug] Command-line config
) and insert it belowComplete Verbose Output
The text was updated successfully, but these errors were encountered: