Thread Rating:
  • 0 Vote(s) - 0 Average
[RELEASE] The Escapist (Video) Plugin
#61
Doesn't seem to be doing well. Just 14 positive and an equal number of negative votes.
I don't think this is going to change anything.

What about the alternative mentioned earlier in the thread?

Floppie Wrote:Just heard back today. He explained to me how the Flash player (and the Boxee plugin) are retrieving ad info from the ad server. When I'm done work I'll do some packet sniffing to figure out if that will be feasible for me to do entirely in Pythonland - apparently the Boxee plugin is literally opening the page in a browser and expanding the Flash player to fullscreen. Needless to say that's lame and I'm not doing it that way if I can avoid it; I'm confident I can.

He did say that, if there's no easy way for me to handle it all in Pythonland, he'd put me in contact with the advertiser. There's a decent chance they'd be willing to put some code together to make this happen.
Reply
#62
I've got a slightly hacky fix for this plugin.

As has already been deduced, your IP address gets blocked from downloading the video config data from theescapist (even directly in a browser). However, I noticed that Plex has an Escapist plugin that works, so I had a look at how they had got around it, and figured it out. They basically use surf-proxy.de as a proxy to get the config file, which then points to an accessible URL for the videos.

I "ported" the Plex code over to the XBMC plugin and it seems to work fine. Although, I'm not sure how much I'd recommend this fix, since it needs a proxy to work (which I never like to do), but it does work so feel free to use it.

To fix the plugin:

Open default.py from the %appdata%/addons/plugin.video.escapistmagazine folder.

Replace the function PLAYVIDEO with the following:

Code:
def PLAYVIDEO(url, referer):
    page = retrieveUrl(url, referer)
    config_url = re.compile('<param name="flashvars" value="config=([A-Za-z:/.\-0-9%_]+)"/>').findall(page)[0]
    jsonURL = "http://surf-proxy.de/index.php?q="+urllib.unquote(str(config_url))
    f = urllib2.urlopen(jsonURL)
    jsonObj = f.read()
    f.close()
    videoURL = re.compile("'Video Splash'},{'url':'([A-Za-z:/.\-0-9%_]+)'").findall(jsonObj)[0]
    liz = xbmcgui.ListItem(name, path = videoURL)
    liz.setInfo(type = "Video", infoLabels = {"Title": name})
    liz.setProperty('isPlayable', 'true')
    xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
Reply
#63
Stormwave Wrote:I've got a slightly hacky fix for this plugin.

As has already been deduced, your IP address gets blocked from downloading the video config data from theescapist (even directly in a browser). However, I noticed that Plex has an Escapist plugin that works, so I had a look at how they had got around it, and figured it out. They basically use surf-proxy.de as a proxy to get the config file, which then points to an accessible URL for the videos.

I "ported" the Plex code over to the XBMC plugin and it seems to work fine. Although, I'm not sure how much I'd recommend this fix, since it needs a proxy to work (which I never like to do), but it does work so feel free to use it.

To fix the plugin:

Open default.py from the %appdata%/addons/plugin.video.escapistmagazine folder.

Replace the function PLAYVIDEO with the following:

Code:
def PLAYVIDEO(url, referer):
    page = retrieveUrl(url, referer)
    config_url = re.compile('<param name="flashvars" value="config=([A-Za-z:/.\-0-9%_]+)"/>').findall(page)[0]
    jsonURL = "http://surf-proxy.de/index.php?q="+urllib.unquote(str(config_url))
    f = urllib2.urlopen(jsonURL)
    jsonObj = f.read()
    f.close()
    videoURL = re.compile("'Video Splash'},{'url':'([A-Za-z:/.\-0-9%_]+)'").findall(jsonObj)[0]
    liz = xbmcgui.ListItem(name, path = videoURL)
    liz.setInfo(type = "Video", infoLabels = {"Title": name})
    liz.setProperty('isPlayable', 'true')
    xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

I get an error when I try to actually play a video with this modified code. Browsing through lists and whatnot works fine, but the minute I try to play something it fails. Any idea why?
Reply
#64
Hmm, I'm not sure. Could be a few things (python is really picky about white-space). Try clicking on a video, wait for it to fail, then open the xbmc.log. Look at the last few lines for any hints, or copy and paste them here (only the lines timestamped since you clicked on the video).

Other than that, just make sure all your indentations for each line are the same (tabs and spaces are nt the same), as python will get upset.

If all else fails, I'll upload my default.py to make the fix easier to implement for now.
Reply
#65
Stormwave Wrote:Hmm, I'm not sure. Could be a few things (python is really picky about white-space). Try clicking on a video, wait for it to fail, then open the xbmc.log. Look at the last few lines for any hints, or copy and paste them here (only the lines timestamped since you clicked on the video).

Other than that, just make sure all your indentations for each line are the same (tabs and spaces are nt the same), as python will get upset.

If all else fails, I'll upload my default.py to make the fix easier to implement for now.

That appears to have been exactly it. The new code was spaced one space to the left of everything else. Man, I so much prefer other programming languages that don't get annoyed over how you indent. Thanks very much! Things are working perfectly now.
Reply
#66
Stormwave Wrote:I've got a slightly hacky fix for this plugin.

To fix the plugin:

Open default.py from the %appdata%/addons/plugin.video.escapistmagazine folder.

Replace the function PLAYVIDEO with the following:

Code:
def PLAYVIDEO(url, referer):
    page = retrieveUrl(url, referer)
    config_url = re.compile('<param name="flashvars" value="config=([A-Za-z:/.\-0-9%_]+)"/>').findall(page)[0]
    jsonURL = "http://surf-proxy.de/index.php?q="+urllib.unquote(str(config_url))
    f = urllib2.urlopen(jsonURL)
    jsonObj = f.read()
    f.close()
    videoURL = re.compile("'Video Splash'},{'url':'([A-Za-z:/.\-0-9%_]+)'").findall(jsonObj)[0]
    liz = xbmcgui.ListItem(name, path = videoURL)
    liz.setInfo(type = "Video", infoLabels = {"Title": name})
    liz.setProperty('isPlayable', 'true')
    xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

Absolutely outstanding share Storm!
Reply
#67
Nice work, and thanks for the fix Smile

I might include this in the official plugin, although I'm not sure how reliably we can expect it to work with the whole proxy thing. I'd really like to keep it fully white-hat and work with them to make something that's officially supported by both me and them, but if their support department doesn't want to play nice there isn't much I can do about it - I still want to watch my Internet shows.

Achilleas, to answer your question - I haven't tried contacting the advertisers directly yet, but it's on my to-do list.
Reply
#68
Stormwave Wrote:Hmm, I'm not sure. Could be a few things (python is really picky about white-space). Try clicking on a video, wait for it to fail, then open the xbmc.log. Look at the last few lines for any hints, or copy and paste them here (only the lines timestamped since you clicked on the video).

Other than that, just make sure all your indentations for each line are the same (tabs and spaces are nt the same), as python will get upset.

If all else fails, I'll upload my default.py to make the fix easier to implement for now.

Could you? I can't get this to work, I think I'm just too stupid for Python. Mirrored everything to what you have and it fails.
Reply
#69
Got 1 weeks ban from The Escapist website for using this plugin. keeps playing the ad video.
Reply
#70
Since this plugin has stopped working I've decided not to watch the escapist anymore.

Up until it broke, I was considering their premium service.. it's just not convenient anymore, so I lost interest.
Reply
#71
(2012-07-19, 01:21)Ireshine Wrote: Got 1 weeks ban from The Escapist website for using this plugin. keeps playing the ad video.

It's the reason the plugin is marked broken. Technically it works, but it gets you banned because the site doesn't like it.
Reply
#72
tried Stormwave's new def, but zero punctuation isnt listed. Lot of other content, but no ZP.
Reply



[RELEASE] The Escapist (Video) Plugin00