mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-26 12:11:07 +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,7 +1,7 @@
|
||||
import re
|
||||
import urllib.parse
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..compat import compat_urlparse
|
||||
from ..utils import (
|
||||
get_element_by_attribute,
|
||||
qualities,
|
||||
@@ -19,7 +19,7 @@ class OraTVIE(InfoExtractor):
|
||||
'ext': 'mp4',
|
||||
'title': 'Vine & YouTube Stars Zach King & King Bach On Their Viral Videos!',
|
||||
'description': 'md5:ebbc5b1424dd5dba7be7538148287ac1',
|
||||
}
|
||||
},
|
||||
}, {
|
||||
'url': 'http://www.unsafespeech.com/video/2016/5/10/student-self-censorship-and-the-thought-police-on-university-campuses-0_6622bnkppw4d',
|
||||
'only_matching': True,
|
||||
@@ -38,14 +38,14 @@ class OraTVIE(InfoExtractor):
|
||||
m3u8_url, display_id, 'mp4', 'm3u8_native',
|
||||
m3u8_id='hls', fatal=False)
|
||||
# similar to GameSpotIE
|
||||
m3u8_path = compat_urlparse.urlparse(m3u8_url).path
|
||||
m3u8_path = urllib.parse.urlparse(m3u8_url).path
|
||||
QUALITIES_RE = r'((,[a-z]+\d+)+,?)'
|
||||
available_qualities = self._search_regex(
|
||||
QUALITIES_RE, m3u8_path, 'qualities').strip(',').split(',')
|
||||
http_path = m3u8_path[1:].split('/', 1)[1]
|
||||
http_template = re.sub(QUALITIES_RE, r'%s', http_path)
|
||||
http_template = http_template.replace('.csmil/master.m3u8', '')
|
||||
http_template = compat_urlparse.urljoin(
|
||||
http_template = urllib.parse.urljoin(
|
||||
'http://videocdn-pmd.ora.tv/', http_template)
|
||||
preference = qualities(
|
||||
['mobile400', 'basic400', 'basic600', 'sd900', 'sd1200', 'sd1500', 'hd720', 'hd1080'])
|
||||
|
||||
Reference in New Issue
Block a user