XBMC Community Forum
[RELEASE] Amazon Prime Instant Video plug-in addon - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Add-ons Help and Support (/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] Amazon Prime Instant Video plug-in addon (/showthread.php?tid=108124)



My library Movie not loading - sammy410 - 2011-11-18 00:34

The only piece that doesn't work for me is the Movie list in my library. I get an error message saying script error. The TV list updates without a problem.


- Buddha001 - 2011-11-18 07:47

Hi there - just starting out w/XBMC on an HTPC running Mythbuntu 11.10. I installed the latest version of the plugin and rtmp, but I get a script error. Turned debugging on and in the log file, I see the following (plus a traceback not included here):

Quote:21:16:13 T:140098935703296 M:3030024192 ERROR: Error Type: urllib2.URLError
21:16:13 T:140098935703296 M:3030024192 ERROR: Error Contents: <urlopen error unknown url type: https>

It looks like the error stems from mechanize. The version is 0.2.5. Ubuntu 11.10 has python 2.7 by default - not sure if this causes any issues or not - and OpenSSL 1.0. Any ideas on how to fix this?

TIA


- BlueCop - 2011-11-18 19:04

Buddha001: I have seen the problem. I haven't been able to debug it. I don't know exactly where the problem is. I don't think it is specifically mechanize. It seems to be any ssl connection. I have seen the same problems with hulu servers.

restarting xbmc always fixed the issue for me. I need to submit a bug report for it.


- Buddha001 - 2011-11-18 19:35

BlueCop Wrote:Buddha001: I have seen the problem. I haven't been able to debug it. I don't know exactly where the problem is. I don't think it is specifically mechanize. It seems to be any ssl connection. I have seen the same problems with hulu servers.

restarting xbmc always fixed the issue for me. I need to submit a bug report for it.

Restarting doesn't seem to help, but I did upgrade to an unstable XBMC 11.0 (Eden) repository and that helps a bit. Now I can at least browse through videos although trying to stream them still results in an error. I haven't gotten a chance to browse through the logs to see what the error is yet, that's for this weekend. I'll post back once I look into it a bit more. Anyone else running the plugin on Eden? Any issues? I'd like to help test in Eden. Also, the Hulu plugin works for me out of the box w/Eden.


- downhiller2010 - 2011-11-19 01:44

Buddha001 Wrote:Restarting doesn't seem to help, but I did upgrade to an unstable XBMC 11.0 (Eden) repository and that helps a bit. Now I can at least browse through videos although trying to stream them still results in an error. I haven't gotten a chance to browse through the logs to see what the error is yet, that's for this weekend. I'll post back once I look into it a bit more. Anyone else running the plugin on Eden? Any issues? I'd like to help test in Eden. Also, the Hulu plugin works for me out of the box w/Eden.

I am using on eden as well. I can browse just find, but no playback


- Buddha001 - 2011-11-19 23:29

downhiller2010 Wrote:I am using on eden as well. I can browse just find, but no playback

Well, I realized that my wife was the primary member so I changed login info and restarted. Most videos/shows stream just fine, but others give an error. Something about no issuable right for the user... Not sure if those ones cost something and they're not free or what the problem is.


- jason_m - 2011-11-20 05:02

Buddha001 Wrote:Hi there - just starting out w/XBMC on an HTPC running Mythbuntu 11.10. I installed the latest version of the plugin and rtmp, but I get a script error. Turned debugging on and in the log file, I see the following (plus a traceback not included here):



It looks like the error stems from mechanize. The version is 0.2.5. Ubuntu 11.10 has python 2.7 by default - not sure if this causes any issues or not - and OpenSSL 1.0. Any ideas on how to fix this?

TIA

I have run into the same thing.
Mythbuntu 11.10
XBMC 2:10.1-4~ppa1~oneiric from the Nathan Renniewaldock repository
Amazon plugin version 0.3.7
beautifulsoup module version 3.0.8
demjson module version 1.4
mechanize module version 0.2.5

BlueCop Wrote:Buddha001: I have seen the problem. I haven't been able to debug it. I don't know exactly where the problem is. I don't think it is specifically mechanize. It seems to be any ssl connection. I have seen the same problems with hulu servers.

restarting xbmc always fixed the issue for me. I need to submit a bug report for it.

Restarting makes no difference for me.

Buddha001 Wrote:Well, I realized that my wifewas the primary member so I changed login info and restarted. Most videos/shows stream just fine, but others give an error. Something about no issuable right for the user... Not sure if those ones cost something and they're not free or what the problem is.

Changing your login information got around the issue? Is that all you changed?

I also have an ubuntu 10.10 machine with the same version of xbmc and plugins. I do not have this problem on that machine. After installing rtmp2.4, the Amazon plugin works great!

I would love to get the Amazon plugin working on my 11.10 machine because that is the one hooked up to my TV Smile

If there is any additional information about my system I can provide to track down the problem, I would be happy to.


- jason_m - 2011-11-20 05:22

A full call stack is here:
http://pastebin.com/41FQrut3

It looks like the url request that triggers it is http://www.amazon.com/gp/flex/sign-out.html

It isn't clear to me where an https error is even coming from.

EDIT:
I was playing around in python. The url above gets redirected to an https url

Code:
$ python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> response = urllib2.urlopen("http://www.amazon.com/gp/flex/sign-out.html")
>>> print response.geturl()
https://www.amazon.com/gp/sign-in.html?ie=UTF8&email=&disableCorpSignUp=&path=&redirectProtocol=&mode=&useRedirectOnSuccess=0&query=%2Aentries%2A%3D0%26%2AVersion%2A%3D1&accountStatusPolicy=&pageAction=
>>>

See http://docs.python.org/library/urllib2.html for more on urlopen().

This is on the machine which generates the https error.


- jason_m - 2011-11-20 09:40

I don't know if this helps at all or not, but I saw that in the mechanize library there were feature tests for https:

Code:
if hasattr(httplib, 'HTTPS'):

These feature tests guard against adding https support when it is not in fact supported. I added some debug output to the amazon plugin to see which url handlers the browser had:
Code:
def mechanizeLogin():
    if os.path.isfile(COOKIEFILE):
        os.remove(COOKIEFILE)
    cj = cookielib.LWPCookieJar()
    br = mechanize.Browser()
    print 'HANDLER CLASSES:' # ZMG I ADDED THIS IN HERE
    print br.handler_classes     # ZMG I ADDED THIS IN HERE

As you would expect, there was no https handler.

I replaced the https feature tests in mechanize with "if True":
Code:
~/.xbmc/addons/script.module.mechanize/lib/mechanize$ grep "hasattr(httplib, 'HTTPS')" *
_opener.py:    if True: #hasattr(httplib, 'HTTPS'):
_urllib2_fork.py:    if True: #hasattr(httplib, 'HTTPS'):
_urllib2_fork.py:if True: #hasattr(httplib, 'HTTPS'):
_urllib2.py:if True: #hasattr(httplib, 'HTTPS'):

Now I have an https handler, but hit on a different, but related error saying socket does not have a member named ssl.
http://pastebin.com/kZSts3HV

This is lies.
Code:
$ python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.ssl
<function ssl at 0xf23b18>
>>> import httplib
>>> hasattr(httplib, 'HTTPS')
True

My system seems to have perfect support for ssl/https. I see in the log file above that the call stack is in a python2.4.zip folder. So is the problem that xbmc shipped with a python library that doesn't support ssl? That might explain how some folks were able to get around the issue by trying a recent build of xbmc. However, it doesn't explain why xbmc from the same repository on my ubuntu 10.10 computer doesn't suffer from this problem.


- jason_m - 2011-11-20 18:51

Sorry for so many posts in a short amount of time. I'm really just getting familiar with both xbmc and python, so I'm learning things pretty rapidly.

I misspoke when I said both of my computers were using the same xbmc repository. My ubuntu 10.10 machine, where the Amazon plugin works just fine is using the repository at:
http://ppa.launchpad.net/team-xbmc/ppa/ubuntu maverick

I added the following two lines of diagnostic output when the amazon plugin fires up:
Code:
print 'BUILT IN MODULES: ' + str(sys.builtin_module_names)
    print 'OTHER LOADED MODULES: ' + str(sys.modules.keys())

The builtin modules of xbmc's python are the same in both installations. _ssl appears in the other loaded modules for the ubuntu 10.10 maverick machine, but not on the 11.10 oneiric machine. This seems to be the root of the issue.