1
0
Fork 0

[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
commit add96eb9f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
915 changed files with 7028 additions and 7247 deletions

View file

@ -1,7 +1,7 @@
import re
import urllib.parse
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
determine_ext,
int_or_none,
@ -13,7 +13,7 @@ class UDNEmbedIE(InfoExtractor):
IE_DESC = '聯合影音'
_PROTOCOL_RELATIVE_VALID_URL = r'//video\.udn\.com/(?:embed|play)/news/(?P<id>\d+)'
_VALID_URL = r'https?:' + _PROTOCOL_RELATIVE_VALID_URL
_EMBED_REGEX = [r'<iframe[^>]+src="(?:https?:)?(?P<url>%s)"' % _PROTOCOL_RELATIVE_VALID_URL]
_EMBED_REGEX = [rf'<iframe[^>]+src="(?:https?:)?(?P<url>{_PROTOCOL_RELATIVE_VALID_URL})"']
_TESTS = [{
'url': 'http://video.udn.com/embed/news/300040',
'info_dict': {
@ -66,8 +66,8 @@ class UDNEmbedIE(InfoExtractor):
continue
video_url = self._download_webpage(
compat_urlparse.urljoin(url, api_url), video_id,
note='retrieve url for %s video' % video_type)
urllib.parse.urljoin(url, api_url), video_id,
note=f'retrieve url for {video_type} video')
ext = determine_ext(video_url)
if ext == 'm3u8':