2013-03-21, 01:31
(2013-03-21, 01:16)quaternio Wrote:(2013-03-21, 00:48)Kaylakaze Wrote: Fixed it. from line 299 in YouTubePlayer, change
[...]
sorry that the indents are not properly aligned in the code pasting
This demonstrates why whenever you're scraping a web page, it's dangerous to assume where on the page something will be located. Youtube changed their page format so that ytplayer.config is no longer at the beginning of a line.
Tried to replace those lines with what you provided, but doing so breaks the plugin for me. But I know next to nothing about scripting. I suppose I should just wait until somebody compiles a zip file with the fix that I can install, rather than tamper with it myself. Thanks though.
I have a feeling you pasted it directly (he did say it didn't indent right). Also at least for me it was from lines 298 to 306 that needed to be replaced.
here is how it worked for me:
Code:
for line in data.split("\n"):
index = line.find("ytplayer.config =")
if index != -1:
found = True
p1 = line.find("=", (index-3))
p2 = line.rfind(";")
if p1 <= 0 or p2 <= 0:
continue
data = line[p1 + 1:p2]
break