]> code.delx.au - youtube-cgi/commitdiff
support new JS variable name
authorJames Bunton <jamesbunton@delx.net.au>
Thu, 21 Mar 2013 19:42:18 +0000 (06:42 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Thu, 21 Mar 2013 19:42:18 +0000 (06:42 +1100)
youtube.cgi

index fed997a42a2c20e42c11b740b5f1c4ba35065c34..2d3fcee1dd8be28b663db4baeb27ac59ca1c2cfa 100755 (executable)
@@ -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: