From 2140f489192f98284811e7cbaba8b6fa0e552bf7 Mon Sep 17 00:00:00 2001 From: Astound Date: Mon, 22 Jan 2024 05:52:44 +0800 Subject: Subscriptions: Use playlist method to get channel videos Use the UU (user uploads) playlist since it includes streams --- youtube/playlist.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'youtube/playlist.py') diff --git a/youtube/playlist.py b/youtube/playlist.py index a2ff80f..83d530c 100644 --- a/youtube/playlist.py +++ b/youtube/playlist.py @@ -28,7 +28,8 @@ def playlist_ctoken(playlist_id, offset, include_shorts=True): return base64.urlsafe_b64encode(pointless_nest).decode('ascii') -def playlist_first_page(playlist_id, report_text="Retrieved playlist", use_mobile=False): +def playlist_first_page(playlist_id, report_text="Retrieved playlist", + use_mobile=False): if use_mobile: url = 'https://m.youtube.com/playlist?list=' + playlist_id + '&pbj=1' content = util.fetch_url( @@ -47,7 +48,8 @@ def playlist_first_page(playlist_id, report_text="Retrieved playlist", use_mobil return content -def get_videos(playlist_id, page, include_shorts=True, use_mobile=False): +def get_videos(playlist_id, page, include_shorts=True, use_mobile=False, + report_text='Retrieved playlist'): # mobile requests return 20 videos per page if use_mobile: page_size = 20 @@ -62,7 +64,7 @@ def get_videos(playlist_id, page, include_shorts=True, use_mobile=False): include_shorts=include_shorts) url += "&pbj=1" content = util.fetch_url( - url, headers, report_text="Retrieved playlist", + url, headers, report_text=report_text, debug_name='playlist_videos' ) -- cgit v1.2.3