From da992938609dc62ce5d5d28b23f6ae27e179b207 Mon Sep 17 00:00:00 2001 From: Aniruddh Joshi Date: Sun, 7 Oct 2018 02:24:55 +0530 Subject: [PATCH 1/2] Philo MSO Added support for Philo MSO --- youtube_dl/extractor/adobepass.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 1cf2dcbf3..8a2a51d1e 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -9,6 +9,7 @@ from .common import InfoExtractor from ..compat import ( compat_kwargs, compat_urlparse, + compat_getpass ) from ..utils import ( unescapeHTML, @@ -55,6 +56,10 @@ MSO_INFO = { 'username_field': 'IDToken1', 'password_field': 'IDToken2', }, + 'Philo': { + 'name': 'Philo', + 'username_field': 'email' + }, 'Verizon': { 'name': 'Verizon FiOS', 'username_field': 'IDToken1', @@ -1455,6 +1460,23 @@ class AdobePassIE(InfoExtractor): mvpd_confirm_page, urlh = mvpd_confirm_page_res if '' in mvpd_confirm_page: post_form(mvpd_confirm_page_res, 'Confirming Login') + elif mso_id == 'Philo': + # Comcast page flow varies by video site and whether you + # are on Comcast's network. + mvpd_auth_code_res = self._download_json( + 'https://idp.philo.com/auth/init/login_code', video_id, 'Requesting auth code', data=urlencode_postdata({ + 'ident': username, + 'device': 'web', + 'send_confirm_link': False, + 'send_token': True + })) + philo_code = compat_getpass('Type auth code you have received [Return]: ') + confirm_token = self._download_json( + 'https://idp.philo.com/auth/update/login_code', video_id, 'Submitting token', data=urlencode_postdata({ + 'token': philo_code + })) + mvpd_confirm_page_res = self._download_webpage_handle('https://idp.philo.com/idp/submit', video_id, 'Confirming Philo Login') + post_form(mvpd_confirm_page_res, 'Confirming Login') elif mso_id == 'Verizon': # In general, if you're connecting from a Verizon-assigned IP, # you will not actually pass your credentials. From a9e7233d10859d28cf79a40e5bc04caa99f9e219 Mon Sep 17 00:00:00 2001 From: Aniruddh Joshi Date: Sun, 7 Oct 2018 02:29:24 +0530 Subject: [PATCH 2/2] Cleanup --- youtube_dl/extractor/adobepass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 8a2a51d1e..dbcfceff6 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -1463,7 +1463,7 @@ class AdobePassIE(InfoExtractor): elif mso_id == 'Philo': # Comcast page flow varies by video site and whether you # are on Comcast's network. - mvpd_auth_code_res = self._download_json( + self._download_webpage( 'https://idp.philo.com/auth/init/login_code', video_id, 'Requesting auth code', data=urlencode_postdata({ 'ident': username, 'device': 'web', @@ -1471,7 +1471,7 @@ class AdobePassIE(InfoExtractor): 'send_token': True })) philo_code = compat_getpass('Type auth code you have received [Return]: ') - confirm_token = self._download_json( + self._download_webpage( 'https://idp.philo.com/auth/update/login_code', video_id, 'Submitting token', data=urlencode_postdata({ 'token': philo_code }))