|
1 | 1 | # ruff: noqa: D102 |
2 | 2 | """Orange provider template.""" |
3 | 3 |
|
| 4 | +import json |
4 | 5 | import re |
5 | 6 | from abc import ABC |
6 | 7 | from datetime import date, datetime, timedelta |
|
30 | 31 | _LIVE_HOMEPAGE_URL = "https://chaines-tv.orange.fr/" |
31 | 32 | _CATCHUP_VIDEO_URL = "https://replay.orange.fr/videos/{stream_id}" |
32 | 33 | _LOGIN_URL = "https://login.orange.fr" |
33 | | -_LOGIN_URL = "https://login.orange.fr" |
34 | 34 |
|
35 | 35 |
|
36 | 36 | class AbstractOrangeProvider(AbstractProvider, ABC): |
@@ -259,20 +259,9 @@ def _retrieve_auth_data(self, auth_url: str, login: str = None, password: str = |
259 | 259 | tv_token, tv_token_expires, wassup = ( |
260 | 260 | provider_session_data.get(k) for k in ("tv_token", "tv_token_expires", "wassup") |
261 | 261 | ) |
262 | | - tv_token, tv_token_expires, wassup = ( |
263 | | - provider_session_data.get(k) for k in ("tv_token", "tv_token_expires", "wassup") |
264 | | - ) |
265 | 262 |
|
266 | 263 | if not tv_token_expires or datetime.utcnow().timestamp() > tv_token_expires: |
267 | | - URL_ROOT = "https://chaines-tv.orange.fr" |
268 | | - USER_AGENT_FIREFOX = "Mozilla/5.0 (Windows NT 10.0; rv:114.0) Gecko/20100101 Firefox/114.0" |
269 | 264 | session = Session() |
270 | | - session.headers = { |
271 | | - "User-Agent": USER_AGENT_FIREFOX, |
272 | | - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", |
273 | | - "Accept-Language": "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3", |
274 | | - "Accept-Encoding": "gzip, deflate, br", |
275 | | - } |
276 | 265 |
|
277 | 266 | if not self._is_wassup_expired(wassup): |
278 | 267 | log("Cookie reuse", xbmc.LOGINFO) |
|
0 commit comments