[ie/youtube] Invalidate JS function cache

Authored by: bashonly
pull/12761/head
bashonly 1 month ago
parent e147473ac4
commit f96b1582d3
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0

@ -1995,7 +1995,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
res = self._parse_sig_js(code, player_url) res = self._parse_sig_js(code, player_url)
test_string = ''.join(map(chr, range(len(example_sig)))) test_string = ''.join(map(chr, range(len(example_sig))))
cache_spec = [ord(c) for c in res(test_string)] cache_spec = [ord(c) for c in res(test_string)]
self.cache.store('youtube-sigfuncs', func_id, cache_spec) self.cache.store('youtube-sigfuncs', func_id, cache_spec, min_ver='2025.03.27')
return lambda s: ''.join(s[i] for i in cache_spec) return lambda s: ''.join(s[i] for i in cache_spec)
@ -2091,7 +2091,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if func_code := self._player_cache.get(cache_id): if func_code := self._player_cache.get(cache_id):
return func_code return func_code
func_code = self.cache.load('youtube-nsig', player_id, min_ver='2025.03.26') func_code = self.cache.load('youtube-nsig', player_id, min_ver='2025.03.27')
if func_code: if func_code:
self._player_cache[cache_id] = func_code self._player_cache[cache_id] = func_code

Loading…
Cancel
Save