Catch-up-TV-and-More / plugin.video.catchuptvandmore

Replay, Live TV and websites videos addon for Kodi
https://catch-up-tv-and-more.github.io
GNU General Public License v2.0
284 stars 89 forks source link

Please add ALL4 Channels and Catch-Up TV (UK Channel 4 Network, formerly known as 4OD) #767

Closed kevwag closed 2 years ago

kevwag commented 2 years ago

Content description

ALL4 is the streaming platform for the UK's Channel 4 Network. It includes Catch-up TV, Box Sets, and five live channels with EPG:

Content access

More information

N/A

joaopa00 commented 2 years ago

Do you know the api of this site?

kevwag commented 2 years ago

Do you know the api of this site?

http://developer.channel4.com/io-docs

joaopa00 commented 2 years ago

Here is a beginning of an attempt to implement Channel4 replay: https://github.com/joaopa00/Tests/blob/main/channel4.py

But I am stuck in retrieving request_id and message in payload. If someone has an idea, please share it !!

kevwag commented 2 years ago

@joaopa00
Thanks for doing this, it'll be awesome to have a bit more UK functionality :) (I think there's an error in your link URL - I get a 404 page)

joaopa00 commented 2 years ago

Sorry, the file is in my private github. Here is : test.txt

kevwag commented 2 years ago

@joaopa00 Am I able to paste that file into the addon on my system and try it out or does it need more work first?

joaopa00 commented 2 years ago

For now, this file fetches the title of the episodes only. It can not play any stream.

Recently, I had some progress in playing streams. But I still have problems to fetch the token.

kevwag commented 2 years ago

For now, this file fetches the title of the episodes only. It can not play any stream.

Recently, I had some progress in playing streams. But I still have problems to fetch the token.

Ah, ok. I remember that the recent fixes for UKTV Play involved hard-coding the token instead of scraping for it. Is that maybe an option or is this different?

joaopa00 commented 2 years ago

It is different. It changes all the time.

kevwag commented 2 years ago

Well that sucks then! Is there anything in the online API documentation about how to do it? There seemed to be quite a lot of documentation at the API URL that I posted but I was instantly out of my depths and didn't have a clue what any of it meant!

joaopa00 commented 2 years ago

On their site, I never managed to fetch a key. So I was never able to study their API. DO you know how to request a key?.

kevwag commented 2 years ago

Once you've signed up for a developer account at developer.channel4.com and you're logged in, the page to request an API Key is at developer.channel4.com/apps.

I noticed that on the interactive documentation page there are a bunch of different calls and methods for performing various functions and tasks. You can interactively try them all out and although the response is always "forbidden" without a valid API key entered, it does give you the URL construction format and other info that might be useful.

joaopa00 commented 2 years ago

I registered but received no key...

Channel 4 API Application Form Application Registered!

To get started using your API keys, dig into our documentation and feel free to ask questions in our forum. We look forward to seeing what you create!

kevwag commented 2 years ago

@joaopa00 Did you check on the developer.channel4.com/apps/mykeys and developer.channel4.com/apps/myapps pages?

The application form suggests that they manually approve key requests rather than automatically issuing a key like many other sites do. I found a couple of posts in the developer portal forum from other users who say they didn't receive a key. Those posts are a few years old but never received replies so I don't think anyone's actively monitoring the portal. I'm guessing that since the API is managed by a third-party company (Tibco), they probably don't want to pay for staff to monitor the portal for API requests or forum posts and most likely don't check the site at all unless the customer (Channel 4) asks them to do something.

I found an email address for Tibco support: support@tibco.com on an email confirming that I'd changed my dev account password. It's probably worth dropping them an email saying that you didn't receive a key because they probably won't check the site for a long time unless someone gives them a gentle nudge in the right direction.

nictjir commented 2 years ago

Trying to get the channel4 replay to work based on the thread at https://github.com/xbmc/inputstream.adaptive/issues/995

Where did you find the vale for the basic auth string? Proxy-Authorization=Basic cDluOGl6YWctcmh3dXl6OTpjamJ5NTZ0dTc5

I have looked through hours of developer tools outputs and output from chrome://net-export/ and can't see where the basic auth string comes from?

any pointers will be a great help to try and help me get this to work.

joaopa00 commented 2 years ago

When I uses browser in Linux, I am stuck at fetching the cookie set by Google Recaptcha. Here is my work in progress. Obviously, you can use it. The best bet is to use the apk of the android version. But this appli is very picky. It refuses rooted devices. And apktool is unable to recompile it. So to sniff in this apk you need

Here is a link to learn how to sniff ssl traffic in android. https://www.exandroid.dev/2021/03/21/capture-all-android-network-traffic/

channel4.py

nictjir commented 2 years ago

Thankyou for sharing your code and ideas. I am also out of the uk :( Will try and get it to work

nictjir commented 2 years ago

I have based this script on the one from joaopa00 above and addedd in bits to get the access token. the attached script works to watch the channel4 catchup stuff. This works for me in kodi 18 on python 2. (will not work on Kodi 19 as is)

Put the script in (rename it from channel4.txt to channel4.py) .kodi/addons/plugin.video.catchuptvandmore/resources/lib/channels/uk/channel4.py

In .kodi/addons/plugin.video.catchuptvandmore/resources/lib/skeletons/uk_replay.py add "channel4": { "route": "/resources/lib/channels/uk/channel4:list_categories", "label": "Channel4", "thumb": "channels/uk/blaze.png", "fanart": "channels/uk/blaze_fanart.jpg", "enabled": True, "order": 1, },

channel4.txt

joaopa00 commented 2 years ago

Thank you for your hard work. However, I had already pushed a seemly cleaner solution in Git.

nictjir commented 2 years ago

Indeed way way way cleaner! thankyou!

joaopa00 commented 2 years ago

And now, the lives are implemented in git. Time to close this issue.

Arathonk commented 2 years ago

And now, the lives are implemented in git. Time to close this issue.

What are the steps? Because I don't really understand what to do, I have the Catch-up Tv & More addon installed but there's no Channel4/All4.

joaopa00 commented 2 years ago

For now, you need to install the beta version. Have a look at https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore When the stable version is released, you will be able to install it

Arathonk commented 2 years ago

For now, you need to install the beta version. Have a look at https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore When the stable version is released, you will be able to install it

Yes found it, unfortunately it's not working, when going to Channel 4, and click any show, it just doesn't want to load the show.

joaopa00 commented 2 years ago

Do you have a UK IP?

Arathonk commented 2 years ago

Do you have a UK IP?

Yes I do

joaopa00 commented 2 years ago

Please attach the log from Kodi here (as a text file)

kevwag commented 2 years ago

@joaopa00 Sorry for making the request and then seemingly disappearing, I've had a lot going on lately and haven't had time to keep up with everything. I did notice the channel 4 section appear in the beta so first of all I'd like to thank you for your hard work, especially with the IPTV integration, it's great that we're getting closer to restoring full Freeview functionality in Kodi without the need for DVB tuners.

I've noticed a bit of a bug in the on-demand section: It's only recognising and playing streams that are TV show episodes and that are contained in numbered season folders. Movies, shows that only have a single season, one-off's and special episodes don't work, it's as if Kodi is trying to open the url as a folder listing instead of playing it as a stream.

Example: Browse to Catch-up>>United Kingdom>>Channel 4>>Comedy>>Bad Robots: Comedy Blap This show only has one season, selecting it produces error: RuntimeError>>no items found The same error happens when trying to play any movie or on-off show directly from the comedy menu.

Special episodes of a TV show produce a slightly different error:

Example: Browse to Catch-up>>United Kingdom>>Channel 4>>Comedy>>The Windsors There are three season folders titled "Series 1", "Series 2", "Series 3" and also folders titled "Christmas Special" and "Royal Wedding Special". The three season folders work fine but selecting either of the specials produces the error: IndexError>>list out of range, I'm guessing that's because it's trying to open the url as a list of folder contents when it should be playing the url as a stream.

Other than this bug, everything else seems good. The epg data's missing for the live channels but that's a known issue affecting all the UK channel listings. The issue has its own error report but that's been open for months without a single response, so I don't know if it'll ever get fixed.

PS... I noticed you guys mentioning problems sniffing traffic whilst using a vpn. Most home broadband routers these days have a config page where you can make the router act as the vpn gateway. If you've got an old router you don't use, you could set it up as a vpn gateway, freeing up that tun in android whilst not interfering with. the availability of your main router's connection.

joaopa00 commented 2 years ago

Should be fixed in git (or just wait for the next beta release). Thanks for the report. But please, the next time, don't recycle this closed bug report. If you want to report an issue, please open a new ticket.