Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Amazon Prime Instant Video

jk0jk0 Channel DeveloperPosts: 105Members, Plex Pass Plex Pass
edited February 2014 in Channel Development

Hello!

I started rewriting the Amazon Prime Instant Video plugin earlier this week and it's now ready for some heavy testing. Currently it supports playing videos in your Video Library as well as searching & browsing "Prime Eligible" Movies and TV. Give it a try and let me know what you think. Bug reports with log files are always appreciated.

You can download the plugin here (until we get it into the store): [removed]

I want to give a big thanks mikedm139 for providing most of the RMTP code. Without that, this wouldn't work on anything but OS X/iOS. smile.gif

«13456715

Comments

  • ATLChrisATLChris Posts: 90Members, Plex Pass Plex Pass
    This is great. Thank you for taking on the development of this plugin.

    I will try to provide some feedback and log files soon.
  • ATLChrisATLChris Posts: 90Members, Plex Pass Plex Pass
    edited February 2014

    jk0 wrote on September 21 2012, 1:28 AM: »

    Hello!

    I started rewriting the Amazon Prime Instant Video plugin earlier this week and it's now ready for some heavy testing. Currently it supports playing videos in your Video Library as well as searching & browsing "Prime Eligible" Movies and TV. Give it a try and let me know what you think. Bug reports with log files are always appreciated.

    You can download the plugin here (until we get it into the store): [removed]

    I want to give a big thanks mikedm139 for providing most of the RMTP code. Without that, this wouldn't work on anything but OS X/iOS. smile.gif


    Can you describe to me which log files to include and where I can find the logs. Thanks again!
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    ATLChris wrote:

    Can you describe to me which log files to include and where I can find the logs. Thanks again!


    ~/Library/Logs/Plex Media Server.log and ~/Library/Logs/PMS Plugin Logs/com.plexapp.plugins.amazonprime.log
  • mikeservmikeserv Posts: 1Members
    Well, I installed your plugin on my Plex Media Server running on Win7 x64 w/ 8gbs RAM and a 6-core AMD. I didn't realize at first that you meant I could only browse the library so I tried playing files. I don't currently have anything in my Video Library so I cannot test that, but I do have some things in my Watchlist.

    Thanks for all of your effort on this. I just really wanna show my kid Sesame Street.

    -Mike

    P.S. Logs attached.
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    mikeserv wrote:

    Well, I installed your plugin on my Plex Media Server running on Win7 x64 w/ 8gbs RAM and a 6-core AMD. I didn't realize at first that you meant I could only browse the library so I tried playing files. I don't currently have anything in my Video Library so I cannot test that, but I do have some things in my Watchlist.

    Thanks for all of your effort on this. I just really wanna show my kid Sesame Street.

    -Mike

    P.S. Logs attached.


    Thanks for the feedback. I'll have a look at your logs now -- I'm interested to see how this runs on Windows since I only have access to OS X. I do intend to add support for the Watchlist quite soon here (as soon as I get pagination support added since it touches all sections).
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    edited February 2014

    Quite a few updates and bug fixes have gone into the plugin over the last few days. I strongly recommend everyone upgrade to the latest, which, as always, can be downloaded from here:

    [removed]

    Watchlist has been added along with pagination, so I think you'll find that your overall browsing and searching experience will be much better.

  • ATLChrisATLChris Posts: 90Members, Plex Pass Plex Pass
    I love the support for "Watchlist". Great job!

    Is there anyway to add Watched/Unwatched support to Amazon Prime Videos?

    I am still unable to actually play any videos. (logs attached)
  • mmccurdymmccurdy The Official Mike M Posts: 838Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee
    edited February 2014

    jk0 wrote on September 21 2012, 1:28 AM: »

    Hello!

    I started rewriting the Amazon Prime Instant Video plugin earlier this week and it's now ready for some heavy testing. Currently it supports playing videos in your Video Library as well as searching & browsing "Prime Eligible" Movies and TV. Give it a try and let me know what you think. Bug reports with log files are always appreciated.

    You can download the plugin here (until we get it into the store): [removed]

    I want to give a big thanks mikedm139 for providing most of the RMTP code. Without that, this wouldn't work on anything but OS X/iOS. smile.gif


    Hey... I left a couple comments for you in chat, but unless you scrolled back I'm assuming you may have missed them wink.gif

    In any case, awesome work so far. Since I've been testing this for the past few days, I'm consistently having the problem that it will play about 60 seconds of video, then it will stop, cleanly, with no errors or anything in the log to speak of. It seems to be able to play 60 +/- 2 second chunks at a time. I can resume the video where it left off even if it was not at the beginning, but again it will only play 60 seconds of video. Same story for both "owned" and regular on demand content.

    I'm getting handshake errors when I try to debug these streams with rtmpdump, not sure if you're doing something special there or how you're going about it. Sorry I don't have any more constructive info at this time except for describing the problem I'm seeing. Here's the tail of my plugin log where I am able to successfully play a video for about 60 seconds in case you can see something in there that I can't:

    2012-09-22 22:35:43,331 (-4f9e9000) : DEBUG (runtime:654) - Handling request GET /video/amazonprime/tvseason?verify_ownership=False&season_thumb_url=http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F51LHmCABQ0L._AA160_.jpg&season_url=https%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB006VA57CY
    2012-09-22 22:35:43,332 (-4f9e9000) : DEBUG (runtime:750) - Found route matching /video/amazonprime/tvseason
    2012-09-22 22:35:43,333 (-4f9e9000) : DEBUG (networking:160) - Requesting 'https://www.amazon.com/gp/product/B006VA57CY'
    2012-09-22 22:35:45,619 (-4f9e9000) : WARNING (objectkit:176) - The 'platforms' attribute is deprecated and should not be assigned.
    2012-09-22 22:35:45,619 (-4f9e9000) : WARNING (objectkit:176) - The 'protocols' attribute is deprecated and should not be assigned.
    2012-09-22 22:35:45,627 (-4f9e9000) : WARNING (objectkit:176) - Media part has no streams - attempting to synthesize
    2012-09-22 22:35:45,633 (-4f9e9000) : DEBUG (runtime:843) - Response: [200] MediaContainer, 13164 bytes
    2012-09-22 22:35:48,058 (-4faed000) : DEBUG (runtime:654) - Handling request GET /video/amazonprime/playvideo?url=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fvideo%2Fstreaming%2Fmini-mode.html%3Fasin%3DB006VA57CY&indirect=1&mediaInfo=%7B%22audio_channels%22%3A%20null%2C%20%22protocol%22%3A%20null%2C%20%22optimized_for_streaming%22%3A%20null%2C%20%22video_frame_rate%22%3A%20null%2C%20%22duration%22%3A%20null%2C%20%22height%22%3A%20null%2C%20%22width%22%3A%20null%2C%20%22container%22%3A%20null%2C%20%22audio_codec%22%3A%20null%2C%20%22aspect_ratio%22%3A%20null%2C%20%22video_codec%22%3A%20null%2C%20%22video_resolution%22%3A%20null%2C%20%22bitrate%22%3A%20null%7D
    2012-09-22 22:35:48,059 (-4faed000) : DEBUG (runtime:750) - Found route matching /video/amazonprime/playvideo
    2012-09-22 22:35:48,060 (-4faed000) : DEBUG (networking:160) - Requesting 'http://www.amazon.com/gp/video/streaming/mini-mode.html?asin=B006VA57CY'
    2012-09-22 22:35:48,613 (-4faed000) : DEBUG (networking:160) - Requesting 'https://atv-ps.amazon.com/cdp/catalog/GetStreamingUrlSets?format=json&version=1&asin=B006VA57CY&deviceTypeID=A13Q6A55DBZB7M&xws-fa-ov=false&token=0e1bf1ade178653565a33027cd7eafb1&firmware=WIN 10,0,181,14 PlugIn&customerID=A1LRNZCVQJRHDP&deviceID=A1LRNZCVQJRHDP1348378548613B006VA57CY'
    2012-09-22 22:35:49,503 (-4faed000) : DEBUG (objectkit:647) - Checking for Real RTMP support... Enabled:True Platform:MacOSX Product:None Client:0.9.5.4-f067f15 Server:0.9.6.9.240-8fd9c6a
    2012-09-22 22:35:49,504 (-4faed000) : DEBUG (objectkit:666) - Using Real RTMP
    2012-09-22 22:35:49,505 (-4faed000) : DEBUG (runtime:843) - Response: [200] MediaContainer, 847 bytes
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    ATLChris wrote:

    I love the support for "Watchlist". Great job!

    Is there anyway to add Watched/Unwatched support to Amazon Prime Videos?

    I am still unable to actually play any videos. (logs attached)


    Hey Chris,

    I think that's definitely a possibility. Once I get the basics running smoothly I'll start adding features like that. My goal is to be able to do everything from within the plugin. :)

    I uploaded another fix just now that may address the playback issues -- would you mind updating and trying again?

    mmccurdy wrote:

    Hey... I left a couple comments for you in chat, but unless you scrolled back I'm assuming you may have missed them ;)

    In any case, awesome work so far. Since I've been testing this for the past few days, I'm consistently having the problem that it will play about 60 seconds of video, then it will stop, cleanly, with no errors or anything in the log to speak of. It seems to be able to play 60 +/- 2 second chunks at a time. I can resume the video where it left off even if it was not at the beginning, but again it will only play 60 seconds of video. Same story for both "owned" and regular on demand content.

    I'm getting handshake errors when I try to debug these streams with rtmpdump, not sure if you're doing something special there or how you're going about it. Sorry I don't have any more constructive info at this time except for describing the problem I'm seeing. Here's the tail of my plugin log where I am able to successfully play a video for about 60 seconds in case you can see something in there that I can't:

    2012-09-22 22:35:43,331 (-4f9e9000) :  DEBUG (runtime:654) - Handling request GET /video/amazonprime/tvseason?verify_ownership=False&season_thumb_url=http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F51LHmCABQ0L._AA160_.jpg&season_url=https%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB006VA57CY
    2012-09-22 22:35:43,332 (-4f9e9000) :  DEBUG (runtime:750) - Found route matching /video/amazonprime/tvseason
    2012-09-22 22:35:43,333 (-4f9e9000) :  DEBUG (networking:160) - Requesting 'https://www.amazon.com/gp/product/B006VA57CY'
    2012-09-22 22:35:45,619 (-4f9e9000) :  WARNING (objectkit:176) - The 'platforms' attribute is deprecated and should not be assigned.
    2012-09-22 22:35:45,619 (-4f9e9000) :  WARNING (objectkit:176) - The 'protocols' attribute is deprecated and should not be assigned.
    2012-09-22 22:35:45,627 (-4f9e9000) :  WARNING (objectkit:176) - Media part has no streams - attempting to synthesize
    2012-09-22 22:35:45,633 (-4f9e9000) :  DEBUG (runtime:843) - Response: [200] MediaContainer, 13164 bytes
    2012-09-22 22:35:48,058 (-4faed000) :  DEBUG (runtime:654) - Handling request GET /video/amazonprime/playvideo?url=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fvideo%2Fstreaming%2Fmini-mode.html%3Fasin%3DB006VA57CY&indirect=1&mediaInfo=%7B%22audio_channels%22%3A%20null%2C%20%22protocol%22%3A%20null%2C%20%22optimized_for_streaming%22%3A%20null%2C%20%22video_frame_rate%22%3A%20null%2C%20%22duration%22%3A%20null%2C%20%22height%22%3A%20null%2C%20%22width%22%3A%20null%2C%20%22container%22%3A%20null%2C%20%22audio_codec%22%3A%20null%2C%20%22aspect_ratio%22%3A%20null%2C%20%22video_codec%22%3A%20null%2C%20%22video_resolution%22%3A%20null%2C%20%22bitrate%22%3A%20null%7D
    2012-09-22 22:35:48,059 (-4faed000) :  DEBUG (runtime:750) - Found route matching /video/amazonprime/playvideo
    2012-09-22 22:35:48,060 (-4faed000) :  DEBUG (networking:160) - Requesting 'http://www.amazon.com/gp/video/streaming/mini-mode.html?asin=B006VA57CY'
    2012-09-22 22:35:48,613 (-4faed000) :  DEBUG (networking:160) - Requesting 'https://atv-ps.amazon.com/cdp/catalog/GetStreamingUrlSets?format=json&version=1&asin=B006VA57CY&deviceTypeID=A13Q6A55DBZB7M&xws-fa-ov=false&token=0e1bf1ade178653565a33027cd7eafb1&firmware=WIN 10,0,181,14 PlugIn&customerID=A1LRNZCVQJRHDP&deviceID=A1LRNZCVQJRHDP1348378548613B006VA57CY'
    2012-09-22 22:35:49,503 (-4faed000) :  DEBUG (objectkit:647) - Checking for Real RTMP support...  Enabled:True  Platform:MacOSX  Product:None  Client:0.9.5.4-f067f15  Server:0.9.6.9.240-8fd9c6a
    2012-09-22 22:35:49,504 (-4faed000) :  DEBUG (objectkit:666) - Using Real RTMP
    2012-09-22 22:35:49,505 (-4faed000) :  DEBUG (runtime:843) - Response: [200] MediaContainer, 847 bytes
    



    Thanks for the heads up on this -- I hadn't discovered it because I never actually watched anything long enough yet to notice. :) I just pushed up a fix that should take care of this. Would you mind updating and having another go?
  • ATLChrisATLChris Posts: 90Members, Plex Pass Plex Pass
    I am still unable to play any videos. I get an "Error While Opening File" message.

    My logs are attached.

    Also, just one side note. The service is actually called Amazon Instant Video, not Amazon Prime. Amazon Prime is part of the service, but it might confuse some users thinking it is only for Prime members. (http://www.amazon.com/gp/feature.html?ie=UTF8&*Version*=1&*entries*=0&docId=1000663511)

    Thanks again for taking this on!
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    edited September 2012
    ATLChris wrote:

    I am still unable to play any videos. I get an "Error While Opening File" message.

    My logs are attached.

    Also, just one side note. The service is actually called Amazon Instant Video, not Amazon Prime. Amazon Prime is part of the service, but it might confuse some users thinking it is only for Prime members. (http://www.amazon.com/gp/feature.html?ie=UTF8&*Version*=1&*entries*=0&docId=1000663511)

    Thanks again for taking this on!


    Ah yes, I've been getting that exception randomly as well. It means that Amazon isn't returning any URLs to the video stream. More often than not it's the result of a server 500 error on their end. I find that it goes away and "just works" from time to time. This is the only major issue I am aware of at the moment now that we've fixed a HTML parsing bug (you'll want to pull source again just to be safe), so now I'll focus on getting this sorted out.

    I'm curious if any XBMC users have seen this?

    EDIT: I also fixed the service name per your suggestion, and added a pretty new default icon. I'm hesitant to rename the plugin. I will see if that's possible without causing too much trouble.

    EDIT #2: I've renamed the plugin entirely.
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    edited February 2014

    As ATLChris pointed out, Amazon Prime was an incorrect name for this plugin, so I decided that while we're still fairly early in the game, it should be renamed while it still can. I've renamed the repo and plugin appropriately. If you are using GitHub to update the plugin, you'll want to manually rename the directly to AmazonInstantVideo.bundle, then edit the ./.git/config and update the remote to point to the renamed repo (AmazonInstantVideo.bundle.git).

    I apologize if this causes any headaches -- let me know if you need assistance renaming your existing repo.

    [removed]

  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    Chris, I haven't seen that exception thrown since the latest HTML parsing bug was fixed. Now that I think about it, it could have very well been the cause of the issue. Looking forward to hearing back about how it goes for you.
  • ATLChrisATLChris Posts: 90Members, Plex Pass Plex Pass
    edited September 2012
    Just tested 4 different TV episodes and none of them opened for me, same error as last time. Logs are attached.

    Thanks for changing the name. Love the new icon! I have attached (http://cloud.atlchris.com/amazon.png) a high res version of the icon that is square. The round icon looks awkward with the square border.

    Great job so far with the plugin!
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    ATLChris wrote:

    Just tested 4 different TV episodes and none of them opened for me, same error as last time. Logs are attached.

    Thanks for changing the name. Love the new icon! I have attached (http://cloud.atlchris.com/amazon.png) a high res version of the icon that is square. The round icon looks awkward with the square border.

    Great job so far with the plugin!


    Just out of curiosity, are you trying this from a Prime account? You will need that in order to view these movies, unless they were already purchased and in your Library.
  • ATLChrisATLChris Posts: 90Members, Plex Pass Plex Pass
    jk0 wrote:

    Just out of curiosity, are you trying this from a Prime account? You will need that in order to view these movies, unless they were already purchased and in your Library.


    Yes, I am using a Prime enabled account. I just tested with both a Prime tv show and a purchased tv show and neither played for me.

    I also tested on my living room Media Center (Mac Mini) and it played fine. Could it be something todo with the computer I am testing on (Early 2011 Macbook Pro 15" w/ SSD)?
  • mmccurdymmccurdy The Official Mike M Posts: 838Members, Plex Employee, Plex Pass, Plex Ninja Plex Employee
    ATLChris wrote:

    Yes, I am using a Prime enabled account. I just tested with both a Prime tv show and a purchased tv show and neither played for me.

    I also tested on my living room Media Center (Mac Mini) and it played fine. Could it be something todo with the computer I am testing on (Early 2011 Macbook Pro 15" w/ SSD)?


    Well there goes that theory :)

    I issued the exact request that it's choking on in your log, and it came back with a properly structured response (including the 'urlSets' that your log is complaining about). Given this, and the fact that it's working with your exact account on a different machine, I'd want to rule out a cacheing issue of some kind.

    Can you close PMS and Plex, then get rid of the following directories and file, then try again (you'll have to re-enter your password and re-start the plugin when you fire it back up):

    ~/Library/Application Support/Plex Media Server/Plug-in Support/Caches/com.plexapp.plugins.amazoninstantvideo
    ~/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.plugins.amazoninstantvideo
    ~/Library/Application Support/Plex Media Server/Plug-in Support/Preferences/com.plexapp.plugins.amazoninstantvideo.xml
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    ATLChris, I just pushed up another fix for a bug that was discovered using the iOS client. This could have also potentially cause the issue you are seeing. Would you mind testing?
  • hokiehokie Posts: 5Members
    jk0 wrote:

    ATLChris, I just pushed up another fix for a bug that was discovered using the iOS client. This could have also potentially cause the issue you are seeing. Would you mind testing?


    Thanks for taking the time to develop this! I'm trying it out and getting the 'Error while opening file' message when trying to play movies/tv shows.
  • jk0jk0 Channel Developer Posts: 105Members, Plex Pass Plex Pass
    hokie wrote:

    Thanks for taking the time to develop this! I'm trying it out and getting the 'Error while opening file' message when trying to play movies/tv shows.

    Would you mind posting your logs so I can have a look?
«13456715
This discussion has been closed.