1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-01 15:15:15 +00:00

[cleanup] Misc cleanup

Closes #1942 #1976 #2020 #2058 #1984
This commit is contained in:
pukkandan
2021-12-23 07:12:26 +05:30
parent e0fd95737d
commit b69fd25c25
30 changed files with 109 additions and 68 deletions

View File

@@ -340,7 +340,7 @@ class CBCGemIE(InfoExtractor):
yield {
**base_format,
'format_id': join_nonempty('sec', height),
'url': re.sub(r'(QualityLevels\()\d+(\))', fr'\<1>{bitrate}\2', base_url),
'url': re.sub(r'(QualityLevels\()\d+(\))', fr'\1{bitrate}\2', base_url),
'width': int_or_none(video_quality.attrib.get('MaxWidth')),
'tbr': bitrate / 1000.0,
'height': height,

View File

@@ -616,7 +616,7 @@ class InfoExtractor(object):
kwargs = {
'video_id': e.video_id or self.get_temp_id(url),
'ie': self.IE_NAME,
'tb': e.traceback,
'tb': e.traceback or sys.exc_info()[2],
'expected': e.expected,
'cause': e.cause
}
@@ -1574,7 +1574,7 @@ class InfoExtractor(object):
'vcodec': {'type': 'ordered', 'regex': True,
'order': ['av0?1', 'vp0?9.2', 'vp0?9', '[hx]265|he?vc?', '[hx]264|avc', 'vp0?8', 'mp4v|h263', 'theora', '', None, 'none']},
'acodec': {'type': 'ordered', 'regex': True,
'order': ['opus', 'vorbis', 'aac', 'mp?4a?', 'mp3', 'e-?a?c-?3', 'ac-?3', 'dts', '', None, 'none']},
'order': ['[af]lac', 'wav|aiff', 'opus', 'vorbis', 'aac', 'mp?4a?', 'mp3', 'e-?a?c-?3', 'ac-?3', 'dts', '', None, 'none']},
'hdr': {'type': 'ordered', 'regex': True, 'field': 'dynamic_range',
'order': ['dv', '(hdr)?12', r'(hdr)?10\+', '(hdr)?10', 'hlg', '', 'sdr', None]},
'proto': {'type': 'ordered', 'regex': True, 'field': 'protocol',

View File

@@ -41,7 +41,7 @@ class FancodeVodIE(InfoExtractor):
_ACCESS_TOKEN = None
_NETRC_MACHINE = 'fancode'
_LOGIN_HINT = 'Use "--user refresh --password <refresh_token>" to login using a refresh token'
_LOGIN_HINT = 'Use "--username refresh --password <refresh_token>" to login using a refresh token'
headers = {
'content-type': 'application/json',

View File

@@ -258,8 +258,7 @@ class PornHubIE(PornHubBaseIE):
webpage)
def _extract_count(self, pattern, webpage, name):
return str_to_int(self._search_regex(
pattern, webpage, '%s count' % name, fatal=False))
return str_to_int(self._search_regex(pattern, webpage, '%s count' % name, default=None))
def _real_extract(self, url):
mobj = self._match_valid_url(url)

View File

@@ -99,7 +99,7 @@ class RoosterTeethIE(RoosterTeethBaseIE):
'series': 'Million Dollars, But...',
'episode': 'Million Dollars, But... The Game Announcement',
},
'skip_download': 'm3u8',
'params': {'skip_download': True},
}, {
'url': 'https://roosterteeth.com/watch/rwby-bonus-25',
'info_dict': {
@@ -112,7 +112,7 @@ class RoosterTeethIE(RoosterTeethBaseIE):
'thumbnail': r're:^https?://.*\.(png|jpe?g)$',
'ext': 'mp4',
},
'skip_download': 'm3u8',
'params': {'skip_download': True},
}, {
'url': 'http://achievementhunter.roosterteeth.com/episode/off-topic-the-achievement-hunter-podcast-2016-i-didn-t-think-it-would-pass-31',
'only_matching': True,

View File

@@ -130,7 +130,7 @@ class SoundcloudBaseIE(InfoExtractor):
elif username is not None:
self.report_warning(
'Login using username and password is not currently supported. '
'Use "--user oauth --password <oauth_token>" to login using an oauth token')
'Use "--username oauth --password <oauth_token>" to login using an oauth token')
r'''
def genDevId():

View File

@@ -6,9 +6,10 @@ from ..compat import compat_str
from ..utils import (
ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
unsmuggle_url,
unified_strdate,
unsmuggle_url,
)
import itertools
@@ -25,9 +26,9 @@ class VoicyBaseIE(InfoExtractor):
'id': voice_id,
'title': compat_str(value.get('PlaylistName')),
'uploader': value.get('SpeakerName'),
'uploader_id': compat_str(value.get('SpeakerId')),
'uploader_id': str_or_none(value.get('SpeakerId')),
'channel': value.get('ChannelName'),
'channel_id': compat_str(value.get('ChannelId')),
'channel_id': str_or_none(value.get('ChannelId')),
'upload_date': upload_date,
}