mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 03:17:07 -05:00 
			
		
		
		
	[sohu] Fix numeric fields
This commit is contained in:
		@@ -8,7 +8,11 @@ from ..compat import (
 | 
				
			|||||||
    compat_str,
 | 
					    compat_str,
 | 
				
			||||||
    compat_urllib_parse_urlencode,
 | 
					    compat_urllib_parse_urlencode,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from ..utils import ExtractorError
 | 
					from ..utils import (
 | 
				
			||||||
 | 
					    ExtractorError,
 | 
				
			||||||
 | 
					    int_or_none,
 | 
				
			||||||
 | 
					    try_get,
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SohuIE(InfoExtractor):
 | 
					class SohuIE(InfoExtractor):
 | 
				
			||||||
@@ -169,10 +173,11 @@ class SohuIE(InfoExtractor):
 | 
				
			|||||||
                formats.append({
 | 
					                formats.append({
 | 
				
			||||||
                    'url': video_url,
 | 
					                    'url': video_url,
 | 
				
			||||||
                    'format_id': format_id,
 | 
					                    'format_id': format_id,
 | 
				
			||||||
                    'filesize': data['clipsBytes'][i],
 | 
					                    'filesize': int_or_none(
 | 
				
			||||||
                    'width': data['width'],
 | 
					                        try_get(data, lambda x: x['clipsBytes'][i])),
 | 
				
			||||||
                    'height': data['height'],
 | 
					                    'width': int_or_none(data.get('width')),
 | 
				
			||||||
                    'fps': data['fps'],
 | 
					                    'height': int_or_none(data.get('height')),
 | 
				
			||||||
 | 
					                    'fps': int_or_none(data.get('fps')),
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
            self._sort_formats(formats)
 | 
					            self._sort_formats(formats)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user