1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +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

@ -28,10 +28,10 @@ class SampleFocusIE(InfoExtractor):
},
}, {
'url': 'https://samplefocus.com/samples/dababy-style-bass-808',
'only_matching': True
'only_matching': True,
}, {
'url': 'https://samplefocus.com/samples/young-chop-kick',
'only_matching': True
'only_matching': True,
}]
def _real_extract(self, url):
@ -76,7 +76,7 @@ class SampleFocusIE(InfoExtractor):
def extract_count(klass):
return int_or_none(self._html_search_regex(
r'<span[^>]+class=(?:["\'])?%s-count[^>]*>(\d+)' % klass,
rf'<span[^>]+class=(?:["\'])?{klass}-count[^>]*>(\d+)',
webpage, klass, fatal=False))
return {
@ -90,7 +90,7 @@ class SampleFocusIE(InfoExtractor):
r'<a[^>]+href=(["\'])/license\1[^>]*>(?P<license>[^<]+)<',
webpage, 'license', fatal=False, group='license'),
'uploader_id': uploader_id,
'like_count': extract_count('sample-%s-favorites' % sample_id),
'like_count': extract_count(f'sample-{sample_id}-favorites'),
'comment_count': extract_count('comments'),
'comments': comments,
'categories': categories,