-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for discoveryplus.com (US) #5
Comments
I tested the version with .com support before you reverted and I got it load the frontpage link by adding
It then lists categories but nothing appears underneath those catagories. Is there any data I can collect for you to try and add .com support? I can use fiddler everywhere to capture data when browsing discoveryplus.com if that would help. |
I can get all json listings by using VPN but most difficult part is that I can't see what actual page looks like because I don't have account. Can you take couple screenshots of homepage and other pages where shows and categories is listed? |
I used few hours to this and conclusion is that US version does many things little bit different than other versions. Because I don't have account to US it is unfortunately impossible for me add support for discoveryplus.com |
Yes those help a lot. It looks much different than EU versions. Go to browse while developer tools open and search for file https://us1-prod-direct.discoveryplus.com/cms/routes/shows |
x-disco-params: realm=go,siteLookupKey=dplus_us include: default |
Can you go to some series page, example Gold Rush and look from developer tools something similar than /cms/routes/shows |
https://us1-prod-direct.discoveryplus.com/cms/routes/shows?include=default&decorators=viewingHistory,isFavorite This is when clicking Browse https://us1-prod-direct.discoveryplus.com/cms/collections/296530408644496528769435570882544597228?include=default&decorators=viewingHistory,isFavorite This is when clicking on the Food Network logo to just show Food Network shows https://us1-prod-direct.discoveryplus.com/cms/routes/show/diners-drive-ins-and-dives?include=default&decorators=viewingHistory,isFavorite This is when choosing Diners, Drive-ins and Dives show https://us1-prod-direct.discoveryplus.com/playback/v3/videoPlaybackInfo This is when choosing Episode 1 from Season 1 and the player loads Hopefully these .txt files help. The URL show for each .txt is the URL that gets loaded for that JSON file |
Thanks that helps a lot. |
When you go to Food Network is there tabs named Trending, A-Z, Cooking competitions..? Can you click one of those and post url and content. |
There are tabs named Trending, A-Z etc but it does not load any new files while clicking on those |
Okay that explains why I can't get those to work. |
Actually that wasn't problem. Problem is that without login in for example Food Network listing is incomplete. All shows are missing just categories is listed. But I can use your files for testing. When I go to address https://us1-prod-direct.discoveryplus.com/cms/routes/show/diners-drive-ins-and-dives?include=default&decorators=viewingHistory,isFavorite
|
x-disco-params: realm=go,siteLookupKey=dplus_us those are the 2 headers, it looks like x-disco-params is not required to get that page to load but x-disco-client is required from my testing |
Yeah some pages needs x-disco-params and some not. After adding x-disco-client to requests I now get full responses. |
I created branch dplus_us https://github.com/Dis90/plugin.video.discoveryplus/tree/dplus_us Probably not working features:
|
Video playback is not working. I tried watching episode 1 of airplane repo and get 2021-01-12 15:28:09.863 T:2724 DEBUG : [plugin.video.discoveryplus-1.3.2+matrix.1]: Request URL: https://us1-prod-direct.discoveryplus.com/playback/v2/videoPlaybackInfo/89315 No stream URL for video exists is the error I get inside Kodi as well. |
So v2 videoPlayback doesn't exists .com. Try now. |
2021-01-12 15:57:01.979 T:19252 DEBUG : [plugin.video.discoveryplus-1.3.2+matrix.1]: Request URL: https://us1-prod-direct.discoveryplus.com/playback/v3/videoPlaybackInfo/89315 |
Testing in browser, videoPlaybackInfo is a POST request with this JSON data { |
Made some changes and video playback appears to work. get_current_episode_info needs to send headers along with request make_request i changed this is the JSON that gets sent with the POST to get the video m3u8 if self.locale_suffix == 'us': needed [0] added sorry this is kind of messy, just wanted to let you see. if you want a pull request instead i can do that |
Please do pull request :) I'm not sure yet how I pull this changes from dplus_us branch to master and matrix after everything US related is done. I'm little bit newbie with Git.
I guess get_next_episode_info also needs headers. Did update_playback_progress work? It is used when playback is stopped. Also can you check what url and parameters is used when adding and deleting favorites. In other regions it is {api_url}/users/me/favorites/shows/{show_id} |
Sorry for the delay, got the pull request created. update_playback_progress does work, when I stopped a video it updated on the discovery plus website. Resuming videos doesn't work though. If I go to play a video, it will ask if I want to start at the beginning or the time that was left off, but it always starts at the beginning. I will check adding/deleting favorites today. Also looking into an why some shows won't work, so far it seems like shows in the magnolia preview give an error when trying to show the episodes. If i can't figure out why I'll post some logs EDIT: endpoint for favorites is the same and its POST for adding and DELETE for deleting |
Thanks for pull request.
Weird it should work if it suggests to resume.
Can you post name of those shows? |
I tried with Magnolia Table and Super Dad. Here is snippet of log from Super Dad. It errors when doing Browse->Magnolia Network Preview->Trending->Super Dad-Episodes 2021-01-16 12:50:21.062 T:20088 DEBUG : [plugin.video.discoveryplus-1.3.2+matrix.1]: Request URL: https://us1-prod-direct.discoveryplus.com/cms/routes/show/super-dad |
Testing resume again, I started a show in Kodi, skipped ahead and then stopped. Started again and it resumed properly. Stopped it again and resumed it on discoveryplus.com. Skipped ahead on the site and stopped playback. Loaded the show in Kodi again, it shows the same resume point as the website, but when I resume it resumes at the spot I had stopped last in Kodi. So it seems like there is a resume time in the Kodi database that is overriding the one from the site, even though the addon is showing the proper resume time from the site. If it works properly for you, are you using Kodi Leia or Matrix? I wonder if there is a way to update the database resume time before starting playback? |
Season listing should now be fixed. I actually rarely watch anything using discovery+ website. So that can be reason why I haven't found this issue. Have to do tests but reason is probably resume time in Kodi database.
Maybe thru Kodi json rpc? |
jsonrpc worked. submitted pull request to add that season listing works now for the episodes that didn't work before. i think everything is working now. can you think of anything else that should be tested? |
Thanks. I'm thinking that is maybe bug in Kodi. Something similar was fixed by Netflix plugin author in Kodi Matrix. But that bug caused episodes to start from beginning. Can you go to url https://us1-prod-direct.discoveryplus.com/users/me/favorites?include=default and check is your favorites listed there? That listing is used in addon to check if show is already added to favorites or not (context menu options). Dplus_us decorators in requests is "viewingHistory, isFavorite" and that makes me think is US version using different method to check if show is added to favorites. |
Yes if I use items.size=100 it shows 100 shows |
That is weird why addon doesn't get more than 16 shows although page[items.size] is 100? I don't understand. |
I noticed in the logs that when going to browse->HGTV->A-Z in kodi, this is what's being accessed XFILE::CPluginDirectory::StartScript - calling plugin discovery+('plugin://plugin.video.discoveryplus/','6','?action=list_collection_items&collection_id=161374980142915215278619398379069832686&collection_id_main=263961364688425944705602256853549055046','resume:false') https://us1-prod-direct.discoveryplus.com/cms/collections/263961364688425944705602256853549055046 is then used. This URL only has the first 16 episodes listed, no matter if items.size is passed along. But https://us1-prod-direct.discoveryplus.com/cms/collections/161374980142915215278619398379069832686?include=default&page[items.number]=1&page[items.size]=100 does allow you to change the number of items.size. What is collection_id_main and why is that used instead of collection_id? If it can be changed to use https://us1-prod-direct.discoveryplus.com/cms/collections/161374980142915215278619398379069832686?include=default&page[items.number]=1&page[items.size]=100 then it would work for more than just the first 16. |
Thanks for investigating. Using collection_id instead collection_id_main which is example HGTV's collection_id should work. collection_id_main is used because otherwise json output doesn't list collections in 'included' section and list_collection_items fails to list anything without that. This was only used in US version of dplus like list_collections() But I'm now thinking that list_videos should work in this situation because that also lists single collection in 'data' section. Have to think good name for list_videos and add support for listing shows. Maybe list_collection() because it lists single collection? list_collection_items parses pages that contains multiple collections but we only want list content of one. That is why we use collection_id. |
Should work now :) |
@yeahme49 Can you test that everything works? I'm almost 100% sure login doesn't work. If you want test that, save cookie_file from userdata/addon_data/plugin.video.discoveryplus to somewhere and delete it from addon_data. |
As far as I can tell, everything is working properly. I submitted a pull request that adds pagenation. I removed my cookie_file and login does not work. After trying to log in on the website after removing the cookie_file, i now have to do the captcha, which I never had to do before. So something about doing a new login through the plugin needing a new cookie triggered something on arkose end. Putting my old cookie_file back and it works fine. |
Thanks for adding pagenation 😄 Are we ready to merge this changes to master and matrix? I will add support to use exported cookies.txt after these changes. |
Made the couple changes you mentioned for the pull request, should be ready to merge now and add to master and matrix |
Support added #10 |
@yeahme49 can you check what are current headers in d+ US? Also check what is in POST data to videoPlaybackInfo and channelPlaybackInfo (if that is used in USA) |
x-disco-client: WEB:UNKNOWN:dplus_us:27.9.0 POST videoPlaybackInfo: POST channelPlaybackInfo: |
Is framerate correct in master.mpd? If it is wrong I probably need to modify proxy. Edit. please check headers from something else than videoplayback. They seem to be same as in EU. |
Headers for tabbed-home: Framerate in mpd is 30. Not sure if the video files that are served from mpd are now actually 30fps or if they are 29.970 still like when using the m3u8 file. You could update to use mpd and skip the proxy and if the blank screen issue comes back I can submit a pull request with an updated proxy |
Thanks. |
Trying to play video results in:
This is videoPlaybackInfo when I view a video on the website Ultra HD still doesn't work. When I worked on it last, if I set drmSupported to true, it would give an mpd file. If set to false it was m3u8. But it wouldn't work either way. drmSupported = true the file wouldn't play at all, false it would stop after 4 seconds. Created an issue with ISA and no resolution. One person said Widevine on Windows doesn't support HEVC, so that may be why drmSupported = true fails. Not sure about the issue when drmSupported is set to false. I haven't had much time to try and gather any more info for them to try and troubleshoot more. I've been meaning to try it on my Chromecast with Google TV device to see if it works any better. |
Interesting. They seem to do something different on USA. What are headers for https://content-discovery.uplynk.com/wv? Is there preauthorization header? That is where drmtoken is put on EU. |
No special headers for /wv and I don't think there are any preauth headers.
Payload for first 3 show up as
The last 3 have different payloads and responses
Response:
That's one example, the other 2 are similar in size but different I don't see drmtoken anywhere in any of them |
And this is the payload when the browsers access the mpd file
|
Yeah it looks like there's no special headers. Test with current master. |
Works good now, only time I ran into an issue is if I have the experimental UHD enabled and try to watch something that is UHD, the Kodi locks up. If I set drmSupported to false it plays fine. I'm going to have to try and work more with the ISA devs to get the UHD working. If I input the m3u8 file that is given for UHD into ffmpeg, it downloads the video fine (without using DRM/widevine) and it plays properly. Not sure what ISA is doing different that causes issues. |
Good :) How about framerate? Is that still issue when using mpd? So UHD works but only for non drm HLS and ffmpeg? Maybe add some sort of workaround for it in dplay.py (drmSupported false) and kodihelper.py change |
Framerate is good with mpd, no need for proxy anymore. Correct, UHD works with non drm hls and not using ISA. Unless you try and skip forward or back, then it glitches. I think for now keep it as is labeled as experimental and I'll see if I can work with ISA devs a bit more. |
Okay. I will remove proxy completely and add drmSupported true/false to Thanks for help :) |
Does subtitles work or is there any in d+ US? |
Subtitles do not work through the plugin but they do work on the website |
Was looking into the subtitle again, if DRM is disabled so that you get the m3u8 file, as long as in Kodi settings->Player Settings->Language and under Subtitles the "Enable parsing for closed captions" is enabled, subtitles work. Using DRM and getting the MPD file, they don't work. There is a ISA issue xbmc/inputstream.adaptive#782 that mentions CEA-608 support and that's what D+ is using with MPD. So once that gets figured out, they should work. |
Thanks for testing. D+ seem to use many different subtitle formats. I opened this issue of non working mpd subtitles xbmc/inputstream.adaptive#855 But at least we now know that in most cases disabling DRM fixes subtitles. |
Currently broken because of many differences. What I found so far is that unlike other countries US needs headers for requests. Because of geoblock and US version needing account, support for US version is probably not going to happen anytime soon.
api url: https://us1-prod-direct.discoveryplus.com
realm: go
headers: x-disco-params=realm=go,siteLookupKey=dplus_us
The text was updated successfully, but these errors were encountered: