Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon Prime Video available in more than 200 countries #22

Closed
iz8mbw opened this issue Dec 14, 2016 · 108 comments
Closed

Amazon Prime Video available in more than 200 countries #22

iz8mbw opened this issue Dec 14, 2016 · 108 comments

Comments

@iz8mbw
Copy link

iz8mbw commented Dec 14, 2016

Hi,
Amazon Prime Video is now available also in Italy.
Please, can you upgrade your addons to supports Amazon Prime Video for Italy?

Thanks!

@zenitraM
Copy link

Same for Spain.

@Sandmann79
Copy link
Owner

I don't see any information at amazon.it or amazon.es.

Only when it is available on the website, i can integrate it into the vod addon.

@iz8mbw
Copy link
Author

iz8mbw commented Dec 15, 2016

There is a link to https://www.primevideo.com/ on amazon.it homepage.
Scroll the main banner in home page.
See here: https://s24.postimg.org/rjtpr4hit/amazon.png

EDIT: more info here http://phx.corporate-ir.net/phoenix.zhtml?c=176060&p=irol-newsArticle&ID=2229623

@eikaf
Copy link

eikaf commented Dec 15, 2016

I'm just studing the code url's from primevideo.com and as i can see on the website it's quite similar to amazon.de. As soon as i can, i will try to test your code with it if you agree.

@Phjodor
Copy link

Phjodor commented Dec 15, 2016

Tried to install and run with my amazon account from Norway. Everything seems to work until I got stuck un the DRM problem.

@iz8mbw
Copy link
Author

iz8mbw commented Dec 15, 2016 via email

@eikaf
Copy link

eikaf commented Dec 15, 2016 via email

@iz8mbw
Copy link
Author

iz8mbw commented Dec 15, 2016

Great!!

@iz8mbw
Copy link
Author

iz8mbw commented Dec 15, 2016

@eikaf for what I know the same Amazon account (email address) works for all Amazon sites. Like Netflix. This sounds good. :-)

@Phjodor
Copy link

Phjodor commented Dec 15, 2016

@iz8mbw That was my thought, set it to US and gave it a shot.

@ghost
Copy link

ghost commented Dec 16, 2016

amazon

Also available in India now. Please add support for that as well.

@Sandmann79
Copy link
Owner

@eikaf This would be nice, because I can't use primevideo.com with my account.
Tried with vpn, but no luck.

@eikaf
Copy link

eikaf commented Dec 18, 2016

@Sandmann79 i need some info for debugging, log files and eventually how did you reverse the login forms etc.

@Sandmann79
Copy link
Owner

@eikaf To get the urls, you can use Fiddler Web Debugger, wich decrypts https traffic.

For the login process, you need only look in the webpage source code and search for the following xml tag: <form name="signIn"
Inside this you find some <input tags, ignore this one with attribute type="hidden" and you'll get the needed parameters from the name= attribute.

@wmariz
Copy link

wmariz commented Dec 19, 2016

Also available in Brazil.

@radziojedi
Copy link

Hi,
Amazon Prime Video is now available also in Poland.
Please, can you upgrade your addons to supports Amazon Prime Video for Poland?

Thanks!

@Sandmann79 Sandmann79 changed the title Amazon Prime Video available in Italy Amazon Prime Video available in more than 200 countries Dec 29, 2016
@pfiol
Copy link

pfiol commented Jan 4, 2017

@eikaf Any update on your generic addon?

If someone needs a beta tester for Spain just let me know.

However I don't know if once we have the generic addon for all countries we will still face the "DRM" error...

@eikaf
Copy link

eikaf commented Jan 6, 2017

Update: i'm able to login in my country (IT). I'm getting error on missing browser addon. But i think i'm missing some addon for kodi, so it should be easily fixed . Unfortunately I don't have much time, but i hope i can work on this in the weekend. :)

p.s.: i'm creating also Italian translation.

keep you updated.

@eikaf
Copy link

eikaf commented Jan 8, 2017

Actually i have some problems getting the right DB for my country, I can login inside the configuration panel with the result i've got message "Ciao MyName" but when i start the plugin i've got foreign list of movies/tvshows, i think it's an issue linked with atv-ps-eu/atv-eu query in the plugin, but i can't figure it out.
@Sandmann79 could help me out with this? Fiddler2 gives me back atv-ps-eu link when i play some video within webbrowser. How does the plugin work when it queries the amazon db? I'm trying to debug but i can't find out. Any help would be appreciated. :)

@pfiol
Copy link

pfiol commented Feb 6, 2017

@eikaf Did you succeeded? Kodi 17.0 is now official so all will soon have the inputstream-adaptive plugin required but the general addon is not ready yet.

@vasundhar
Copy link

vasundhar commented Feb 8, 2017

For India, Requests seem to be going to
https://fls-eu.amazon.fr/1/batch/1/OE/
https://atv-ps-eu.amazon.com
I changed the url string as you can see below, and MarketplaceId based on what I captured.
However I am not sure about the asin, firmware version.

01:40:07.225 T:1698575344 NOTICE: [Amazon VOD] {'asin': 'B01CIDM0FY', 'name': 'Dil Dhadakne Do', 'mode': 'PlayVideo', 'selbitrate': '0', 'trailer': '0', 'adult': '0'}
01:40:07.226 T:1698575344 NOTICE: [Amazon VOD] External Call
01:40:07.253 T:1698575344 NOTICE: [Amazon VOD] getURL: https://www.amazon.com/gp/deal/ajax/getNotifierResources.html
01:40:08.773 T:1698575344 NOTICE: [Amazon VOD] getURL: https://www.amazon.com/gp/video/streaming/player-token.json?callback=onWebToken_210
01:40:10.865 T:1698575344 NOTICE: [Amazon VOD] getURL: https://atv-ps-eu.amazon.com/cdp/catalog/GetPlaybackResources?asin=B01CIDM0FY&deviceTypeID=AOAGZA014O5RE&firmware=1&deviceID=63ff327e760252dd927e708b8669629ef6fb443754df3d1aa6be0d51&marketplaceID=ATVPDKIKX0DER&format=json&version=1&titleDecorationScheme=primary-content&resourceUsage=ImmediateConsumption&consumptionType=Streaming&deviceDrmOverride=CENC&deviceStreamingTechnologyOverride=DASH&deviceProtocolOverride=Http&audioTrackId=all&deviceBitrateAdaptationsOverride=CVBR%2CCBR&videoMaterialType=Feature&desiredResources=AudioVideoUrls%2CSubtitleUrls
01:40:12.785 T:1698575344 ERROR: [Amazon VOD] Cannot complete request. (prs.norights.notowned)
01:40:13.031 T:1958601648 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.amazon-test/?asin=B01CIDM0FY&mode=PlayVideo&adult=0&name=Dil+Dhadakne+Do&trailer=0&selbitrate=0]

@Parufito
Copy link

Hi @eikaf i'm from spain, and yesterday I started testing this plugin on Libreelec beta (Kodi 17)

First I get the error with the plugin player codec. But I installed the inputstream plugin and i get this OK

I can login to any country with my username (USA, DE, UK, i didn't try Japanese ;))
but then when I choose any media (the list varies his content) I get a message like "You can't reproduce that content on your country)

Looking on the Source code, I see a element in the plugin-configuration that is Other countries, but it seems to be disabled. Is possible to try with this? or is still in dev? @Sandmann79

I would like to contribute with the development of this plugin, with any help that i can offer

@pfiol
Copy link

pfiol commented Feb 21, 2017

Hi @Parufito I'm from Spain as well and faced exactly the same problem. Just to try, I tried to watch one video I know it is available in Spain and UK (any Grand Tour episode), and it no longer said "You can't reproduce that content on your country", but a "Due to DRM update in Amazon you can't display this content" (or something similar....

So, to play movies I think we would need to:
1- Solve this DRM problem,
2- Modify the addon in order to retrieve the correct video catalog (essentially all the new countries point to primevideo.com).

I can help on the second point, but have no clue on the first one...

@Uukrull
Copy link

Uukrull commented Mar 12, 2017

@pfiol: For the first one, you need to compile the Kodi-agile branch: https://github.com/FernetMenta/kodi-agile, remove this check from the addon and, in the InputStream Adaptive settings, set the Stream Selection to Auto (for some reason it doesn't work if set to Manual).

image

I'm also from Spain and I watch the US catalog thanks to getflix, but I'd also like to watch the catalog from my country.

@Uukrull
Copy link

Uukrull commented Mar 12, 2017

I almost forgot, @Sandmann79 you can use getflix to access Prime Video countries (they have a free 15 days trial)

image

@Sandmann79
Copy link
Owner

Sandmann79 commented Mar 13, 2017

I tested it some times ago with Cyberghost, but i needed a credit card to use primevideo.com site.

But i think the problem is, that the old api, which the addon use, doesn't support the new country's. Because i sniffed the Android App (Tablet) network traffic (thx for the hint with Charles @Uukrull) and saw they don't use the marketplaceId anymore, to assign the country. Within the App you have to first sign in, to get the content for your country.

So it's the best way to switch to the Android api, but its not easy to find the right parameters, to get all infos at one request. Because within the App, the response contains only the title and cover and many styling infos (which we don't need)

I'm sorry, but due a lack of time, i can't investigate further on this at the moment.

@Uukrull
Copy link

Uukrull commented Mar 13, 2017

I tested it some times ago with Cyberghost, but i needed a credit card to use primevideo.com site.

From what I understand, with getflix set to a country that supports primevideo and your Amazon login/password, you should be able to log in.

@Sandmann79
Copy link
Owner

I can log in to primevideo, but in the next step, they ask for a credit card.

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 22, 2018

For the most impatient ones, I got primevideo to work (tested on Win7 & Debian Linux on Kodi 18a). You can find instructions on how to manually install my update here. There are still a number of QoL improvements to implement, but at least now the entire catalog is playable.

As for the pic or didn't happen (pardon the quality):

dtsts

In the meantime while hitting a wall head first before discovering 32 hours later that I had everything working perfectly except telling Kodi that it actually had to start the video player, I noticed that there was no "Remember Me" when logging in. If you relog now (with my update installed) you should be able to stay logged in for a long time now, instead of 12/24 hours. I will introduce an option to do that, instead of doing it by default, in the near future.

@drizzt09
Copy link

@Varstahl i would like to test this process, I already have sandmans zip, repo, addon installed in Kodi (Android FTV).
You mentioned earlier that yours doesnt have zip and I must compile... I do not see a "compile" option to do this. I can easily copy all your files over to where they need to be in Android ...all at once, but i dont know how to get them all at once from your GIT. thank you

@Varstahl
Copy link
Collaborator

@drizzt09 no, there's no compile of sorts, that was someone else mistake. You can get the entire zip from here, just make sure you unpack the plugin.video.amazon-test only. You might need to also remove the resources/language from the existing installation (just the first time). The language part is a bit of a bother, but as I was working on localization I discovered that the resource format used from the addon was obsolete) and so I just upgraded it.

@drizzt09
Copy link

OK got the zip, extracted the test folder only, deleted languages from original.
replaced your files and restarted kodi.
dont see canada in country and language is hardcoded to GER, cant change it
now im getting error during playback that i need Kodi18... is that actually a requirement? I have 17.6

@Varstahl
Copy link
Collaborator

I have no idea about the Kodi version to be honest. I've got two 18 alpha and that's what I developed and tested on, I've read some things that said that it had improvements for InputStream.Adaptive, which is what we're using to play content from primevideo.com and netflix. I didn't code that part myself, so yes, it's possible that if you're using adaptive inputstream you might need kodi 18 for it to work.

As for the language are you sure you selected Other (primevideo.com) as seen in this screenshot?

@drizzt09
Copy link

i dont have "other" and I did have it on input stream, not sure the difference between script, browser and android which are the other options

@Varstahl
Copy link
Collaborator

There might have been a mistake then. Try to copy the files again, mainly these:

resources/language/resource.language.en_gb/strings.po
resources/settings.xml
default.py

If you can't see Other (primevideo.com) then the resources/settings.xml is the wrong one.

@axlt2002
Copy link

Hi Varstahl,
In order to avoid such kind of installation issues, would not be more less time consuming for you to create a .zip package to be installed without the need of the previous version? The only issue would be the dependency I have highlighted before but it can be solved by installing the repository from Sandman79.

Of course this will be just a temporary solution. I guess that the two add-ons will be merged at certain point in time, right?

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 22, 2018

The problem is that, while technically correct, it would cause dependency problems requiring to install the addon from the repo anyway, and that the release I would pack would always be behind. I'm uploading a lot of commits daily, and there's no automatic way to do it in github, otherwise I'd already done it.

The most practical solution would be to just automate the thing with a script, pulling from my repo and copying the files over, but I'm lacking the time to develop a proper script, also given that (hopefully) in a few days it'll be done and over.

Edit: also, it's not really ready for public usage. I just discovered that InputStream.Adaptive ignores every non-English audio track. Kinda pissed on my parade…

@Varstahl
Copy link
Collaborator

Small update: with today's updates most of the features have been implemented, although we're far from being done. The root categories as reported by @Goruti has been fixed, I implemented a few adjustments as reported by @CGarces, there are now the "Remember Me" option during login, the custom views are enabled as per Amazon VOD's settings, fanarts for movies are now gathered upon scanning, and tvseries should now be correctly nested (when amazon doesn't screw up, like in the current state of the italian catalog).

The downside of the last two points are a severely longer scraping time (on some of the 40 pages sections we're talking minutes worth), on the upside the art and runtimes are correct for each movie and episode. So, there's that.

The english speakers could probably use this version for a good while, all the others should probably wait… I'm still unclear if the multilanguage stream problem is due to the addon, the InputStream.Adaptive, or Kodi itself. I'm still investigating the matter.

@ammgws
Copy link
Contributor

ammgws commented Jan 27, 2018

The downside of the last two points are a severely longer scraping time (on some of the 40 pages sections we're talking minutes worth)

Would it be possible to show more verbose feedback when it is scraping? Even on the curent version, it just displays a spinning 'loading' icon (Kodi skin dependent?), so when it takes a long time it is hard to tell if it has stuck or not. I wanted to give it a go myself but haven't been able to grok the codebase yet.

@aviwad
Copy link

aviwad commented Jan 27, 2018

@Varstahl hey man your work is AWESOME! Haven't tried it yet (planning to later....), but wanted to say that if you needed a tester in India, I can! I'll give feedback as well! It's the least I can do!!!

(again, this is like MAGIC!!!111!!)

@Sandmann79
Copy link
Owner

@Varstahl Why you removed the audiotrackid parameter at getstreamurls method. Maybe this lets you only get English audio tracks. Did you checked the mpd manifest for additional audio tracks?

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 27, 2018

@ammgws in order to better debug things I removed a bit of unnecessary stuff from the logs, but you can enable the debug mode/verbose mode from the addon settings to show in the logs what it's actually fetching. I could probably have some feedback in the UI popping up, I just fear that it would be a terrible hassle.

@GNOME-IS-LIFE I don't think we have anyone testing from that region, so the more the merrier :)

@Sandmann79 there is no such parameter on primevideo, I manually checked every single query from different browsers, and even checked the MPD that was downloaded. The languages are all there, but the only parsed ones are the english, I can't tell you why. But sure, I'll re-enable it today for a quick test and see if it works. Well, I'll be damned, it works. I have no idea what changes, given that I manually inspected the downloaded MPD streams, but oh well, I've been working on the logs so much I could have mistaken the kodi ones with the browser ones, at this point I won't ever know. Thanks @Sandmann79 :D

@ammgws
Copy link
Contributor

ammgws commented Jan 27, 2018

you can enable the debug mode/verbose mode from the addon settings to show in the logs what it's actually fetching.

I'm not really troubled with it, it is more for the less technically adept members of the family. I was thinking of something unobtrusive like when Kodi updates the video library. If I get some time later I will try have a go.

@Varstahl
Copy link
Collaborator

Varstahl commented Jan 27, 2018

Yeah, I'm still on the fence about the download times. Having runtimes and fanart are ok, but we're talking in some cases 80-100 additional HTTP requests per category. I think I might remove the option from movies and only use them for series where they're necessary. I'll have to look into that.

Edit: @ammgws, I just implemented what you requested in the primevideo.com branch, made perfect sense after all ;D

@aviwad
Copy link

aviwad commented Jan 28, 2018

@Varstahl your awesome work, didn't work on my Kodi 18 nightly computer.
I logged in fine, chose primevideo and out of that the region you said was for India (ROW_FE i think?) yet when I clicked any category, be it Movies or TV Shows or Kids, it spewed out an error in the logs.

my logs are attached

08:12:39.912 T:140022730032896 WARNING: CPythonInvoker(1, /home/avi/.kodi/addons/plugin.video.amazon-test/default.py): the python script "/home/avi/.kodi/addons/plugin.video.amazon-test/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE 08:12:42.074 T:140022730032896 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.KeyError'> Error Contents: ('lc-main-av',) Traceback (most recent call last): File "/home/avi/.kodi/addons/plugin.video.amazon-test/default.py", line 3017, in <module> PrimeVideo_Browse(None if 'path' not in args else args['path']) File "/home/avi/.kodi/addons/plugin.video.amazon-test/default.py", line 409, in PrimeVideo_Browse PrimeVideo_LazyLoad(node) File "/home/avi/.kodi/addons/plugin.video.amazon-test/default.py", line 519, in PrimeVideo_LazyLoad amzLang = cj._cookies['.primevideo.com']['/']['lc-main-av'].value KeyError: ('lc-main-av',) -->End of Python script error report<-- 08:12:42.093 T:140022730032896 WARNING: CPythonInvoker(2, /home/avi/.kodi/addons/plugin.video.amazon-test/default.py): the python script "/home/avi/.kodi/addons/plugin.video.amazon-test/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE 08:12:42.102 T:140024523618688 ERROR: GetDirectory - Error getting plugin://plugin.video.amazon-test/?mode=PrimeVideo_Browse&path=root-%2f%2f-Kids 08:12:42.102 T:140024523618688 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.amazon-test/?mode=PrimeVideo_Browse&path=root-%2f%2f-Kids) failed 08:12:44.798 T:140023400122112 ERROR: Unable to find plugin 08:12:44.798 T:140024523618688 ERROR: GetDirectory - Error getting plugin:// 08:12:44.799 T:140024523618688 ERROR: CGUIMediaWindow::GetDirectory(plugin://) failed

@Varstahl
Copy link
Collaborator

@GNOME-IS-LIFE the source you're running is outdated, today alone I've pushed 12 updates, and I'm about to file a push request. You should either wait the addon update or download the default.py, settings.xml and resource.language.en_GB/strings.po from my repo.

@Sandmann79
Copy link
Owner

PR is merged at 3a31f7a.
Thanks @Varstahl for his good work.

@axlt2002
Copy link

Thanks for the impressive work!
So, just for clarification, in order to install the add-on it is now sufficent go through the sandmann79 repository 1.0.2?
Thanks!

@Varstahl
Copy link
Collaborator

Yes, shortly. There's some cleanup to do before the version is bumped.

@axlt2002
Copy link

Sounds just...excellent! Waiting for your notification then! :)

@dewey
Copy link

dewey commented Feb 26, 2018

I'm using the latest version from this branch and I'm having the problem that I can't see any content when I'm clicking on Movies or Shows. Only with the search I get results. Is this a known issue?

screen shot 2018-02-26 at 15 46 14

@Parufito
Copy link

That happened to me also. Using it with Spanish account.

I thought that that happened because i tried to access to Movies List before recieving CorrectLogin confirmation.

And I supposed that the list was cached without permissions and now is not possible to refresh.

But all are suppositions ;)

@dewey
Copy link

dewey commented Feb 26, 2018

@Varstahl Where did you get the requests you are using from. I can't seem to find them in the web requests, did you mitm them from the Android app?

@Varstahl
Copy link
Collaborator

Let's go with order.

I'm using the latest version from this branch and I'm having the problem that I can't see any content when I'm clicking on Movies or Shows. Only with the search I get results. Is this a known issue?

I've been slightly passive recently, but not that I know of. Yours is the first case who's mentioning this, together with @Parufito, as of 944fc99 everything was fine. If you delete the cache and still have the problem, create a new issue with the content of the kodi.log, so that we can figure out why you are experiencing the issue.

And I supposed that the list was cached without permissions and now is not possible to refresh.

You should have a userdata/addon_data/plugin.video.amazon-test/PVCatalog<MarketPlaceID>.pvcp you can freely delete at any time. I didn't factor in cache refresh yet because half of the system has to be recoded from scratch (sort of, but way less dramatic than it sounds) to allow for better and smarter caching.

@Varstahl Where did you get the requests you are using from. I can't seem to find them in the web requests, did you mitm them from the Android app?

I personally reverse engineered the primevideo.com website. All my work is based upon it.

@Varstahl
Copy link
Collaborator

I gave it some thought, and there has been a few people from Spain claiming to have problems, although we never had more information to go troubleshooting. You might want to check #83, to see if the logs has the same error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests