Skip to content

Commit

Permalink
YouTubeVideoUrl: fix JS player extraction again, thx Dominika
Browse files Browse the repository at this point in the history
  • Loading branch information
Taapat committed Nov 2, 2020
1 parent 3c2cb70 commit f1b7690
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/YouTubeVideoUrl.py
Expand Up @@ -447,7 +447,10 @@ def extract_player_response(player_response):

if url_map['cipher']:
if 's' in url_map['url_data']:
ASSETS_RE = r'(?:"assets":.+?"js":\s*("[^"]+"))|(?:"jsUrl":\s*("[^"]+"))'
ASSETS_RE = (
r'<script[^>]+\bsrc=("[^"]+")[^>]+\bname=["\']player_ias/base',
r'"jsUrl"\s*:\s*("[^"]+")',
r'"assets":.+?"js":\s*("[^"]+")')
jsplayer_url_json = self._search_regex(ASSETS_RE,
embed_webpage if age_gate else video_webpage)
if not jsplayer_url_json and not age_gate:
Expand Down

0 comments on commit f1b7690

Please sign in to comment.