From 257fd1c5bb6f66a2b84bd7564984205b26d71c17 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Fri, 22 Mar 2013 06:42:18 +1100 Subject: [PATCH] support new JS variable name --- youtube.cgi | 5 +++++ 1 file changed, 5 insertions(+) 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: -- 2.39.2