xbmc
xbmc copied to clipboard
UI: Add kodi-remote/casting support in Amazon VOD plugin
Addon used
- [X] Amazon VOD (plugin.video.amazon-test)
- [ ] Browser Launcher (plugin.program.browser.launcher)
Account type
- [X] primevideo.com
- [ ] amazon.(com/co.uk/de/jp)
System Setup (please provide the following information):
- Hardware: Raspberry Pi 4B
- OS version: Raspbian
- Kodi version number: Leia
Feature request: To navigate to the videos using the UI is slow. I already have amazon prime app on my android phone. If I know the video to watch, I have to add it to watchlist from my phone and then navigate to watchlist from kodi plugin and then play the video.
If you can make the "cast/play on tv" button work in prime video app, it would be the most user friendly solution. It uses the google cast (chromecast) protocol for transferring the metadata and then uses the amazon prime app in the TV/firestick to actually launch the video. The tubecast addon works using this feature.
I understand that this request is not trivial. However, filing it so that it is tracked.
If I understand you correctly, you want to select a video on your phone with prime video app and play it on your RPi through the kodi addon. If yes, this should be possible since this commit with Kodi Kore app installed on your phone. With this you can share the video through prime app to your RPis Kodi installation.
I've try with a film and it work correctly, but if you try to share a episode of an TV serie an error occurs and nothing will be reproduced. Tested on Raspberry Pi 4 Libreelec Kodi Leia 18.4, lastest revision of addon from github
I don't know if in log there are privacy related information in URL, so I dont' put it here but for film the log is: 2020-07-26 18:02:46.250 T:2241852272 NOTICE: [Amazon VOD] postURL: http://127.0.0.1:35239/gpr/https%3A%2F%2Fatv-ps-eu.primevideo.com%2Fcdp%2Fcatalog%2FGetPlaybackResources%3F... 2020-07-26 18:02:46.664 T:2241852272 NOTICE: [Amazon VOD] Using Host: Cloudfront 2020-07-26 18:02:46.664 T:2241852272 NOTICE: [Amazon VOD] checkURL: https://s3-dub-2.cf.dash.row.aiv-cdn.net/dm/...mpd 2020-07-26 18:02:47.290 T:2241852272 NOTICE: [Amazon VOD] Using inputstream.adaptive Version: 2.4.5.1 2020-07-26 18:02:47.391 T:2241852272 NOTICE: [Amazon VOD] DBID: 0 2020-07-26 18:02:47.490 T:2241852272 NOTICE: [Amazon VOD] Resuming Video at 25.1340007782 2020-07-26 18:02:47.576 T:3011498592 NOTICE: VideoPlayer::OpenFile: plugin://plugin.video.amazon-test/?asin=... 2020-07-26 18:02:47.581 T:2233459568 NOTICE: Creating InputStream 2020-07-26 18:02:47.600 T:2233459568 ERROR: GetDirectory - Error getting /usr/lib/kodi/addons/inputstream.adaptive/ 2020-07-26 18:03:01.897 T:2233459568 NOTICE: Creating Demuxer 2020-07-26 18:03:01.898 T:2233459568 NOTICE: Opening stream: 1001 source: 256 2020-07-26 18:03:02.065 T:2233459568 NOTICE: Creating video codec with codec id: 27 2020-07-26 18:03:02.074 T:2233459568 NOTICE: Creating video thread 2020-07-26 18:03:02.075 T:2233459568 NOTICE: Opening stream: 1002 source: 256 2020-07-26 18:03:02.076 T:2279904112 NOTICE: running thread: video_thread 2020-07-26 18:03:02.129 T:2233459568 NOTICE: Finding audio codec for: 86056 and for tv serie is: 2020-07-26 16:42:01.463 T:2241852272 NOTICE: [Amazon VOD] postURL: http://127.0.0.1:35239/gpr/https%3A%2F%2Fatv-ps-eu.primevideo.com%2Fcdp%2Fcatalog%2FGetPlaybackResources%3Fasin%3...Feature%26desiredResources%3DPlaybackUrls%2CSubtitleUrls%2CForcedNarratives%2CTransitionTimecodes%26supportedDRMKeyScheme%3DDUAL_KEY 2020-07-26 16:42:01.492 T:2314204016 DEBUG: [Amazon VOD] [PS] Requested POST path [u'gpr', u'https%3A%2F%2Fatv-ps-eu.primevideo.com%2Fcdp%...'] 2020-07-26 16:42:01.496 T:2314204016 DEBUG: [Amazon VOD] [PS] Forwarding the GET request towards https://atv-ps-eu.primevideo.com/cdp/catalog/GetPlaybackResources?asin=... 2020-07-26 16:42:01.533 T:3011498592 DEBUG: ------ Window Init (DialogBusy.xml) ------ 2020-07-26 16:42:01.769 T:2241852272 DEBUG: [Amazon VOD] Download Time: 0.304215908051 2020-07-26 16:42:01.769 T:2241852272 ERROR: [Amazon VOD] Cannot complete request. (prs.invalidrequest) 2020-07-26 16:42:01.770 T:2241852272 DEBUG: [Amazon VOD] Playing Dummy Video
If the full url is useful for debug purpose and not contain personal data I can put it here, let me know if I can produce other test or log
There is no sensitive data at these urls, so please provide full urls here.
If I understand you correctly, you want to select a video on your phone with prime video app and play it on your RPi through the kodi addon. If yes, this should be possible since this commit with Kodi Kore app installed on your phone. With this you can share the video through prime app to your RPis Kodi installation.
Yes, this implementation seems alright. I have not built the apk from the source. I just pulled the URL part - plugin://plugin.video.amazon-test/...
and launched it via cURL+jsonrpc.
However, when I navigate via your addon to launch the video, the metadata is also populated - info, movie/TV series name, cast, etc. When I launch via jsonrpc, the video plays fine. However, the metadata is not populated.
EDIT: The Kore app in the google play store already has this commit and the app installed on my phone does support this. So the not-working part is the metadata and the TV series (as fabpolli mentioned)
kodi.log Log uploaded, first part contain info about film launch (working), second one refer to launch of an tv serie episode (fail)
I think a factor in the case of TV series is - the share link is for the entire season. Not a particular episode. So, there isn't a single video that is associated with the shared link. This is more of a problem from the Amazon prime phone app. Maybe, this addon can treat such cases as a playlist, instead of a single video, as a work-around.
This also brings to the other part of this feature request, something similar to what tubecast addon does. But given that google cast protocol is proprietary, it is difficult to implement.
Clear. I agree with You, it's a problem concerning Amazon app share mode. I've tried this procedure because the series at this URL https://www.primevideo.com/detail/0RE56TYKHBFNEVI4SG0Y8KY2BT show only first 25 episodes and all seasons after the fourth was empty. For the other seasons I've solved the issue by select each season's menu item, right click and refresh. But for the fourth season no way to watch episode numer 26. I searched on github and I found other issue submitted so I try with https://www.primevideo.com/detail/0RE56TYKHBFNEVI4SG0Y8KY2BT/?episodeListSize=99999 and browser show correctly all episodes. It's possible add a menu item on main screen of plugin that allow to paste a url directly or select a file that contain the url of a video to be played on kodi? Ok, It's a workaround but it probably can be the solution for any problem linked to resource collection (Amazon changes page structure, ecc.), user select film or episode in a web browser, copy the url and after paste can watch it on TV
My comment about the metadata not showing up: I can reproduce the same issue by this path as well:
- Go to any video.
- Add it to favorites.
- Go to favorites.
- Launch the video.
It starts the video. But the metadata like movie info, cast, video title etc is not populated.
I think this is because you are pre-populating the metadata information in ListItems. However, those are not set when we are in the favorites window. Is there a possibility to pull the same information on-demand based on the video's ID?
FWIW: I am using primevideo and not amazontld.
Maybe there could be a workaround for the seasons for PrimeVideo, but we're gonna need to break things to make it work. Possible, in theory, will work on it if there's enough interest.
Can you tell us the design you have in mind? Maybe I can do some testing with cURL if that is a good option before someone actually invests time in implementing it?
So far, what I have understood is, currently the addon loops through the json within primevideo.com web page's javascript. And creates the ListItems nodes using that value. So, if we don't go step-by-step via addon (e.g. via favorites or kore), the listItems nodes do not have that metadata.
Here is what I had thought of as ONE possible option: Use the listItem metadata if it is populated. (This will be the case if we navigated via the addon's start node.) If it is empty, fetch it from the primevideo.com page. (This will be the case if we use the shortcuts via favorites or via kore.) This approach that I had thought, however, still does not solve for the individual episodes within the season, because sharing via Kore happens at season level; not episode level.
I actually have no idea how to fix the metadata problem, because unless I'm mistaken the URL is directed straight into Kodi, so I wouldn't even know how to inject metadata into the player without a ListItem. (Edit: if it's about PrimeVideo.com and the data was already scraped, it should be fairly easy, if not it makes load time longer but I think still possible).
No, I was talking about playback. I took a look at Kore and it seems to be taking the GTI and forwarding it to the PlayVideo query. The PlayVideo prepares the sendoff to the video player, and one of the things it does is to query the cdp/GetPlaybackResources
endpoint. In theory (haven't tested nor remember) we could detect that the GTI is invalid or a TV Series, in which case we could revert to a "show season" call of sorts, and maybe autoplay. It's not as immediate, but could work.