WARNING: [youtube] Unable to download API page: HTTPSConnectionPool(host='www.youtube.com', port=443): Read timed out
dear developers,
here is the logs from docker , and i login the ytdl_1 container and rum curl -o /dev/null https://www.youtube.com --limit-rate 500k , it goes well. how to fix this error ?
ytdl_1 | [2025-04-17 15:22:42 session.py:281 I] PingTask started
ytdl_1 | [2025-04-17 15:22:43 dispatcher.py:224 I] Started 64 HandlerTasks
ytdl_1 | [2025-04-17 15:28:15 main.py:346 I] start https://youtu.be/3GjNSbmhePg?si=KS8CRls8E8ZirXP4
ytdl_1 | [2025-04-17 15:28:15 generic.py:121 I] yt-dlp options: {'progress_hooks': [<function YoutubeDownload._download.
it seems like a temporary network issue. Try again later
it seems like a temporary network issue. Try again later
Thanks. I did try, but it didn’t work. My friend used yt_dlp to download the same URL (https://youtu.be/3GjNSbmhePg?si=KS8CRls8E8ZirXP4), and it worked for him. i also try other youtube video URL but get same error. may i ask is there a way to increase the timeout from 20 to 120s to debug ?
it seems like a temporary network issue. Try again later
Thanks. I did try, but it didn’t work. My friend used yt_dlp to download the same URL (https://youtu.be/3GjNSbmhePg?si=KS8CRls8E8ZirXP4), and it worked for him. i also try other youtube video URL but get same error. may i ask is there a way to increase the timeout from 20 to 120s to debug ?
This doesn't look like a problem from the bot side. As @BennyThink mentioned seems like a network issue. According to logs, yt-dlp trying to access the YT host and failing.
Instead of curl, try running yt-dlp inside the container and share the output.
yt-dlp -f bestvideo+bestaudio "https://youtu.be/3GjNSbmhePg"
yt-dlp -f bestvideo+bestaudio "https://youtu.be/3GjNSbmhePg"
/app # curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 2990k 100 2990k 0 0 2226k 0 0:00:01 0:00:01 --:--:-- 206M /app # chmod +x /usr/local/bin/yt-dlp /app # yt-dlp -f bestvideo+bestaudio "https://youtu.be/3GjNSbmhePg" [youtube] Extracting URL: https://youtu.be/3GjNSbmhePg [youtube] 3GjNSbmhePg: Downloading webpage [youtube] 3GjNSbmhePg: Downloading tv client config [youtube] 3GjNSbmhePg: Downloading player 9a279502-main [youtube] 3GjNSbmhePg: Downloading tv player API JSON WARNING: [youtube] HTTPSConnectionPool(host='www.youtube.com', port=443): Read timed out. (read timeout=20.0). Retrying (1/3)... [youtube] 3GjNSbmhePg: Downloading tv player API JSON WARNING: [youtube] HTTPSConnectionPool(host='www.youtube.com', port=443): Read timed out. (read timeout=20.0). Retrying (2/3)... [youtube] 3GjNSbmhePg: Downloading tv player API JSON WARNING: [youtube] HTTPSConnectionPool(host='www.youtube.com', port=443): Read timed out. (read timeout=20.0). Retrying (3/3)... [youtube] 3GjNSbmhePg: Downloading tv player API JSON WARNING: [youtube] Unable to download API page: HTTPSConnectionPool(host='www.youtube.com', port=443): Read timed out. (read timeout=20.0) (caused by TransportError("HTTPSConnectionPool(host='www.youtube.com', port=443): Read timed out. (read timeout=20.0)")) [youtube] 3GjNSbmhePg: Downloading ios player API JSON ERROR: [youtube] 3GjNSbmhePg: Sign in to confirm you’re not a bot. Use --cookies-from-browser or --cookies for the authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies. Also see https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies for tips on effectively exporting YouTube cookies
it seems like a temporary network issue. Try again later
Thanks. I did try, but it didn’t work. My friend used yt_dlp to download the same URL (https://youtu.be/3GjNSbmhePg?si=KS8CRls8E8ZirXP4), and it worked for him. i also try other youtube video URL but get same error. may i ask is there a way to increase the timeout from 20 to 120s to debug ?
This doesn't look like a problem from the bot side. As @BennyThink mentioned seems like a network issue. According to logs, yt-dlp trying to access the YT host and failing.
Instead of curl, try running yt-dlp inside the container and share the output.
yt-dlp -f bestvideo+bestaudio "https://youtu.be/3GjNSbmhePg"
and at the same time i try to download x.com video, both yt-dlp and ytdlbot work fine ,
/app # yt-dlp -f bestvideo+bestaudio "https://x.com/luamyupup/status/1912455981621211148" [twitter] Extracting URL: https://x.com/luamyupup/status/1912455981621211148 [twitter] 1912455981621211148: Downloading guest token [twitter] 1912455981621211148: Downloading GraphQL JSON [twitter] 1912455981621211148: Downloading m3u8 information [info] 1912455890319360000: Downloading 1 format(s): hls-1046+hls-audio-128000-Audio [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 20 [download] Destination: Amy xxxxxx! [1912455890319360000].fhls-1046.mp4 [download] 100% of 6.56MiB in 00:00:01 at 5.24MiB/s
pretty wired, is there a way to increase the timeout from 20 to 120s to debug ?
i also upload my tcpdump result at pastebin for your reference. thx so much. https://pastebin.com/5Lunyddq
@kang000feng are you using YouTube cookies or not ?