1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +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:
sepro
2024-06-12 01:09:58 +02:00
committed by GitHub
parent db50f19d76
commit add96eb9f8
915 changed files with 7027 additions and 7246 deletions

View File

@ -1,8 +1,6 @@
import urllib.parse
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import (
ExtractorError,
format_field,
@ -31,7 +29,7 @@ class FlickrIE(InfoExtractor):
'view_count': int,
'tags': list,
'license': 'Attribution-ShareAlike',
}
},
}
_API_BASE_URL = 'https://api.flickr.com/services/rest?'
# https://help.yahoo.com/kb/flickr/SLN25525.html
@ -52,14 +50,14 @@ class FlickrIE(InfoExtractor):
def _call_api(self, method, video_id, api_key, note, secret=None):
query = {
'photo_id': video_id,
'method': 'flickr.%s' % method,
'method': f'flickr.{method}',
'api_key': api_key,
'format': 'json',
'nojsoncallback': 1,
}
if secret:
query['secret'] = secret
data = self._download_json(self._API_BASE_URL + compat_urllib_parse_urlencode(query), video_id, note)
data = self._download_json(self._API_BASE_URL + urllib.parse.urlencode(query), video_id, note)
if data['stat'] != 'ok':
raise ExtractorError(data['message'])
return data
@ -83,7 +81,7 @@ class FlickrIE(InfoExtractor):
formats = []
for stream in streams['stream']:
stream_type = compat_str(stream.get('type'))
stream_type = str(stream.get('type'))
formats.append({
'format_id': stream_type,
'url': stream['_content'],