'Turn the encrypted s field into a working signature'

def _decrypt_signature(self, s, video_id, player_url, age_gate=False):

    if (player_url is None):
        raise ExtractorError(u'Cannot    decrypt    signature    without    player_url')
    if player_url.startswith(u'//'):
        player_url = (u'https:' + player_url)
    elif (not re.match(u'https?://', player_url)):
        player_url = compat_urlparse.urljoin(u'https://www.youtube.com', player_url)
    try:
        player_id = (player_url, self._signature_cache_id(s))
        if (player_id not in self._player_cache):
            func = self._extract_signature_function(video_id, player_url, s)
            self._player_cache[player_id] = func
        func = self._player_cache[player_id]
        if self._downloader.params.get(u'youtube_print_sig_code'):
            self._print_sig_code(func, s)
        return func(s)
    except Exception as e:
        tb = traceback.format_exc()
        raise ExtractorError((u'Signature    extraction    failed:    ' + tb), cause=e)
