yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
82.71k stars 6.44k forks source link

Stale downloads for certain videos ("Cannot reuse HTTP connection for different host") #6658

Open forthrin opened 1 year ago

forthrin commented 1 year ago

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

Checklist

Provide a description that is worded well enough to be understood

Some videos (and from certain users) generate a type of error not seen elsewhere.

Video removed by user now, but the phenomenon reoccurs for subsequent videos, often posted around 16 hours UTC.

Can't find anything that resembles a duplicate when looking up the warning message.

https://github.com/yt-dlp/yt-dlp/issues?q=%22reuse+HTTP+connection%22 https://trac.ffmpeg.org/search?q=%22reuse+HTTP+connection%22 https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavformat/http.c#l476

Let me know how can I do further tests and provide further details.

Provide verbose output that clearly demonstrates the problem

Complete Verbose Output

$ date
Mon Mar 27 15:25:40 UTC 2023
$ yt-dlp -v https://www.youtube.com/watch?v=mUj2ReXotdg
[debug] Command-line config: ['-v', 'https://www.youtube.com/watch?v=mUj2ReXotdg']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: 607510b9f
[debug] Python 3.11.2 (CPython arm64 64bit) - macOS-13.2.1-arm64-arm-64bit (OpenSSL 1.1.1t  7 Feb 2023)
[debug] exe versions: ffmpeg git-2023-03-08-aca7ef78cc (setts), ffprobe git-2023-03-08-aca7ef78cc, rtmpdump 2.4
[debug] Optional libraries: sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1788 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=mUj2ReXotdg
[youtube] mUj2ReXotdg: Downloading webpage
[youtube] mUj2ReXotdg: Downloading android player API JSON
[youtube] mUj2ReXotdg: Downloading m3u8 information
[youtube] mUj2ReXotdg: Downloading m3u8 information
[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, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: best/bestvideo+bestaudio
[info] mUj2ReXotdg: Downloading 1 format(s): 94
[https @ 0x127837600] Cannot reuse HTTP connection for different host: rr2---sn-5hneknes.googlevideo.com:-1 != rr2---sn-8xouxav-vna6.googlevideo.com:-1
[hls @ 0x127604d70] keepalive request failed for 'https://rr2---sn-8xouxav-vna6.googlevideo.com/videoplayback/id/mUj2ReXotdg.0/itag/94/source/yt_premiere_broadcast/expire/1679952253/ei/HbUhZIqTLtuQyAW_hrboDQ/ip/###.###.###.###/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D135/hls_chunk_host/rr2---sn-8xouxav-vna6.googlevideo.com/playlist_duration/30/manifest_duration/30/spc/99c5CXng7dzzOU1UgwgLa2-SO1yVZag/vprv/1/playlist_type/DVR/initcwndbps/2185000/mh/hz/mm/44/mn/sn-8xouxav-vna6/ms/lva/mv/m/mvi/2/pl/20/keepalive/yes/fexp/24007246/mt/1679930208/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,playlist_duration,manifest_duration,spc,vprv,playlist_type/sig/AOq0QJ8wRQIgQ2oOROlhWyDLSqGknkmmsCthGxcprD7ulfrBnTNSzQYCIQDQHnkxysiz2yOri9I9Zj4vR3LQhUlxwPJI306rtSf_4w%3D%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRgIhAM5GZCW5XAtwRkPE0GYvkD71AEDRHOJRv7RxECRArt8KAiEAkPC--JLLCd4CUQdeQu5z1WpWs5P7ngXGxLoQwdPsYIY%3D/playlist/index.m3u8/sq/63/goap/clen%3D82293%3Blmt%3D1679930338176738/govp/clen%3D203004%3Blmt%3D1679930338176736/dur/5.000/file/seg.ts' with error: 'Invalid argument' when opening url, retrying with new connection
[https @ 0x127837600] Cannot reuse HTTP connection for different host: rr2---sn-5hneknes.googlevideo.com:-1 != rr2---sn-8xouxav-vna6.googlevideo.com:-1
[ffmpeg] Interrupted by user
[download] 100% of    1.03MiB in 00:00:06 at 174.04KiB/s
duffxp commented 12 months ago

For ffmpeg you can use -http_persistent 0 to avoid this error.

forthrin commented 12 months ago

@quintanaplaca: Thanks! I'll try this the next time it happens.

Do you know why it happens? I've only seen it happen for a particular type of short-lived videos.

Is it related to "live" videos in some way?