mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[cleanup] Add more ruff rules (#10149)
Authored by: seproDev Reviewed-by: bashonly <88596187+bashonly@users.noreply.github.com> Reviewed-by: Simon Sawicki <contact@grub4k.xyz>
This commit is contained in:
		| @@ -1,5 +1,4 @@ | ||||
| from .common import InfoExtractor | ||||
| from ..compat import compat_str | ||||
| from ..utils import ( | ||||
|     determine_ext, | ||||
|     int_or_none, | ||||
| @@ -12,8 +11,8 @@ class NHLBaseIE(InfoExtractor): | ||||
|     def _real_extract(self, url): | ||||
|         site, tmp_id = self._match_valid_url(url).groups() | ||||
|         video_data = self._download_json( | ||||
|             'https://%s/%s/%sid/v1/%s/details/web-v1.json' | ||||
|             % (self._CONTENT_DOMAIN, site[:3], 'item/' if site == 'mlb' else '', tmp_id), tmp_id) | ||||
|             'https://{}/{}/{}id/v1/{}/details/web-v1.json'.format( | ||||
|                 self._CONTENT_DOMAIN, site[:3], 'item/' if site == 'mlb' else '', tmp_id), tmp_id) | ||||
|         if video_data.get('type') != 'video': | ||||
|             video_data = video_data['media'] | ||||
|             video = video_data.get('video') | ||||
| @@ -24,7 +23,7 @@ class NHLBaseIE(InfoExtractor): | ||||
|                 if videos: | ||||
|                     video_data = videos[0] | ||||
| 
 | ||||
|         video_id = compat_str(video_data['id']) | ||||
|         video_id = str(video_data['id']) | ||||
|         title = video_data['title'] | ||||
| 
 | ||||
|         formats = [] | ||||
| @@ -42,7 +41,7 @@ class NHLBaseIE(InfoExtractor): | ||||
|             else: | ||||
|                 height = int_or_none(playback.get('height')) | ||||
|                 formats.append({ | ||||
|                     'format_id': playback.get('name', 'http' + ('-%dp' % height if height else '')), | ||||
|                     'format_id': playback.get('name', 'http' + (f'-{height}p' if height else '')), | ||||
|                     'url': playback_url, | ||||
|                     'width': int_or_none(playback.get('width')), | ||||
|                     'height': height, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sepro
					sepro