mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[youtube:channel] Fix the extraction of autogenerated channels
The ajax pages are empty, now it looks directly in the channel's /videos page
This commit is contained in:
		@@ -1594,7 +1594,18 @@ class YoutubeChannelIE(InfoExtractor):
 | 
			
		||||
        # Download channel page
 | 
			
		||||
        channel_id = mobj.group(1)
 | 
			
		||||
        video_ids = []
 | 
			
		||||
        url = 'https://www.youtube.com/channel/%s/videos' % channel_id
 | 
			
		||||
        channel_page = self._download_webpage(url, channel_id)
 | 
			
		||||
        if re.search(r'channel-header-autogenerated-label', channel_page) is not None:
 | 
			
		||||
            autogenerated = True
 | 
			
		||||
        else:
 | 
			
		||||
            autogenerated = False
 | 
			
		||||
 | 
			
		||||
        if autogenerated:
 | 
			
		||||
            # The videos are contained in a single page
 | 
			
		||||
            # the ajax pages can't be used, they are empty
 | 
			
		||||
            video_ids = self.extract_videos_from_page(channel_page)
 | 
			
		||||
        else:
 | 
			
		||||
            # Download all channel pages using the json-based channel_ajax query
 | 
			
		||||
            for pagenum in itertools.count(1):
 | 
			
		||||
                url = self._MORE_PAGES_URL % (pagenum, channel_id)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user