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 90 forks source link

TF1PLUS - Live not starting - 403 error when fetching MPD index #1427

Open Nitorac opened 4 hours ago

Nitorac commented 4 hours ago

⚠️ Please try the last beta version and check existing issues before issuing a bug. ⚠️

Describe the bug

A clear and concise description of what the bug is:

When starting the Live channel for TF1 (via TF1Plus), it won't start, and the following error appears in the logs: AddOnLog: inputstream.adaptive: Download failed, HTTP error 403: https://live-tf1-das-secure.cdn-0.diff.tf1.fr/eyJhbGciOiJIUzI1NiIsInR5cCI6I<...redacted...>/index.mpd

To Reproduce

Steps to reproduce the behaviour:

  1. Enter valid credentials for TF1Plus in extension settings
  2. Try to start the live streaming of TF1
  3. It won't start with an error popup

EDIT: This may only happen during periods or programs when TF1Plus is using DRM.

Expected behaviour

A clear and concise description of what you expected to happen:

It should display the live streaming of the channel without an error

Actual behaviour

Tell us what happens instead:

The video palyer refuses to start, and the kodi.log mentions :

AddOnLog: inputstream.adaptive: Download failed, HTTP error 403: https://live-tf1-das-secure.cdn-0.diff.tf1.fr/eyJhbGciOiJIUzI1NiIsInR5cCI6I<...redacted...>/index.mpd

Screenshots

If applicable, add screenshots to help explain your problem:

Your environment

Additional context

Add any other context about the problem here:

Debug log

If you can, please add your debug log information (Tutorial available here: https://kodi.wiki/view/Log_file/Easy):

Here are the logs with cURL logging enabled and redacted tokens: https://paste.kodi.tv/tikaxewuci.kodi

Nitorac commented 4 hours ago

I may have solved the issue:

There is 2 bearer tokens used by tf1plus.py, one for account authentication and one for widevine session authorization.

The issue arises because the bearer passed to inputstream.adaptative is only the widevine one, and it is invalid for fetching the mpd file (that should be fetched using the account authentication token).

joaopa00 commented 3 hours ago

Unable to reproduce here with android and linux.

Nitorac commented 3 hours ago

Unable to reproduce here with android and linux.

I am testing around some things, and if I delete the Authorization header entirely from the MPD request, it's working. The error appears only if I give a "wrong" token.

cf HEADER_IN: Reason: edge-vhost/invalid-token

Nitorac commented 3 hours ago

I am sending a pull request soon since the fix seems not massive

Nitorac commented 3 hours ago

Unable to reproduce here with android and linux.

Okay, I think it's because some of TV shows are protected using DRM, and not others (earlier this evening I had DRM responses in the TF1Plus live, and now it seems that TF1Plus is not giving any Widevine or Playready authorizations)