Skip to content

Commit

Permalink
[toutv] Corrects issues #16398 - account don't work after redesign.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Huot committed Dec 31, 2018
1 parent e1a0628 commit 5b2fdda
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions youtube_dl/extractor/toutv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
urlencode_postdata,
extract_attributes,
smuggle_url,
Expand Down Expand Up @@ -46,14 +45,13 @@ def _real_initialize(self):
email, password = self._get_login_info()
if email is None:
return
state = 'http://ici.tou.tv/'
webpage = self._download_webpage(state, None, 'Downloading homepage')
toutvlogin = self._parse_json(self._search_regex(
r'(?s)toutvlogin\s*=\s*({.+?});', webpage, 'toutvlogin'), None, js_to_json)
authorize_url = toutvlogin['host'] + '/auth/oauth/v2/authorize'
state = 'http://ici.tou.tv/app.js'
webpage = self._download_webpage(state, None, 'Downloading app.js script')
client_id = self._search_regex(r'document\.URL:{clientId:"(.+?)"', webpage, 'toutvclientid')
authorize_url = 'https://services.radio-canada.ca/auth/oauth/v2/authorize'
login_webpage = self._download_webpage(
authorize_url, None, 'Downloading login page', query={
'client_id': toutvlogin['clientId'],
'client_id': client_id,
'redirect_uri': 'https://ici.tou.tv/login/loginCallback',
'response_type': 'token',
'scope': 'media-drmt openid profile email id.write media-validation.read.privileged',
Expand Down

0 comments on commit 5b2fdda

Please sign in to comment.