ErrorFlynn / ytdlp-interface

Windows graphical interface for yt-dlp, designed as a simple YouTube downloader
MIT License
1.06k stars 56 forks source link

Fails to download certain video format : Unable to rename file: [WinError 32] The process cannot access the file because it is being used by another process #170

Open etherealxx opened 2 months ago

etherealxx commented 2 months ago

so i'm trying to download a video with this format image

i got an error, like this

full output:

[GUI] executing command line: "C:\Users\Ethereal\Documents\ytdlp-interface\yt-dlp.exe" -f 311+140 --embed-thumbnail --no-mtime  -P C:\Users\Ethereal\Downloads -o "%(title)s.%(ext)s" "https://www.youtube.com/watch?v=kaNHCU1ghsA"

[youtube] Extracting URL: https://www.youtube.com/watch?v=kaNHCU1ghsA
[youtube] kaNHCU1ghsA: Downloading webpage
[youtube] kaNHCU1ghsA: Downloading ios player API JSON
[youtube] kaNHCU1ghsA: Downloading android player API JSON
[youtube] kaNHCU1ghsA: Downloading player d2e656ee
WARNING: [youtube] kaNHCU1ghsA: nsig extraction failed: You may experience throttling for some formats
         n = 8nkYiqTZfC5ObpL_ ; player = https://www.youtube.com/s/player/d2e656ee/player_ias.vflset/en_US/base.js
[youtube] kaNHCU1ghsA: Downloading player d2e656ee
WARNING: [youtube] kaNHCU1ghsA: nsig extraction failed: You may experience throttling for some formats
         n = 2_PsgSqb8NGf-OrA ; player = https://www.youtube.com/s/player/d2e656ee/player_ias.vflset/en_US/base.js
[youtube] kaNHCU1ghsA: Downloading m3u8 information
[info] kaNHCU1ghsA: Downloading 1 format(s): 311+140
Deleting existing file C:\Users\Ethereal\Downloads\A MrBeast Shoutout Will Ruin Your Channel....webp
[info] Downloading video thumbnail 41 ...
[info] Writing video thumbnail 41 to: C:\Users\Ethereal\Downloads\A MrBeast Shoutout Will Ruin Your Channel....webp
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 174
[download] Destination: C:\Users\Ethereal\Downloads\A MrBeast Shoutout Will Ruin Your Channel....f311.mp4
ERROR: Unable to rename file: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\Ethereal\\Downloads\\A MrBeast Shoutout Will Ruin Your Channel....f311.mp4.part-Frag5.part' -> 'C:\\Users\\Ethereal\\Downloads\\A MrBeast Shoutout Will Ruin Your Channel....f311.mp4.part-Frag5'. Giving up after 3 retries

[GUI] yt-dlp.exe process has exited

also the progress bar looks like this image

keep in mind that using the 298 video option (the 720p 60fps variant) instead of 311 works just fine

ErrorFlynn commented 2 months ago

I'm guessing the file is opened by a different instance of yt-dlp that previously failed to close for whatever reason. When this type of error happens, use Task Manager to check for "undead" instances of yt-dlp, and close any that you find. If there aren't any, then you have to find which other process has the file open, and kill it.

I'll see what I can do about the progress bar.