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

youtube-dl isn't explicit when hitting the Windows max path length #23154

Closed
TheFrenchGhosty opened this issue Nov 20, 2019 · 3 comments
Closed

youtube-dl isn't explicit when hitting the Windows max path length #23154

TheFrenchGhosty opened this issue Nov 20, 2019 · 3 comments
Labels

Comments

@TheFrenchGhosty
Copy link

@TheFrenchGhosty TheFrenchGhosty commented Nov 20, 2019

  • I've verified that I'm running youtube-dl version 2019.11.05
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

C:\abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv>youtube-dl --verbose --output "%(title)s - %(uploader)s - %(upload_date)s/%(title)s - %(uploader)s - %(upload_date)s.%(ext)s"  --batch-file "Source.txt"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--output', '%(title)s - %(uploader)s - %(upload_date)s/%(title)s - %(uploader)s - %(upload_date)s.%(ext)s', '--batch-file', 'Source.txt']
[debug] Batch file urls: ['https://invidio.us/watch?v=kn4AR7CbluE']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2019.11.05
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1
[debug] Proxy map: {}
[youtube] kn4AR7CbluE: Downloading webpage
[youtube] kn4AR7CbluE: Downloading video info webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'XXXXXXXXXXXXXXXXXX'
ERROR: unable to open for writing: [Errno 2] No such file or directory: 'I THOUGHT I wanted this... - Razer Blade Pro 17 Review - Linus Tech Tips - 20191119\\I THOUGHT I wanted this... - Razer Blade Pro 17 Review - Linus Tech Tips - 20191119.f313.webm.part'
Traceback (most recent call last):
  File "XXXXXX\youtube-dl\ytdl-org\tmp7hc5a09v\build\youtube_dl\downloader\http.py", line 250, in download
  File "XXXXXX\youtube-dl\ytdl-org\tmp7hc5a09v\build\youtube_dl\utils.py", line 2042, in sanitize_open
FileNotFoundError: [Errno 2] No such file or directory: 'I THOUGHT I wanted this... - Razer Blade Pro 17 Review - Linus Tech Tips - 20191119\\I THOUGHT I wanted this... - Razer Blade Pro 17 Review - Linus Tech Tips - 20191119.f313.webm.part'

Description

If the path length is longer than 256 character, youtube-dl will trigger ERROR: unable to open for writing: [Errno 2] No such file or directory

It took me more than a half hour to understand that it was the problem. I was trying to fix my scripts and got the error, I thought something else was wrong but in the end it was just youtube-dl not being explicit about the error, it would be nice if it could at least say to check for the path length.

To reproduce the problem:

Using this video: https://youtube.com/watch?v=kn4AR7CbluE named "I THOUGHT I wanted this... - Razer Blade Pro 17 Review"

Using the output format --output "%%(title)s - %%(uploader)s - %%(upload_date)s/%%(title)s - %%(uploader)s - %%(upload_date)s.%%(ext)s"

If youtube-dl is ran in a path with more than 77 characters the error is triggered

So:

Broken : C:\abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv

Trigger: ERROR: unable to open for writing: [Errno 2] No such file or directory: 'I THOUGHT I wanted this... - Razer Blade Pro 17 Review - Linus Tech Tips - 20191119\\I THOUGHT I wanted this... - Razer Blade Pro 17 Review - Linus Tech Tips - 20191119.f313.webm.part'

Working : C:\abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu

@dstftw dstftw closed this Nov 20, 2019
@dstftw dstftw added the duplicate label Nov 20, 2019
@TheFrenchGhosty
Copy link
Author

@TheFrenchGhosty TheFrenchGhosty commented Nov 20, 2019

@dstftw Can you stop closing my issues without even reading them?

You already closed my Feature Request because you didn't understand what I was asking, can you at least read a major bug report for Windows users, it's not even a duplicate.

@Perflyst
Copy link

@Perflyst Perflyst commented Nov 20, 2019

Also please link the issues of which this is a duplicate.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 20, 2019

Stop posting duplicates and ambiguously interpretable issues and I won't close them.
youtube-dl reports exactly what it receives from the underlying API. There is no special telepathy to know what is the real reason - checking length is not a reliable way since max path may be disabled in registry. There is already general purpose issue on long paths exists, bother to use search.

@ytdl-org ytdl-org locked and limited conversation to collaborators Nov 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.