2013-03-21, 00:48
Fixed it. from line 299 in YouTubePlayer, change
to
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.
Code:
if line.strip().startswith("yt.playerConfig = "):
found = True
p1 = line.find("=")
p2 = line.rfind(";")
if p1 <= 0 or p2 <= 0:
continue
data = line[p1 + 1:p2]
break
to
Code:
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
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.