mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[xtube] Fix extraction (closes #12023)
This commit is contained in:
		@@ -60,7 +60,8 @@ class XTubeIE(InfoExtractor):
 | 
				
			|||||||
        webpage = self._download_webpage(req, display_id)
 | 
					        webpage = self._download_webpage(req, display_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        sources = self._parse_json(self._search_regex(
 | 
					        sources = self._parse_json(self._search_regex(
 | 
				
			||||||
            r'sources\s*:\s*({.+?}),', webpage, 'sources'), video_id)
 | 
					            r'(["\'])sources\1\s*:\s*(?P<sources>{.+?}),',
 | 
				
			||||||
 | 
					            webpage, 'sources', group='sources'), video_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        formats = []
 | 
					        formats = []
 | 
				
			||||||
        for format_id, format_url in sources.items():
 | 
					        for format_id, format_url in sources.items():
 | 
				
			||||||
@@ -81,10 +82,10 @@ class XTubeIE(InfoExtractor):
 | 
				
			|||||||
             r'<span[^>]+class="nickname"[^>]*>([^<]+)'),
 | 
					             r'<span[^>]+class="nickname"[^>]*>([^<]+)'),
 | 
				
			||||||
            webpage, 'uploader', fatal=False)
 | 
					            webpage, 'uploader', fatal=False)
 | 
				
			||||||
        duration = parse_duration(self._search_regex(
 | 
					        duration = parse_duration(self._search_regex(
 | 
				
			||||||
            r'<dt>Runtime:</dt>\s*<dd>([^<]+)</dd>',
 | 
					            r'<dt>Runtime:?</dt>\s*<dd>([^<]+)</dd>',
 | 
				
			||||||
            webpage, 'duration', fatal=False))
 | 
					            webpage, 'duration', fatal=False))
 | 
				
			||||||
        view_count = str_to_int(self._search_regex(
 | 
					        view_count = str_to_int(self._search_regex(
 | 
				
			||||||
            r'<dt>Views:</dt>\s*<dd>([\d,\.]+)</dd>',
 | 
					            r'<dt>Views:?</dt>\s*<dd>([\d,\.]+)</dd>',
 | 
				
			||||||
            webpage, 'view count', fatal=False))
 | 
					            webpage, 'view count', fatal=False))
 | 
				
			||||||
        comment_count = str_to_int(self._html_search_regex(
 | 
					        comment_count = str_to_int(self._html_search_regex(
 | 
				
			||||||
            r'>Comments? \(([\d,\.]+)\)<',
 | 
					            r'>Comments? \(([\d,\.]+)\)<',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user