Skip to content

Commit 5c2c0e5

Browse files
committed
Fix #451
1 parent fbd8090 commit 5c2c0e5

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

StreamingCommunity/Api/Player/Helper/Vixcloud/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def __init__(self, data: Dict[str, Any]):
1313
self.duration: int = data.get('duration', 0)
1414
self.url: str = data.get('url', '')
1515
self.mpd_id: str = data.get('mpd_id', '')
16+
self.channel: str = data.get('channel', '')
1617

1718
def __str__(self):
1819
return f"Episode(id={self.id}, number={self.number}, name='{self.name}', duration={self.duration} sec)"

StreamingCommunity/Api/Site/dmax/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
6464

6565
# Get m3u8 playlist
6666
bearer_token = get_bearer_token()
67-
master_playlist = get_playback_url(obj_episode.id, bearer_token)
67+
master_playlist = get_playback_url(obj_episode.id, bearer_token, False, obj_episode.channel)
6868

6969
# Download the episode
7070
hls_process = HLS_Downloader(

StreamingCommunity/Api/Site/realtime/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
6464

6565
# Get hls url
6666
bearer_token = get_bearer_token()
67-
master_playlist = get_playback_url(obj_episode.id, bearer_token)
67+
master_playlist = get_playback_url(obj_episode.id, bearer_token, False, obj_episode.channel)
6868

6969
# Download the episode
7070
hls_process = HLS_Downloader(

StreamingCommunity/Api/Site/realtime/util/ScrapeSerie.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def collect_info_season(self, number_season: int) -> None:
118118
'description': episode.get('description', ''),
119119
'duration': duration_minutes,
120120
'poster': episode.get('poster', {}).get('src', ''),
121+
'channel': "X-REALM-IT" if episode.get('channel') is None else "X-REALM-DPLAY"
121122
}
122123

123124
# Add episode to the season's episode manager

StreamingCommunity/Api/Site/realtime/util/get_license.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,27 @@
77

88

99

10-
def get_playback_url(video_id: str, bearer_token: str, get_dash=False) -> str:
10+
def get_playback_url(video_id: str, bearer_token: str, get_dash: bool, channel: str = "") -> str:
1111
"""
1212
Get the playback URL (HLS or DASH) for a given video ID.
1313
1414
Parameters:
1515
- video_id (str): ID of the video.
1616
"""
1717
headers = {
18-
'authorization': f'Bearer {bearer_token}',
18+
'authorization': f'Bearer {bearer_token[channel]['key']}',
1919
'user-agent': get_userAgent()
2020
}
2121

2222
json_data = {
23+
'deviceInfo': {
24+
"adBlocker": False,
25+
"drmSupported": True
26+
},
2327
'videoId': video_id,
2428
}
2529

26-
response = create_client().post('https://public.aurora.enhanced.live/playback/v3/videoPlaybackInfo', headers=headers, json=json_data)
30+
response = create_client().post(bearer_token[channel]['endpoint'], headers=headers, json=json_data)
2731

2832
if not get_dash:
2933
return response.json()['data']['attributes']['streaming'][0]['url']
@@ -39,6 +43,13 @@ def get_bearer_token():
3943
str: Token Bearer
4044
"""
4145
response = create_client(headers=get_headers()).get('https://public.aurora.enhanced.live/site/page/homepage/?include=default&filter[environment]=realtime&v=2')
42-
43-
# response.json()['userMeta']['realm']['X-REALM-DPLAY']
44-
return response.json()['userMeta']['realm']['X-REALM-IT']
46+
return {
47+
'X-REALM-IT': {
48+
'endpoint': 'https://public.aurora.enhanced.live/playback/v3/videoPlaybackInfo',
49+
'key': response.json()['userMeta']['realm']['X-REALM-IT']
50+
},
51+
'X-REALM-DPLAY': {
52+
'endpoint': 'https://eu1-prod.disco-api.com/playback/v3/videoPlaybackInfo',
53+
'key': response.json()['userMeta']['realm']['X-REALM-DPLAY']
54+
}
55+
}

0 commit comments

Comments
 (0)