Skip to content
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

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

Closed
2 of 3 tasks
kevwag opened this issue Apr 13, 2022 · 29 comments
Closed
2 of 3 tasks

Comments

@kevwag
Copy link

kevwag commented Apr 13, 2022

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:

  • Name: ALL4
  • Type [e.g. TV channel, Catch-up TV, Website, Radio]: TV Channels (x5) / Catch-up TV
  • Website URL: https:www.channel4.com
  • Content language/country: English / United Kingdom

Content access

  • This content or some part of this content require a free account
  • This content or some part of this content require a paid account
  • This content is geographically restricted

More information

N/A

@joaopa00
Copy link
Contributor

joaopa00 commented Apr 25, 2022

Do you know the api of this site?

@kevwag
Copy link
Author

kevwag commented Apr 26, 2022

Do you know the api of this site?

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

@joaopa00
Copy link
Contributor

joaopa00 commented May 12, 2022

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
Copy link
Author

kevwag commented May 12, 2022

@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
Copy link
Contributor

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

@kevwag
Copy link
Author

kevwag commented May 22, 2022

@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
Copy link
Contributor

joaopa00 commented May 22, 2022

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
Copy link
Author

kevwag commented May 23, 2022

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
Copy link
Contributor

It is different. It changes all the time.

@kevwag
Copy link
Author

kevwag commented May 23, 2022

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
Copy link
Contributor

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
Copy link
Author

kevwag commented May 25, 2022

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
Copy link
Contributor

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
Copy link
Author

kevwag commented May 25, 2022

@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
Copy link
Contributor

nictjir commented Sep 19, 2022

Trying to get the channel4 replay to work based on the thread at
xbmc/inputstream.adaptive#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
Copy link
Contributor

joaopa00 commented Sep 19, 2022

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

  • non rooted device android <=6 (lollipop or marshmallow, kitkat and below is not supported by the appli)
  • not using vpn (for sniffing you need a tun interface and vpn uses the only one available in android device).
    I have the first item but I do not live in UK. So item 2 is a stop point.

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
Copy link
Contributor

nictjir commented Sep 20, 2022

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

@nictjir
Copy link
Contributor

nictjir commented Sep 29, 2022

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
Copy link
Contributor

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

@nictjir
Copy link
Contributor

nictjir commented Sep 30, 2022

Indeed way way way cleaner! thankyou!

@joaopa00
Copy link
Contributor

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

@Arathonk
Copy link

Arathonk commented Oct 6, 2022

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
Copy link
Contributor

joaopa00 commented Oct 7, 2022

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
Copy link

Arathonk commented Oct 7, 2022

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
Copy link
Contributor

joaopa00 commented Oct 7, 2022

Do you have a UK IP?

@Arathonk
Copy link

Arathonk commented Oct 7, 2022

Do you have a UK IP?

Yes I do

@joaopa00
Copy link
Contributor

joaopa00 commented Oct 7, 2022

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

@kevwag
Copy link
Author

kevwag commented Oct 19, 2022

@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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants