Dis90 / plugin.video.discoveryplus

discovery+ add-on for Kodi
65 stars 13 forks source link

Add support for discoveryplus.com (US) #5

Closed Dis90 closed 3 years ago

Dis90 commented 3 years ago

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

Dis90 commented 2 years ago

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.

yeahme49 commented 2 years ago

No special headers for /wv and I don't think there are any preauth headers. When playing through browser it hits /wv 6 times, these are the headers

Request URL: https://content-discovery.uplynk.com/wv
Request Method: POST
Status Code: 200 
Remote Address: 52.3.215.10:443
Referrer Policy: strict-origin-when-cross-origin
access-control-allow-origin: *
content-length: 716
content-type: text/html
date: Sun, 12 Dec 2021 18:39:47 GMT
referrer-policy: no-referrer-when-downgrade
server: nginx
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-services: dd1914ad6ebc4d389cc3e7185971e3f0
x-xss-protection: 1; mode=block
:authority: content-discovery.uplynk.com
:method: POST
:path: /wv
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
content-length: 2
origin: https://www.discoveryplus.com
referer: https://www.discoveryplus.com/
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

Payload for first 3 show up as  and they all have the same response

�����3:/w*�����"�0�
���[;2}�^$�ö*���R
ռ�7P>E��v��@QA��㭱��NrZ^J��)XX@#��8�y90ao���~!����w��W��_F&=��X�`z��O��W�7��|��3p]�:!�N�J�GI�~�]C�ݺ���3��=o�dB�1�@���ĺL� ����`�����[��d���l��\s�����Y��$pp�h
og��,J��D��N�7�K/Y�(C�X/k�]��^n�d���q�P��Z  :license.widevine.com��4s��5)'��{��Rw�I�<���0�39Q�̽��D�'�!4n������~n�v�8F
P;��+����Ŀ�
���K�ќ���t̬(ѴAl�ވ0��4����  xB:d.Ta=�ϖ�J�I�U�+:p>�vj��mk�+�k��O�Yҫ�v��BG�\C��"f��6��C��˽���U�U�Ǽ�U�doX*��p��y�g�:+�6,[���U�[ʩœÃ�Wԝ��~@����I���5�X�]x����s�
�����o�$>?=��    ��_��:&?��    ;  ��&37:)����4,��T<��/|_�3����[%6v^�Z���/��՘a��M�u�����&����w��2�ڼjk��
IӊE뇥�

The last 3 have different payloads and responses Payload:

± ›
˜
 24bb5791f66d472a830feaa1f3e25f2evdms"U4ef89646fc3b48b3a9da14e73abb2c13_ause1-ur-discovery1_00c8acf8ffe3434aae8987c8bd14c674®§6väo^øÁ¿üþSY|ü ôƒÙ08¢ƒµó
B€
license.widevine.com¹Ì†‹3:/w*ŒÀIΙcîA•o${› øËӖ•wÙ¿áØÏ&ÐÜ2X9YhцÐN¶¤ú*Y.}*݉W q:§€!Ú‡B÷Eq©ã?LÆǜÇË1N¶‚G…„„ÃçáNÏöC·5è«ur<˜h®a¼<¥Š‡ØN’Ö»(&=f‡6‘û`‘Uå쏍³©èþÓuipVÜêÌ®“oÜÕQC}:~Cªp¯‘µ’6ˆwG¼×E\•!ûðk
3N8
6L”nÝ
ÿ_þa]³óE×nêu¾¾ðáVµ€=æÖêÎël®›p—º!ÿëè(.§Ûë%*Ž¤ÝJ÷ÃLã_Þ÷v÷=Ì÷ØÃм¶M¨ì´·ýíÛL㊯ø\­ãFfNÛ-ïjC
€`F5k•ž#ž7:JҊ]Öe
jñÓ1_¡qXJq¶Å¤°CŸàIMÙØTއo[Ìn{Õ*Ò:ç³ÞüW‡Wç7»æmòg†£Uú©Gsƒ‰ñé>l0ê€âù\´HyßM¯hªz‘xHDmÕê©ö>=+¸
l`dæFå<&<N,WIéæ}(ÆÉلåÝóKÛmUÑQí ÉÎvã\¦Y[m?¨Sv“[ó”À/x<ÉÌ¿»£#Çwù_šÔà³Ø;…þûmú~K19­ª‹>€ùœÏ«Id#LkÁþŒËG.aúÙ¦h¸LK{€SþÍǞµ9ùçm×Óæ,ëÑß@ŠÏâ.–îùËfÔ©óŸ+n6u?}‹køëRe-'lÒÊ[­±j­-ì±³Žugö­ØÂýS~yù”÷[ö’·eì*js~—ý¬©Vþ3F9NÍÐ]OŠ©xèŽ&<“g4&qœñ¢á«¾±@taL4¯*è½Ô¤½4uñjèìÙµR½¨÷²=Êûeihñçz[RʲXä“ìûzÖO
£+Es‹Ò;mv|ÔIQR…,ŒEe-‘0„‚bázT÷p¶%‘ŒžR‘8p}Efΰ_}\¾{¾Îµ?¤è‡Z®Ts!ubF°­ïÙ/ÄZÅZ>Ü¿”ž¯ÅZD
ÿ¿(kî.'J TyAý^se|ó~³¶ÀGjQÀï‘ú8}ríå9êG0¥.á,ïniŠ³<Ð4§³žÂym»\”f^P3b‘ÆŌr^¡£.VÕ¸HqÏgò§
'.:;5Žô}rÍï•Ââ1R¿±¸ù£[­ÿR9BéH—¾´à³Ðà6ÍÔ§ËÝzÑãâî¨Hkaä<f?‹XZ€}Ý8ÔÁm>ø—ìݽ ‹¯.ÕÀIœkcù5IBr%÷Åõçm/d@oîKÙ@·¯ª.ó   ±!Þ]I¶µè;|ÇU† ŸÚØ\ïq¥tA8ë¡(Ç(r©Nþöm¦DE–r¦F¢š2D’½k=¦G±2nâ­rÍmd³Ô‚¥u†¨£uâ+üìg¢©#çÔ¦¬¤@¡ŠˆSûm_]ë4­ˆ:Ž,‚žkÙրåÁõ
þӇSP`ìewzt‡;eúыÎMîѹ0µâø0•ý?i‚÷æÕmÜ«aLño¢&£¨4hî‡C®¦“óDé묉ө
‚¸î8~ÚIä)ÏJÉ3õÊî‡]ý£œlꔖe…šƒAz¬ôV¢yïŸ8Âp^ÝWÊobsûÍæ®lœEhˆœwTå*CkŸ@º‡_ÿWÿÿÀª
FÚÔ=Ák¡2†Õ Ee˜Ýiê|ð¡ßå\«4õ?\`»–(¤î´œƝåSÄ2¡tÄEÁ,–19£Èå3Æ!˜(‘W&P¿0ÎsŠ<}„+#UŒfrIXmÉƃåÿ·¿ ±´C((VO‰”° Ɠle]¤A|Á
-a: ¿ž[à%<CzÅyYÆ_Ú(I¥ š=²^Ä*gHéû5¹b¢P«ê£dë\W¼z›J¾l>»äy;
Ïó1wý¡±T95§/ž…lÜ݁¢sá ûó½õ>ê‡5í&U^øñ™„yS^ÃƁYp50Æ:Ãj€Åxš
p—
J*t¹¾¹ÆRÔA‹©Ôég”—5þ½“ì;ýäQiü‹'[\»­uý`8¡Ó¦,·rô…Ï®rCŁ­QœPÔ6™óiÒå ÈLsŠUháàùJ°Ø ì)pqùM<.ñâPB«YWWhnô«‹ IÑ§q9S={Ã-!zå
%döm˜É3UœŠuç¡ê×=^ŽsX¦¹4S™ÃÞÌÈ`ϵÞÕêfÿ§i¢Gø)=íŸ9Ðâ›&Ðñm'…µÆU"~.x'Rì=k®‡œ¤@"ƒÖÅÖÊsš#=ïH<hʶÎh7÷ˆœ–Îåbg¿UyµÜ‚]Õ%”å1x‚À%Ö¶@“is.ªŽnäËïß¡ñ¥V屶ÒrþB]C$íy‰K´-{ôoŒ­NVƒ¢Ò×±'?èÓý+‚U’R–dã—È.ÐR3t忪ã©QÒÆ\ÈëãŽ?ò»¸ßÛäiÎó(—‹ÒqxN}¥_eÇô‡7Ó=äxôäñ¿4ºñ=&SìÇÉL«M16tì}Ú~e}÷4t_­çâ"9qÆIç©Ö±5èÌb»ŒM#[`яnTÎm¸ó9öbš"ºë,Ë™b>«?¡~>gÉ^ôÅ·”6Ì^¤;ojSÒ¹&€ƒ¯œïì+€Û7xy0@Úh˜>‡Ž‰›Nï5ÞÎ÷bšM™üJ›Ù†çêj,µ›ïª§TC7låmXój3äwÎ<%6òC`Ñ|ÃÉ1nÜ¢£w´ãÅL?’/uŒÔÌõO5Y¦‡wKANœå«ÀñÕv“¹ºW¦ž[8‚zBþщÖm;P²zZⲅžA…„jj…¥–ÿ”$ªê³9~ÄƉc
ôkŸ>K¤É™’Ò9« U O]óÛhÙüÂŸ÷on6׈óÿüÛó1$㥅²Q
H/ä4͟«Úö„ê^b›ÉÀ‚/âþ4¹0'O+É·Üúíµç‡b‡4=´§Û$t¹‹íø°Û~¶AOÁ)z~];Ͳ¿^YNqÃi¢žDØ"FȾ¯ÊêV“'«ºûÂvE‰¤Çvˆþ[…‰&bSë9*0å¸Þ­éʆ7 ¶ü½á5GÊɓ¿s©þýX²só^Zo¤åªÈÎcß;9x)Ï1š`MJV¦µÔÓo^»<Y’=ÌYÖÉÍð)®`ˆ8߀êâؑ(=ÔI¹»¬Á8?háÎ.¦R¹•S2ä*š¡M´ô¹ötËÛ&”L’íôÿ°3•º©ßúáÿ‚G†³°K:¸ÜPmÛ/%Ž{h´Ÿ2ž`¤ºyYUI¹;Ï3DÙEe ö;x‡&.n^äàÐW™vešTò%í°éÅåas®‘…¼àϕi>{8âé÷SÂäÍqÜÕCƒNX)§‚¸b9r0‰v†RÒ3”!Î1º°âdµ#ny‡r‹®z+¼+YÙŒTž6×À5Iôìæ†FӓÃB€âٖ’&wJ2^Š¦iëØd葈`9’/™\¯=ºP    ‚ˆ›ùTâéyt¬q»ˆ‚½pT`½g^`Ú±˜Ô1¥Z}jË#ByO™ÈV7ßÅ9ó§êñ›U¬“‘õlxKªo¿®oäåï³à"Wþ ê±,̏ŸÒLírµquB\ž0W÷¿P§Åt‚xYrxòâ±j²ÇOGÓòíÝYñ•t繡Ô=g.dFPG¾ä҃ö§T´x˜ÂœÑMzúYOE­¡j½V)j"m!U
­ò·s£xœò0b·ÇÉÌo¹µ'€G¾âïnö”äѾ»ÓVÝDÛ4úŪ^ÞÎJºY´ã·=I¡Êæ ‰–/åÂîì^‰ë CèˆÆä”šû=§úÀÍqêùÛמ†åqS‹‘©Éüäˆ÷¾ë¼Eb”¨[ca%EdTÌGù‹9ú´ekç!–|xȺ¼ò>ºb,k¾u$%Nqá_ÍwB½^²°–·݂åÏá~a²è±XV̄kÕ¶õ· Nø7"øAS¯6-ÈÑʖ!Ú(¸îÔÖ hïàå0òIÊÏ[jÀÅjÿÉñ×çqŽe+,µŠp2®UíSüØj
b‰¤—j¥þÀ‹1ð±åÙ"Ã!òñµçdK þáÓÛjº“Œn›/¼ÀÝb" ÿD"ýʄ0J‰AfK3%
]¢RW¼Κ&¨û 3܎¢1¼3I€Ew]‹ OA]w=eSŒ<‹ž`NßЉœLÍ3psó®ë[âßNmQð` ïRA‰óϯÑt¸ËaœsVjÍÿ²ŸÕފ?ç‘ψR}»‚9J˜ù‹³UtŸA?\(­ýðwŸòÒ@Œåó’þœ*ÚMÄY*‘;l—3Íÿ_CCØ‹ÖÊP   û7®Ê;ÑäÉ)X†=à‡ÊsÍÚÞ#îõ6ƒE~f\¨ŠÃ*ð¡CX¤HoÛúøôiÇÖ-1ðÙÇ‚î£w… µ­WíGgÜøæVøǚØZþ‡ÕÒârlØt¥,Û^$±`",ø‚—á7Oø·(rB1XÉBF«ÅMá*–ˆfóúÍVõ½Ve#
úåæ6Š—°\ìÅs1z=<zÞ©“@ûöû—½Œ —)b§OPªŠÔqÆ|Lì6üz3«k·oºsy+DIßV"‚ƒ‘%Úä
f°ùӏÞ*€>-¹±áIÀ’-Ö·•kléûÕðl£w®™°Høn·Yö¾²'¾¶Ð
HfBxpLçåx£™˜’?f,·Ñø’ÅCi‚Ë,T<ç. HôwC
pè²ôó毡­‰Oä…iŸÄ™aQ†oÜíø»$ª0㌱7'ô>¯RØL°ÎX»¡ZõzA¡1Öt÷1L:~;½¼†#dûÔW» ôÖ3so¦èä¤Ï; ~:qSqòRˆ"»€Ã˜¢¸ÞÂÀóÐz¾Üñ I(h—ú
ÎU€:ÀX ˜…—£·¢v,gù˜×JíØ©8Dupü„€£D$nÖivû}mþk™f0¸‡gÛŜB8?„f½ÎÄE.ÀO¸'z­lØk€Þ?ˆ¦.g(ž¢?ηZ!éCېÕ,)P3{>æÆŸƒòäøøš²õÕP|1)F¤%}½5BüEó=í=•áW»Ì&²ˆ˜€¬¶¢îS-5Z‹¡üJÞmA¢/B¨`

Response:

�
D
��6v�o^�����SY|� 00c8acf8ffe3434aae8987c8bd14c674 (8@H�ٍ ��(��0��8HPX`f_B�-Qh�Q5X���qhP��(=%r�k�?)4�=.�+��Q��m>
���
�w�H�E���G�Z�9ЌL*8#j1�Q�����4+��1��Q���L�v� l
$�W��mG*����_.�\|�8|t�
�0P �C�&l�Ȅ;н��??��R������a�: (2* B
kc16Q��mA��bSD �ٍ8P �Qlѯ'9kvc   �x�^U!Hh'?*e��x"���[�B֛4z�H/m���i'Al�ڙ�?�)� `.���+b��Mt��s�����H�=���P�gn��ɼ���ʕ�D!�pK{��XJ�$s�C�6�^�-J�E�r!Aw)��gdv��I����Q:2
016.5.0 Built on Nov 3 2021 21:41:01 (1636000836)@J���mA�/B�`hzPQ�Q����&�za�G��2B�Y�3t��ii�6�D;j-�,X

That's one example, the other 2 are similar in size but different

I don't see drmtoken anywhere in any of them

yeahme49 commented 2 years ago

And this is the payload when the browsers access the mpd file

cid: 4ef89646fc3b48b3a9da14e73abb2c13
ct: a
drm_policy_name: Prod_5April2021
exp: 1639334686
rays: cdefghiba
rmt: wv
rn: 15433491967631800173
tc: 1
sig: e935d73e99aed9154579fb88acff85a489a638b27f4362493c323512617ed3ec
Dis90 commented 2 years ago

Yeah it looks like there's no special headers. Test with current master.

yeahme49 commented 2 years ago

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.

Dis90 commented 2 years ago

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 if useIsa: to if self.get_setting('us_uhd') is False. Then Inputstream Adaptive is not used for UHD.

yeahme49 commented 2 years ago

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.

Dis90 commented 2 years ago

Okay. I will remove proxy completely and add drmSupported true/false to if self.us_uhd: in dplay.py Or what you think do you want to keep UHD streams .mpd?

Thanks for help :)

Dis90 commented 2 years ago

Does subtitles work or is there any in d+ US?

yeahme49 commented 2 years ago

Subtitles do not work through the plugin but they do work on the website

yeahme49 commented 2 years ago

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 https://github.com/xbmc/inputstream.adaptive/issues/782 that mentions CEA-608 support and that's what D+ is using with MPD. So once that gets figured out, they should work.

Dis90 commented 2 years ago

Thanks for testing. D+ seem to use many different subtitle formats. I opened this issue of non working mpd subtitles https://github.com/xbmc/inputstream.adaptive/issues/855

But at least we now know that in most cases disabling DRM fixes subtitles.