Closed berkhornet closed 1 year ago
Perfect. Nice changes, let me work out what to do to get a PR in and do it. Thankyou
if you need any help re PR just let me know.
Mick
From: nictjir @.> Sent: Monday, February 13, 2023 2:13:46 PM To: Catch-up-TV-and-More/plugin.video.catchuptvandmore @.> Cc: berkhornet @.>; Mention @.> Subject: Re: [Catch-up-TV-and-More/plugin.video.catchuptvandmore] Reinstate UK Channel 5 (My5) (Issue #973)
Perfect. Nice changes, let me work out what to do to get a PR in and do it. Thankyou
— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FCatch-up-TV-and-More%2Fplugin.video.catchuptvandmore%2Fissues%2F973%23issuecomment-1428008086&data=05%7C01%7C%7C235c5d2144b44783c70b08db0dcc8549%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638118944288965971%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FPpPGDAnqzdFnyDR%2FCCn7KLeLjryyfCNIb26Ih3DR9A%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQFFLXYB4G4ICIB2DMWP2M3WXI6RVANCNFSM6AAAAAARFZNBTY&data=05%7C01%7C%7C235c5d2144b44783c70b08db0dcc8549%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638118944288965971%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=v%2Fd09mefRJU9ykWS2wCrR%2FKb%2B9JTnsC%2B2qNaf%2BNXd6k%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>
As such, I will not merge the commit. I explain why. The aim is the stable release is accepted by the xbmc team in the official repo. They don't accept large duplicate code. And in this code, there are tons of duplicate. This duplicate code have to be removed by using the already existing libraries. The big part of the code is AES decrypting. So you will have to find how to use the cripto library. Another solution is you fork CUTVM and you use your fork.
Sorry for the disturbance
Thankyou for the explanation. I will continue to try and work out how to use the AES libraries for this - up till now I have not been able to work this out but will continue working on it.
Thankyou @NeutralKaon.
All help will be greatly appreciated, i am just not working it out.
If you look in the my5.py/my5.txt program above there is a lot of computation that happens with a call to
part2(iv,aesKey,data)
"We" need to make this work with some call to a python crypto AES module, as opposed to my programs full computation
This could be AES rijindael 128
I have an example bellow of the inputs and the decrypted output.
AES Key CTk+Z9wk/yx0DZdZRm6PTA==
IV wkr3LuvyHxlh5bZ_vKQw5g==
Data 4TMI6aBhMyzIK9XCRTRPUgTdyQ1ihJDJyq62NlC4PrcfgNmlre_8clKgbGmMGlVpFmwodLrHpYrxBkVGbnLNO7jQvq263dQbv8mYhaB8WyguUAgIHkHzNvRnN_PueImXTQldm38qXyv2RekbUVIj2Vu5kKHXYixNYIHBWP7_Bgfrbo8uzfLhGGNakSx8OhPDDeY1Ghdm73Kb1FZ2V5a1uA-Shfxqg_eyAubhz1aXHuyJBQvD-pLnP0zYtbtnGixBUCzQmJpxUcgPAksqT3lvbKGLWX1YsL6py3b4m6wAnD6Rc7ToetHir24a-W9AfUgQSD05Q8DEjhMrpbH8Ebbg0v5lAOI0E-AA2rLJ368OSj6Or74XEJYypE-bqZ4ekyWXCNroDxTKPOTtR9lPVWlKhl9DnogCUutINuXVBvGfZyQDL60dwlnsxqTaw2dDzj3G47-UDlsKBj5aFS7pZ1KIa9OoKfaks9eyxRh0eZm7P8qAZj2Jb7wZ6ElnSubA7nSiOj2zVfQ0JyIOQL9hlzNanhwqaiymvG7wJu-_6AZYkOV-YDZqjz3wasXH2-3LsHIp4EsEzdlmnmfq7uWV0sYEKzW0rl19nBlH-A3wrq1zcrki4V5vUOWDVdcU9k9HfO2tNKUzNhckSbjGJuhZJmy70mBzCUMvtOJ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7fFYgvwarAH_G095z99_3K4lqCrHZMWEugkpiEjRdDcYozEIWaVaHcgLIJOX3Cyy2hK1t8asfORvIickqShX1c07h_mUpZ_xvi0_q0uBqX5t0i4XGntjbH41VWT33L1b5SRgZfaT18ooe1LjTmAQ4kiIZ1LaB7Y8VbgrSkD9EtgjpDhtw8_TbQ9GpX-d492vu2-3QHeih66WoywGlakxs4ca_9Gqi5D1RX3oMXAcB35cS3rGUAaByCu7CO7w4pavCwdKA5iSNggomLwe0k1Sq3B9VjERHLa9l0FeBgLvT328OXEz1ezuIcL3ddOWmcWraPL0h3tfrxDXFstrcgVHxtv7Nh3enJT19_8EI-Z4_gcwBINIAjNdapGt40VNOeRHV5vI4jPaQzDDDwcZOqWuy2-3M_fVg16BnjwbMZ4cvFgsr3QYUpbUbxjB8RRZTBH-SBhYPTtb0jmCv8S62Ml0f0QZSzzGjSTisYSyjhqeHWciUVXsOpCgGxm9Rf9l_4Ni6e5E09OSpbDmu5oWgPUt0vyQtTyLSZ-gQmhZfMFUy1O2sTbk_XAhnfYvqpXvRpjvVYr_ntTJL0ZPGabtfZD1jIuk2S3pW0Bzju4OVN4QmuqnU9KMzHBqFhJCvNP2I-xKaKBU_nNy7AfmTYx5F_D4E1t4T7_rz8EXYEd4cCAQBX6fAG0N-tVZwoTsnjS_1H25vwC4YSdT80T4fPajlir3GNrCeHYhCfeRSHQX1JGEhmBGoKkqfXu9CvdkY7k7Iuf7g90l4sKTguZcIiJO_1M48H9dsWt1qGZ2r71nB
When the data is decoded this string pops out
0{"id":"C5278980003","assets":[{"renditions":[{"renditionid":0,"format":"SD","bitrates":[160,360,480,800,1200,1500],"url":"https://hwdash.channel5.com/cenc/C5278980003/C5278980003A/20200304115757/C5278980003A-tt.mpd"}],"profile":"dash1","drm":"widevine","keyserver":"https://cassie.channel5.com/api/v2/licences/widevine/208/C5278980003?expiry=1676633142&tag=31386632333364623866323366373462366661663134373966393035643563616364333231626561","version":"A","subtitled":true,"subtitleurl":"https://akasubs.akamaized.net/webvtt/C5278980003/C5278980003A.vtt","thumbnailsurl":"https://akathumbnails.channel5.com/C5278980003A/thumbnails.vtt","audiodescribed":false,"duration":2707},{"renditions":[{"renditionid":0,"format":"SD","bitrates":[160,360,480,800,1200,1500],"url":"https://akadash0.akamaized.net/cenc/C5278980003/C5278980003A/20200304115757/C5278980003A-tt.mpd"}],"profile":"dash1","drm":"playready","keyserver":"https://playreadydrm.channel5.com/v2/rightsmanager.asmx?x=NjM3YjllMWQtODdlOS00M2U4LTk1MjYtODZkN2E3YzAzNDg4OzE2LzAyLzIwMjMgMTQ6MjU6NDI7TUgwUjhDNm5SdWJkL1hmekNJWlc5djVtZDUyUXRQNEdpZUw4SFpSU3hwUT07UFMz","version":"A","subtitled":true,"subtitleurl":"https://akasubs.akamaized.net/webvtt/C5278980003/C5278980003A.vtt","thumbnailsurl":"https://akathumbnails.channel5.com/C5278980003A/thumbnails.vtt","audiodescribed":false,"duration":2707},{"renditions":[{"renditionid":0,"format":"SD","bitrates":[160,360,480,800,1200,1500],"url":"https://hwhls.channel5.com/fps/C5278980003/C5278980003A/20200304115800/C5278980003A.m3u8"}],"profile":"fpshls1","drm":"fairplay","keyserver":"https://cassie.channel5.com/api/v2/licences/fairplay/220/C5278980003?expiry=1676633142&tag=61346461363766393931623665333464323138613362656261346164656164663064383863366465","version":"A","subtitled":true,"thumbnailsurl":"https://akathumbnails.channel5.com/C5278980003A/thumbnails.vtt","audiodescribed":false,"duration":2707}]} {'id': 'C5278980003', 'assets': [{'renditions': [{'renditionid': 0, 'format': 'SD', 'bitrates': [160, 360, 480, 800, 1200, 1500], 'url': 'https://hwdash.channel5.com/cenc/C5278980003/C5278980003A/20200304115757/C5278980003A-tt.mpd'}], 'profile': 'dash1', 'drm': 'widevine', 'keyserver': 'https://cassie.channel5.com/api/v2/licences/widevine/208/C5278980003?expiry=1676633142&tag=31386632333364623866323366373462366661663134373966393035643563616364333231626561', 'version': 'A', 'subtitled': True, 'subtitleurl': 'https://akasubs.akamaized.net/webvtt/C5278980003/C5278980003A.vtt', 'thumbnailsurl': 'https://akathumbnails.channel5.com/C5278980003A/thumbnails.vtt', 'audiodescribed': False, 'duration': 2707}, {'renditions': [{'renditionid': 0, 'format': 'SD', 'bitrates': [160, 360, 480, 800, 1200, 1500], 'url': 'https://akadash0.akamaized.net/cenc/C5278980003/C5278980003A/20200304115757/C5278980003A-tt.mpd'}], 'profile': 'dash1', 'drm': 'playready', 'keyserver': 'https://playreadydrm.channel5.com/v2/rightsmanager.asmx?x=NjM3YjllMWQtODdlOS00M2U4LTk1MjYtODZkN2E3YzAzNDg4OzE2LzAyLzIwMjMgMTQ6MjU6NDI7TUgwUjhDNm5SdWJkL1hmekNJWlc5djVtZDUyUXRQNEdpZUw4SFpSU3hwUT07UFMz', 'version': 'A', 'subtitled': True, 'subtitleurl': 'https://akasubs.akamaized.net/webvtt/C5278980003/C5278980003A.vtt', 'thumbnailsurl': 'https://akathumbnails.channel5.com/C5278980003A/thumbnails.vtt', 'audiodescribed': False, 'duration': 2707}, {'renditions': [{'renditionid': 0, 'format': 'SD', 'bitrates': [160, 360, 480, 800, 1200, 1500], 'url': 'https://hwhls.channel5.com/fps/C5278980003/C5278980003A/20200304115800/C5278980003A.m3u8'}], 'profile': 'fpshls1', 'drm': 'fairplay', 'keyserver': 'https://cassie.channel5.com/api/v2/licences/fairplay/220/C5278980003?expiry=1676633142&tag=61346461363766393931623665333464323138613362656261346164656164663064383863366465', 'version': 'A', 'subtitled': True, 'thumbnailsurl': 'https://akathumbnails.channel5.com/C5278980003A/thumbnails.vtt', 'audiodescribed': False, 'duration': 2707}]}
If you can work out how to get to the result from the inputs with some a few lines of python using the crypto/Crypto.Cipher libraries
try: from Crypto.Cipher import AES except ImportError: from Cryptodome.Cipher import AES
"WE" should be good to go .....
Thankyou!
Thanx for your enthusiasm. The logic in the program comes from stepping through html5-c5-player.js in chrome developer tools line by line many times over and over again and translating the js stuff to python
If you have a uk IP address, you can run this attached python program taht will output the aes key, iv, data and the decoded form of the data.
c5.txt If that dose not work i can repost the outputs
Buy that man a Bells! Thankyou this works like a treat .... i have done a few iterations of testing and all looks golden! I see in your decoding i also don't have the leading 0 which mine produced in the json string.
So my part2 now looks like
def part2(iv, aesKey, rdata): realIv = padAndB64(mangle(iv)) realAesKey = padAndB64(mangle(aesKey)) realRData = base64.b64decode(mangle(rdata)) cipher = AES.new(realAesKey, AES.MODE_CBC, iv=realIv) dataToParse=unpad(cipher.decrypt(realRData),16) (stream, drmurl, sub) = getUseful(dataToParse.decode('utf-8')) return (stream, drmurl, sub)
astring = str(dataToParse) dose not do what i think it should in python3, python3 needs the encoding type.
Now i need to remove all the extras i had in my code to manually do the decoding and remove any other extra crap and see if the version is neat enough to join CUTVM
Again thankyou, this is brilliant!
Funny you mentioned that, I was about to get to ask you about more work to do :)
There is another part of manual processing i do Its in function def getdata(ui)
After the info is pulled from the js file and processed, some magic/logic needs to happen to get the auth string to retrieve the auth key used in the url taht pulls the iv and data that have elegantly decoded for us. I think it might be some form of HMAC. Its not as clear as previous thing, i have updated c5.py to remove a lot of crap now and indicate where your next logic adventure is, look from line 315 in new c5.txt attached
if you have the time to solve this then we should be good to go ......
thankyou again!
Thankyou again, no rush My day job dose not involve python or javascript at all :)
Can't you use ljust method for null padding?
There is no easy way in python to xorify two strings. So I think the way you choosed is fine.
def url_parse(queryStr): unicodestring=urllib.parse.unquote(queryStr) return [ord(c) for c in unicodestring]
does not work?
Thankyou VERY much all for your suggestions. I have cleaned up the code and got rid of unnecessaries i could find.
Here is a full zip of CUTVM and just the my5.py (as my5.txt)
plugin.video.catchuptvandmore-dev-ch5.zip
And the my5.txt my5.txt
@berkhornet if you have the time, if you don't mind giving a test to see all still works as before. I have done some checking myself and all seems good.
If anybody is still using Kodi18, here is a version of my5.txt with all the crypto libraries etc that works on Kodi18 my5-KODI18.txt
I have updated the files above, as per your request.
@nictjir I've installed the updated my5.py file and all has tested successfully. Many thanks to all who contributed to the development
Thankyou @berkhornet I have created a fork and a pull request for the dev branch
The PR has failed with some errors that look to be a git hub thing i think
Not sure what to do next .....
i think @joaopa00 has added comments on the actual pull request
Thakyou, busy working through them and learning what flake8 means and needs ...
On Sun, 19 Feb 2023, 13:10 berkhornet, @.***> wrote:
i think @joaopa00 https://github.com/joaopa00 has added comments on the actual pull request
— Reply to this email directly, view it on GitHub https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore/issues/973#issuecomment-1435959281, or unsubscribe https://github.com/notifications/unsubscribe-auth/APEBPDHFFP44MXZMMG35563WYH5TTANCNFSM6AAAAAARFZNBTY . You are receiving this because you were mentioned.Message ID: <Catch-up-TV-and-More/plugin.video.catchuptvandmore/issues/973/1435959281@ github.com>
@berkhornet would you mind please retesting this update, i have tried to accomidate all the issues resulting in the pr not being accepted.
Alas the insertion of the My5 logo from local store as a a picie instead of the CUTVM logo had to be axed :( I tried to find an image on the channel5 site to use - so i don't need to point to local storage, but could not find anything useful except for https://api-images.channel5.com/otis/images/channel/C5/140x50.png which dose not work well. If you can find one i will happily add it in.
Here is full zip again plugin.video.catchuptvandmore-dev-ch5.zip
or just the my5 as a txt my5.txt
Thankyou again.
@nictjir all looks good apart from when selecting Documentaries category I get an IndexError. Extract from log:
2023-02-20 12:48:47.504 T:29688 error
Thankyou @berkhornet for quick response. The one thing i did not test, apologies an omission caused by making code flake8 happy
If you can retest please my5.txt
plugin.video.catchuptvandmore-dev-ch5.zip
Thankyou gain
I’ve tested Documentaries again and confirm the issue is fixed.
Mick
From: nictjir @.> Sent: Monday, February 20, 2023 1:38:16 PM To: Catch-up-TV-and-More/plugin.video.catchuptvandmore @.> Cc: berkhornet @.>; Mention @.> Subject: Re: [Catch-up-TV-and-More/plugin.video.catchuptvandmore] Reinstate UK Channel 5 (My5) (Issue #973)
Thankyou @berkhornethttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fberkhornet&data=05%7C01%7C%7C6bdbfdf5e3ac4562d39d08db1347b8d7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638124970988099689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ezr%2FGlZGVG9aCDA9gRj0aIPwwls2p1FvnPKYNoj%2BusI%3D&reserved=0 for quick response. The one thing i did not test, apologies an omission caused by making code flake8 happy
Thankyou gain
— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FCatch-up-TV-and-More%2Fplugin.video.catchuptvandmore%2Fissues%2F973%23issuecomment-1437039326&data=05%7C01%7C%7C6bdbfdf5e3ac4562d39d08db1347b8d7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638124970988099689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NqriFNUWOsx08Nhs%2Bd966UfAgpwH%2FflaTdEOcsZ%2Bt8g%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQFFLX2FSAJNTPXGBX5QNFTWYNXURANCNFSM6AAAAAARFZNBTY&data=05%7C01%7C%7C6bdbfdf5e3ac4562d39d08db1347b8d7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638124970988099689%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=HNi0xVbY4R2zm7cqxbcV52pgAIgIv8WN4Voyc4tNHKM%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>
Thankyou kindly!
At least, the replay part is merged now.
And now it is live. So this issue is fixed. Thanks to everybody for your hard work.
Would it be possible to reinstate the Live and Catch Up options for UK Channel 5 (My5)? Looking at the code it was previously available but is now disabled.
Many thanks.
I have a My5 account and would be happy to test if this were possible.