mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 00:25:15 +00:00 
			
		
		
		
	[youtube] Make duration an integer or None
This commit is contained in:
		@@ -1377,9 +1377,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if 'length_seconds' not in video_info:
 | 
					        if 'length_seconds' not in video_info:
 | 
				
			||||||
            self._downloader.report_warning(u'unable to extract video duration')
 | 
					            self._downloader.report_warning(u'unable to extract video duration')
 | 
				
			||||||
            video_duration = ''
 | 
					            video_duration = None
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            video_duration = compat_urllib_parse.unquote_plus(video_info['length_seconds'][0])
 | 
					            video_duration = int(compat_urllib_parse.unquote_plus(video_info['length_seconds'][0]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # annotations
 | 
					        # annotations
 | 
				
			||||||
        video_annotations = None
 | 
					        video_annotations = None
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user