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

TF1Plus: 403 when fetching index.mpd #1428

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions resources/lib/channels/fr/tf1plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,15 @@ def get_live_url(plugin, item_id, **kwargs):
}
params = {
'context': 'MYTF1',
'pver': '5010000',
'pver': '5029000',
'platform': 'web',
'device': 'desktop',
'os': 'windows',
'osVersion': '10.0',
'topDomain': 'unknown',
'playerVersion': '5.10.0',
'playerVersion': '5.29.0',
'productName': 'mytf1',
'productVersion': '2.59.1'
'productVersion': '3.37.0'
}

url_json = URL_VIDEO_STREAM % video_id
Expand Down Expand Up @@ -435,4 +435,5 @@ def get_live_url(plugin, item_id, **kwargs):

return resolver_proxy.get_stream_with_quality(plugin, video_url=video_url,
manifest_type="mpd", license_url=license_url,
workaround=workaround, headers=license_headers)
workaround=workaround, headers=headers_video_stream,
custom_license_headers=license_headers)
6 changes: 4 additions & 2 deletions resources/lib/resolver_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def get_stream_with_quality(plugin,
video_url,
manifest_type="hls",
headers=None,
custom_license_headers=None,
license_url=None,
map_audio=False,
append_query_string=False,
Expand All @@ -193,7 +194,8 @@ def get_stream_with_quality(plugin,
:param plugin: plugin
:param str video_url: The url to download
:param str manifest_type: Manifest type
:param dict headers: the headers
:param dict headers: the headers, always used for stream, and license only if custom_license_headers is not set
:param dict custom_license_headers: the license headers, used only for the license, leaving 'headers' only for the stream part
:param str license_url: licence url
:param bool append_query_string: Should the existing query string be appended?
:param bool map_audio: Map audio streams
Expand Down Expand Up @@ -264,7 +266,7 @@ def get_stream_with_quality(plugin,
if license_url is not None:

if '|' not in license_url: # add headers only if they are not already in the url
license_url = '%s|%s|R{SSM}|' % (license_url, stream_headers)
license_url = '%s|%s|R{SSM}|' % (license_url, urlencode(custom_license_headers) if custom_license_headers else stream_headers) # use custom_license_headers only if it is set, else fallback to stream_headers
item.property['inputstream.adaptive.license_key'] = license_url

if input_stream_properties is not None:
Expand Down