From: James Bunton Date: Thu, 21 Mar 2013 19:42:18 +0000 (+1100) Subject: support new JS variable name X-Git-Url: https://code.delx.au/youtube-cgi/commitdiff_plain/257fd1c5bb6f66a2b84bd7564984205b26d71c17 support new JS variable name --- diff --git a/youtube.cgi b/youtube.cgi index fed997a..2d3fcee 100755 --- a/youtube.cgi +++ b/youtube.cgi @@ -133,6 +133,11 @@ def get_player_config(doc): p2 = line.rfind(";") if p1 >= 0 and p2 > 0: return json.loads(line[p1+1:p2]) + if "ytplayer.config =" in line: + p1 = line.find("ytplayer.config =") + p2 = line.rfind(";") + if p1 >= 0 and p2 > 0: + return json.loads(line[p1+18:p2]) if "'PLAYER_CONFIG': " in line: p1 = line.find(":") if p1 >= 0: