cognito and vier coding guidelines update
This commit is contained in:
parent
efc2dbd3a5
commit
1430955192
@ -1,14 +1,13 @@
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import ExtractorError
|
from ..utils import ExtractorError
|
||||||
|
|
||||||
class CognitoBaseIE(InfoExtractor):
|
|
||||||
|
|
||||||
|
class CognitoBaseIE(InfoExtractor):
|
||||||
|
|
||||||
def _cognito_login(self, auth_data):
|
def _cognito_login(self, auth_data):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import boto3
|
import boto3
|
||||||
from warrant import Cognito
|
|
||||||
from warrant.aws_srp import AWSSRP
|
from warrant.aws_srp import AWSSRP
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ExtractorError('%s depends on boto3 and warrant.' % self.IE_NAME)
|
raise ExtractorError('%s depends on boto3 and warrant.' % self.IE_NAME)
|
||||||
|
@ -13,6 +13,7 @@ from ..utils import (
|
|||||||
|
|
||||||
from .cognito import CognitoBaseIE
|
from .cognito import CognitoBaseIE
|
||||||
|
|
||||||
|
|
||||||
class VierVijfKijkOnlineIE(CognitoBaseIE):
|
class VierVijfKijkOnlineIE(CognitoBaseIE):
|
||||||
IE_NAME = 'viervijfkijkonline'
|
IE_NAME = 'viervijfkijkonline'
|
||||||
IE_DESC = 'vier.be and vijf.be - Kijk Online'
|
IE_DESC = 'vier.be and vijf.be - Kijk Online'
|
||||||
@ -39,7 +40,6 @@ class VierVijfKijkOnlineIE(CognitoBaseIE):
|
|||||||
_POOL_ID = 'eu-west-1_dViSsKM5Y'
|
_POOL_ID = 'eu-west-1_dViSsKM5Y'
|
||||||
_CLIENT_ID = '6s1h851s8uplco5h6mqh1jac8m'
|
_CLIENT_ID = '6s1h851s8uplco5h6mqh1jac8m'
|
||||||
|
|
||||||
|
|
||||||
def _real_initialize(self):
|
def _real_initialize(self):
|
||||||
self._logged_in = False
|
self._logged_in = False
|
||||||
self.id_token = ''
|
self.id_token = ''
|
||||||
@ -62,9 +62,6 @@ class VierVijfKijkOnlineIE(CognitoBaseIE):
|
|||||||
self._logged_in = True
|
self._logged_in = True
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
site = mobj.group('site')
|
|
||||||
|
|
||||||
if not self._logged_in:
|
if not self._logged_in:
|
||||||
self._login()
|
self._login()
|
||||||
|
|
||||||
@ -111,6 +108,7 @@ class VierVijfKijkOnlineIE(CognitoBaseIE):
|
|||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class VierIE(InfoExtractor):
|
class VierIE(InfoExtractor):
|
||||||
IE_NAME = 'vier'
|
IE_NAME = 'vier'
|
||||||
IE_DESC = 'vier.be and vijf.be'
|
IE_DESC = 'vier.be and vijf.be'
|
||||||
@ -295,6 +293,7 @@ class VierIE(InfoExtractor):
|
|||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class VierVideosIE(InfoExtractor):
|
class VierVideosIE(InfoExtractor):
|
||||||
IE_NAME = 'vier:videos'
|
IE_NAME = 'vier:videos'
|
||||||
_VALID_URL = r'https?://(?:www\.)?(?P<site>vier|vijf)\.be/(?P<program>[^/]+)/videos(?:\?.*\bpage=(?P<page>\d+)|$)'
|
_VALID_URL = r'https?://(?:www\.)?(?P<site>vier|vijf)\.be/(?P<program>[^/]+)/videos(?:\?.*\bpage=(?P<page>\d+)|$)'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user