[ie/youtube] Fix minor issues (#17060)

Authored by: doe1080
This commit is contained in:
doe1080 2026-06-27 07:33:21 +09:00 committed by GitHub
parent 25a05fc0e2
commit 57528faa36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -3446,7 +3446,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
self._report_pot_format_skipped(video_id, client_name, proto)
return None
name = fmt_stream.get('qualityLabel') or quality.replace('audio_quality_', '') or ''
name = fmt_stream.get('qualityLabel') or (quality or '').replace('audio_quality_', '')
fps = int_or_none(fmt_stream.get('fps')) or 0
dct = {
'asr': int_or_none(fmt_stream.get('audioSampleRate')),
@ -4372,7 +4372,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if not release_year:
release_year = release_date[:4]
info.update({
'album': mobj.group('album'.strip()),
'album': mobj.group('album').strip(),
'artists': ([a] if (a := mobj.group('clean_artist'))
else [a.strip() for a in mobj.group('artist').split(' · ')]),
'track': mobj.group('track').strip(),

View File

@ -233,8 +233,8 @@ class EJSBaseJCP(JsChallengeProvider):
self.logger.debug('Clearing outdated cached script')
self.ie.cache.store(self._CACHE_SECTION, script_type.value, None)
continue
script_hashes = self._ALLOWED_HASHES[script.type].get(script.variant, [])
if script_hashes and script.hash not in script_hashes:
expected_hash = self._ALLOWED_HASHES[script.type].get(script.variant)
if expected_hash and script.hash != expected_hash:
self.logger.warning(
f'Hash mismatch on challenge solver {script.type.value} script '
f'(source: {script.source.value}, variant: {script.variant}, hash: {script.hash})!{provider_bug_report_message(self)}')

View File

@ -278,7 +278,7 @@ def validate_nsig_challenge_output(challenge_output: NChallengeOutput, challenge
return True
def validate_sig_challenge_output(challenge_output: SigChallengeOutput, challenge_input: SigChallengeInput) -> bool:
def validate_sig_challenge_output(challenge_output: SigChallengeOutput, challenge_input: SigChallengeInput) -> bool | str:
return (
isinstance(challenge_output, SigChallengeOutput)
and len(challenge_output.results) == len(challenge_input.challenges)