[cleanup] Minor fixes

Closes #5129, Closes #4982
This commit is contained in:
pukkandan
2022-10-04 01:34:04 +05:30
parent 7474e4531e
commit a057779d5e
6 changed files with 24 additions and 14 deletions

View File

@@ -1862,7 +1862,7 @@ class InfoExtractor:
alias, field = field, self._get_field_setting(field, 'field')
if self._get_field_setting(alias, 'deprecated'):
self.ydl.deprecated_feature(f'Format sorting alias {alias} is deprecated and may '
'be removed in a future version. Please use {field} instead')
f'be removed in a future version. Please use {field} instead')
reverse = match.group('reverse') is not None
closest = match.group('separator') == '~'
limit_text = match.group('limit')

View File

@@ -16,6 +16,7 @@ from ..utils import (
class SpotifyBaseIE(InfoExtractor):
_WORKING = False
_ACCESS_TOKEN = None
_OPERATION_HASHES = {
'Episode': '8276d4423d709ae9b68ec1b74cc047ba0f7479059a37820be730f125189ac2bf',

View File

@@ -390,6 +390,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
'si', 'th', 'lo', 'my', 'ka', 'am', 'km', 'zh-CN', 'zh-TW', 'zh-HK', 'ja', 'ko'
]
_IGNORED_WARNINGS = {'Unavailable videos will be hidden during playback'}
@functools.cached_property
def _preferred_lang(self):
"""
@@ -692,12 +694,11 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
yield alert_type, message
def _report_alerts(self, alerts, expected=True, fatal=True, only_once=False):
errors = []
warnings = []
errors, warnings = [], []
for alert_type, alert_message in alerts:
if alert_type.lower() == 'error' and fatal:
errors.append([alert_type, alert_message])
else:
elif alert_message not in self._IGNORED_WARNINGS:
warnings.append([alert_type, alert_message])
for alert_type, alert_message in (warnings + errors[:-1]):