mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 05:37:07 -05:00 
			
		
		
		
	[newgrounds] Fix metadata extraction (closes #15531)
This commit is contained in:
		@@ -87,19 +87,21 @@ class NewgroundsIE(InfoExtractor):
 | 
				
			|||||||
        self._check_formats(formats, media_id)
 | 
					        self._check_formats(formats, media_id)
 | 
				
			||||||
        self._sort_formats(formats)
 | 
					        self._sort_formats(formats)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        uploader = self._search_regex(
 | 
					        uploader = self._html_search_regex(
 | 
				
			||||||
            r'(?:Author|Writer)\s*<a[^>]+>([^<]+)', webpage, 'uploader',
 | 
					            (r'(?s)<h4[^>]*>(.+?)</h4>.*?<em>\s*Author\s*</em>',
 | 
				
			||||||
 | 
					             r'(?:Author|Writer)\s*<a[^>]+>([^<]+)'), webpage, 'uploader',
 | 
				
			||||||
            fatal=False)
 | 
					            fatal=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        timestamp = unified_timestamp(self._search_regex(
 | 
					        timestamp = unified_timestamp(self._html_search_regex(
 | 
				
			||||||
            r'<dt>Uploaded</dt>\s*<dd>([^<]+)', webpage, 'timestamp',
 | 
					            (r'<dt>\s*Uploaded\s*</dt>\s*<dd>([^<]+</dd>\s*<dd>[^<]+)',
 | 
				
			||||||
 | 
					             r'<dt>\s*Uploaded\s*</dt>\s*<dd>([^<]+)'), webpage, 'timestamp',
 | 
				
			||||||
            default=None))
 | 
					            default=None))
 | 
				
			||||||
        duration = parse_duration(self._search_regex(
 | 
					        duration = parse_duration(self._search_regex(
 | 
				
			||||||
            r'<dd>Song\s*</dd><dd>.+?</dd><dd>([^<]+)', webpage, 'duration',
 | 
					            r'(?s)<dd>\s*Song\s*</dd>\s*<dd>.+?</dd>\s*<dd>([^<]+)', webpage,
 | 
				
			||||||
            default=None))
 | 
					            'duration', default=None))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        filesize_approx = parse_filesize(self._html_search_regex(
 | 
					        filesize_approx = parse_filesize(self._html_search_regex(
 | 
				
			||||||
            r'<dd>Song\s*</dd><dd>(.+?)</dd>', webpage, 'filesize',
 | 
					            r'(?s)<dd>\s*Song\s*</dd>\s*<dd>(.+?)</dd>', webpage, 'filesize',
 | 
				
			||||||
            default=None))
 | 
					            default=None))
 | 
				
			||||||
        if len(formats) == 1:
 | 
					        if len(formats) == 1:
 | 
				
			||||||
            formats[0]['filesize_approx'] = filesize_approx
 | 
					            formats[0]['filesize_approx'] = filesize_approx
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user