Added JOYNDE service
This commit is contained in:
@@ -28,7 +28,7 @@ class JOYNAT(Service):
|
||||
# List of regions of which the service offers support for.
|
||||
GEOFENCE = ("at")
|
||||
|
||||
TITLE_RE = r"^https?:\/\/www\.joyn\.at\/(?:play\/)?(?P<type>filme|serien)\/(?P<content_id>.+)$"
|
||||
TITLE_RE = r"^https?:\/\/www\.joyn\.at\/(?:play\/)?(?P<type>filme|serien|compilation)\/(?P<content_id>.+)$"
|
||||
AUTH_CODE_REGEX = r"[&?]code=([^&]+)"
|
||||
|
||||
@staticmethod
|
||||
@@ -85,13 +85,11 @@ class JOYNAT(Service):
|
||||
auth_url = self.config["endpoints"]["auth_url"]
|
||||
token_url = self.config["endpoints"]["token_url"]
|
||||
redirect_uri = self.config["endpoints"]["redirect_uri"]
|
||||
client_id = self.config["client"]["idc"]
|
||||
client_id = self.config["client"]["id"]
|
||||
|
||||
code_verifier = self.generate_code_verifier()
|
||||
code_challenge = self.generate_code_challenge(code_verifier)
|
||||
|
||||
self.session.cookies.update(cookies)
|
||||
|
||||
redirect_url_request = self.session.get(
|
||||
auth_url,
|
||||
headers={
|
||||
@@ -150,9 +148,8 @@ class JOYNAT(Service):
|
||||
|
||||
def _authenticate_anonymous(self) -> None:
|
||||
token_url = self.config["endpoints"]["anon_auth_url"]
|
||||
client_id = self.config["client"]["id"]
|
||||
anon_device_id = self.config["client"]["anon_device_id"]
|
||||
client_name = self.config["client"]["name"]
|
||||
anon_device_id = self.generate_code_verifier()
|
||||
|
||||
response = self.session.post(
|
||||
token_url,
|
||||
@@ -160,12 +157,11 @@ class JOYNAT(Service):
|
||||
**self.session.headers,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
json={'client_id': client_id, 'client_name': client_name, 'anon_device_id': anon_device_id},
|
||||
json={'client_id': anon_device_id, 'client_name': client_name, 'anon_device_id': anon_device_id},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
auth_response = response.json()
|
||||
self.log.info(f"Anonymous auth response: {auth_response}")
|
||||
|
||||
if 'access_token' in auth_response:
|
||||
self._joyn_auth_jwt = auth_response['access_token']
|
||||
@@ -367,12 +363,14 @@ class JOYNAT(Service):
|
||||
|
||||
playlist_data = playlist.json()
|
||||
|
||||
if not 'manifestUrl' in playlist_data or 'licenseUrl' not in playlist_data:
|
||||
self.log.error(f"Failed to fetch tracks playlist: 'manifestUrl' or 'licenseUrl' not in entitlement_data")
|
||||
if not 'manifestUrl' in playlist_data:
|
||||
self.log.error(f"Failed to fetch tracks playlist: 'manifestUrl' not in entitlement_data")
|
||||
raise EnvironmentError("Failed to fetch tracks playlist from Joyn service.")
|
||||
|
||||
manifest_url = playlist_data['manifestUrl']
|
||||
license_url = playlist_data['licenseUrl']
|
||||
|
||||
# Get license_url or set to None if not present
|
||||
license_url = playlist_data.get('licenseUrl', None)
|
||||
|
||||
all_tracks = DASH.from_url(manifest_url, self.session).to_tracks(language="de")
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ endpoints:
|
||||
playout: "https://api.vod-prd.s.joyn.de/v1/asset/{content_id}/playlist"
|
||||
|
||||
client:
|
||||
id: "bb4f9c4c-82ca-486d-8eb5-8aaf772df93c"
|
||||
idc: "ae892ce5-8920-4f38-b272-af7d1e242579"
|
||||
id: "ae892ce5-8920-4f38-b272-af7d1e242579"
|
||||
anon_device_id: "bb4f9c4c-82ca-486d-8eb5-8aaf772df93c"
|
||||
name: "web"
|
||||
api_key: "4f0fd9f18abbe3cf0e87fdb556bc39c8"
|
||||
Reference in New Issue
Block a user