Skip to content

Commit

Permalink
Improve PR #10
Browse files Browse the repository at this point in the history
  • Loading branch information
melmorabity committed Mar 5, 2024
1 parent 9dfad7e commit bcfbad4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions resources/lib/video.py
Expand Up @@ -84,11 +84,14 @@ def get_video_url(self, video_id, dash=True):
},
).json()

video_url = self._session.get("https://hdfauth.ftven.fr/esi/TA",
params={
"format": "json",
"url": data.get("video", {}).get("url")
}).json().get("url")
url = data.get("video", {}).get("url")
token = data.get("video", {}).get("token")
if not token or not url:
raise FranceTVVideoException()

video_url = (
self._session.get(token, params={"url": url}).json().get("url")
)
if not video_url:
raise FranceTVVideoException()

Expand Down

0 comments on commit bcfbad4

Please sign in to comment.