Playlist/channel extraction: stop pinning a static user_agent for yt-dlp

Correcting the cookies theory — ytdl-sub is just CLI yt-dlp (no browser). The real
differentiators are a CURRENT yt-dlp + not fighting YouTube's client identity. We
were pinning a static user_agent in the yt-dlp opts, which yt-dlp recommends against
(it trips YouTube's heuristics and truncates large-playlist pagination). Dropped it
so yt-dlp manages its own (current) client — the lever that lets a fresh ytdl-sub
page further than us. (_UA is still used for the InnerTube requests.) Softened the
partial-playlist note to just 'Showing N of TOTAL videos.'
This commit is contained in:
BoulderBadgeDad 2026-06-17 22:21:12 -07:00
parent 67197ce956
commit 856f14824f
2 changed files with 5 additions and 5 deletions

View file

@ -182,7 +182,9 @@ def _ydl_opts(limit, db=None):
"extract_flat": True, # fast: enumerate uploads without per-video format probing
"skip_download": True,
"playlistend": int(limit),
"user_agent": _UA,
# NB: do NOT pin user_agent here — yt-dlp manages its own (current) client
# identity; a static UA trips YouTube's heuristics and truncates large
# playlist pagination (the reason a fresh ytdl-sub pages further than us).
}
opts.update(_cookie_opts())
return opts

View file

@ -1571,10 +1571,8 @@
ytVideoMap = {};
vids.forEach(function (v) { ytVideoMap[v.youtube_id] = v; });
var total = pl.video_count || vids.length;
// Anonymous, YouTube throttles us to ~100-200; with YouTube cookies set in
// Settings, yt-dlp pages the whole playlist (like ytdl-sub). Be honest when partial.
var note = total > vids.length
? 'Showing ' + vids.length + ' of ' + total + ' videos — add YouTube cookies in Settings to load the full playlist.' : '';
// YouTube throttles large-playlist listing for our client — be honest when partial.
var note = total > vids.length ? 'Showing ' + vids.length + ' of ' + total + ' videos.' : '';
var season = { season_number: 1, title: 'Videos', poster_url: ytProx(pl.thumbnail_url),
episode_owned: 0, episode_total: vids.length, episodes: vids.map(ytEpisodeOf) };
return { kind: 'playlist', source: 'youtube', id: pl.playlist_id, title: pl.title || 'Playlist',