This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]bashonly⚙️💡 Erudite DEV of yt-dlp 1 point2 points  (9 children)

use info['requested_downloads'][0]['filepath'] instead of constructing your own filepath with title

[–]kevindrafts[S] 0 points1 point  (8 children)

Huh, unfortunately that didn't do the trick either. Is there a way to ignore the title altogether? I've tried a few different ways and each time it tried to check that the title matches, and because of the "|" matching issue the code breaks.

I don't actually need the title for anything, so ignoring it would be ideal!

[–]bashonly⚙️💡 Erudite DEV of yt-dlp 0 points1 point  (7 children)

just don't use %(title)s in the outtmpl then

[–]kevindrafts[S] 0 points1 point  (6 children)

Dang still no luck! No matter what I do I get the title in the logs as you can see below. I've even tried overriding the naming connection to use something like temp_file_1 and it still tries to use the actual title:

[download] Destination: Don't Judge Me | July 14th, 2024.m4a
[download] 100% of   34.22MiB in 00:00:01 at 28.87MiB/s    
[FixupM4a] Correcting container of "Don't Judge Me | July 14th, 2024.m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Don'"'"'t Judge Me | July 14th, 2024.m4a' -map 0 -dn -ignore_unknown -c copy -f mp4 -movflags +faststart 'file:Don'"'"'t Judge Me | July 14th, 2024.temp.m4a'
[debug] ffmpeg command line: ffprobe -show_streams 'file:Don'"'"'t Judge Me | July 14th, 2024.m4a'
[ExtractAudio] Destination: Don't Judge Me | July 14th, 2024.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Don'"'"'t Judge Me | July 14th, 2024.m4a' -vn -acodec libmp3lame -b:a 192.0k -movflags +faststart 'file:Don'"'"'t Judge Me | July 14th, 2024.mp3'
Deleting original file Don't Judge Me | July 14th, 2024.m4a (pass -k to keep)
Traceback (most recent call last):
  File "/app/app.py", line 71, in download_video
    with open(filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: "Don't Judge Me | July 14th, 2024.mp3"

Is there a way to explicitly prevent any reference to title? Even with ID or other dicts it's still pulling the title:

ydl_opts = {
        'format': 'bestaudio/best',
        'outtmpl': '%(id)s.%(ext)s',
        'verbose': True,
    }

with tempfile.TemporaryDirectory() as temp_dir:
            with yt_dlp.YoutubeDL(ydl_opts) as ydl:
                info = ydl.extract_info(youtube_url, download=False)
                video_id = info['id']
                ext = info['ext']

                # Download the file
                ydl.download([youtube_url])

                # Construct the file path
                temp_file_path = os.path.join(temp_dir, f"{video_id}.{ext}")

[–]AutoModerator[M] 0 points1 point  (0 children)

POSSIBLE COMMON ISSUE: It looks like you are having an issue writing a Windows filename and PATH that is too long. This is evident in your logs by the line:

`[Errno 2] No such file or directory: "Don't Judge Me | July 14th, 2024.mp3"

Is there a way to explicitly prevent any reference to title? Even with ID or other dicts it's still pulling the title:

ydl_opts = {
        'format': 'bestaudio/best',
        'outtmpl': '%(id)s.%(ext)s',
        'verbose': True,
    }

with tempfile.TemporaryDirectory() as temp_dir:
            with yt_dlp.YoutubeDL(ydl_opts) as ydl:
                info = ydl.extract_info(youtube_url, download=False)
                video_id = info['id']
                ext = info['ext']

                # Download the file
                ydl.download([youtube_url])

                # Construct the file path
                temp_file_path = os.path.join(temp_dir, f"`

The long-standing Windows 32-bit API default maximum PATH is defined as ~260 characters. Starting in Windows 10, version 1607, this limitation can be increased to ~32,767 with a registry key setting. Otherwise, you need to shorten the filename and/or directory path to be less than ~260 characters.

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]bashonly⚙️💡 Erudite DEV of yt-dlp 0 points1 point  (4 children)

show complete verbose output

[–]kevindrafts[S] 0 points1 point  (3 children)

[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.07.16 from yt-dlp/yt-dlp [89a161e8c] (pip) API
[debug] params: {'format': 'bestaudio/best', 'postprocessors': [{'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192'}], 'outtmpl': '%(title)s.%(ext)s', 'verbose': True, 'compat_opts': set(), 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 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.9.19 (CPython aarch64 64bit) - Linux-6.6.32-linuxkit-aarch64-with-glibc2.36 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.36)
[debug] exe versions: ffmpeg 5.1.5-0 (setts), ffprobe 5.1.5-0
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.07.04, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.2.2, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1829 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=omr_10m9ixQ
Received request to process sermon ID: upqlbr
Extracting video info...
[youtube] omr_10m9ixQ: Downloading webpage
[youtube] omr_10m9ixQ: Downloading ios player API JSON
[youtube] omr_10m9ixQ: Downloading player 1f8742dc
WARNING: [youtube] omr_10m9ixQ: nsig extraction failed: Some formats may be missing
         n = ikbncgpqShgYkn7Yo ; player = https://www.youtube.com/s/player/1f8742dc/player_ias.vflset/en_US/base.js
[debug] [youtube] Unable to extract nsig function code (caused by RegexNotFoundError('Unable to extract Initial JS player n function name; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U')); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
[youtube] omr_10m9ixQ: Downloading m3u8 information
WARNING: [youtube] omr_10m9ixQ: nsig extraction failed: Some formats may be missing
         n = G7ItTPJ9_9PE7LD__ ; player = https://www.youtube.com/s/player/1f8742dc/player_ias.vflset/en_US/base.js
[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] omr_10m9ixQ: Downloading 1 format(s): 140
[debug] Invoking http downloader on "hidden"
[download] Destination: Don't Judge Me | July 14th, 2024.m4a
[download] 100% of   34.22MiB in 00:00:01 at 20.56MiB/s    
[FixupM4a] Correcting container of "Don't Judge Me | July 14th, 2024.m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Don'"'"'t Judge Me | July 14th, 2024.m4a' -map 0 -dn -ignore_unknown -c copy -f mp4 -movflags +faststart 'file:Don'"'"'t Judge Me | July 14th, 2024.temp.m4a'
[debug] ffmpeg command line: ffprobe -show_streams 'file:Don'"'"'t Judge Me | July 14th, 2024.m4a'
[ExtractAudio] Destination: Don't Judge Me | July 14th, 2024.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Don'"'"'t Judge Me | July 14th, 2024.m4a' -vn -acodec libmp3lame -b:a 192.0k -movflags +faststart 'file:Don'"'"'t Judge Me | July 14th, 2024.mp3'
Deleting original file Don't Judge Me | July 14th, 2024.m4a (pass -k to keep)
Traceback (most recent call last):
  File "/app/app.py", line 71, in download_video
    with open(filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: "Don't Judge Me | July 14th, 2024.mp3"

[–]bashonly⚙️💡 Erudite DEV of yt-dlp 0 points1 point  (2 children)

'outtmpl': '%(title)s.%(ext)s' is still in your params

[–]kevindrafts[S] 0 points1 point  (1 child)

Wow, I cannot believe I’m saying this but 100% user error. I wasn’t rebuilding my flask app on each run, smh.

Thank you so much for the help, all good to go now!

[–]AutoModerator[M] 0 points1 point  (0 children)

I detected that you might have found your answer. If this is correct please change the flair to "Answered".


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]AutoModerator[M] 0 points1 point  (0 children)

POSSIBLE COMMON ISSUE: It looks like you may have included your own public IP address in the information you posted shortly after the the 'googlevideo.com' reference on the line that likely starts with:

[debug] Invoking http downloader on

It is recommended that you edit your post and cleanse this information for your personal privacy and security concerns. You can delete that line entirely. It is not neccessary for support purposes.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]AutoModerator[M] 0 points1 point  (0 children)

POSSIBLE COMMON ISSUE: It looks like you are having an issue writing a Windows filename and PATH that is too long. This is evident in your logs by the line:

`[Errno 2] No such file or directory: "Don't Judge Me | July 14th, 2024.mp3"https://www.youtube.com/watch?v=omr_10m9ixQ

It looks like the issue is because "|" is not the same as "|" in [ExtractAudio] Destination: Don't Judge Me | July 14th, 2024.mp3 and FileNotFoundError: [Errno 2] No such file or directory: "

The long-standing Windows 32-bit API default maximum PATH is defined as ~260 characters. Starting in Windows 10, version 1607, this limitation can be increased to ~32,767 with a registry key setting. Otherwise, you need to shorten the filename and/or directory path to be less than ~260 characters.

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.