mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	[youtube:tab] Fix duration extraction for shorts (#3171)
Related: https://github.com/TeamNewPipe/NewPipe/issues/8034 Authored-by: coletdjnz
This commit is contained in:
		| @@ -807,6 +807,12 @@ class YoutubeBaseInfoExtractor(InfoExtractor): | ||||
|         description = self._get_text(renderer, 'descriptionSnippet') | ||||
|         duration = parse_duration(self._get_text( | ||||
|             renderer, 'lengthText', ('thumbnailOverlays', ..., 'thumbnailOverlayTimeStatusRenderer', 'text'))) | ||||
|         if duration is None: | ||||
|             duration = parse_duration(self._search_regex( | ||||
|                 r'(?i)(ago)(?!.*\1)\s+(?P<duration>[a-z0-9 ,]+?)(?:\s+[\d,]+\s+views)?(?:\s+-\s+play\s+short)?$', | ||||
|                 traverse_obj(renderer, ('title', 'accessibility', 'accessibilityData', 'label'), default='', expected_type=str), | ||||
|                 video_id, default=None, group='duration')) | ||||
|  | ||||
|         view_count = self._get_count(renderer, 'viewCountText') | ||||
|  | ||||
|         uploader = self._get_text(renderer, 'ownerText', 'shortBylineText') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 coletdev
					coletdev