Include length in player cache ID

Some videos use the same player with IDs of multiple lengths.
See https://travis-ci.org/rg3/youtube-dl/jobs/12126506#L319 for an example.
This commit is contained in:
Philipp Hagemeister 2013-10-04 11:36:04 +02:00
parent 466880f531
commit 7f8ae73a5d
1 changed files with 4 additions and 3 deletions

View File

@ -1037,12 +1037,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
if player_url is not None: if player_url is not None:
try: try:
if player_url not in self._player_cache: player_id = (player_url, len(s))
if player_id not in self._player_cache:
func = self._extract_signature_function( func = self._extract_signature_function(
video_id, player_url, len(s) video_id, player_url, len(s)
) )
self._player_cache[player_url] = func self._player_cache[player_id] = func
func = self._player_cache[player_url] func = self._player_cache[player_id]
if self._downloader.params.get('youtube_print_sig_code'): if self._downloader.params.get('youtube_print_sig_code'):
self._print_sig_code(func, len(s)) self._print_sig_code(func, len(s))
return func(s) return func(s)