1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-22 10:11:52 +00:00

[adobepass] add IE suffix to the extractor and remove duplicate constant

This commit is contained in:
Remita Amine 2016-08-15 21:36:34 +01:00
parent cbef4d5c9f
commit 818ac213eb
6 changed files with 12 additions and 13 deletions

View file

@ -13,7 +13,7 @@ from ..utils import (
) )
class AdobePass(InfoExtractor): class AdobePassIE(InfoExtractor):
_SERVICE_PROVIDER_TEMPLATE = 'https://sp.auth.adobe.com/adobe-services/%s' _SERVICE_PROVIDER_TEMPLATE = 'https://sp.auth.adobe.com/adobe-services/%s'
_USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0' _USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0'

View file

@ -1,7 +1,7 @@
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
from .adobepass import AdobePass from .adobepass import AdobePassIE
from ..utils import ( from ..utils import (
update_url_query, update_url_query,
extract_attributes, extract_attributes,
@ -10,7 +10,7 @@ from ..utils import (
) )
class FXNetworksIE(AdobePass): class FXNetworksIE(AdobePassIE):
_VALID_URL = r'https?://(?:www\.)?fxnetworks\.com/video/(?P<id>\d+)' _VALID_URL = r'https?://(?:www\.)?fxnetworks\.com/video/(?P<id>\d+)'
_TEST = { _TEST = {
'url': 'http://www.fxnetworks.com/video/719841347694', 'url': 'http://www.fxnetworks.com/video/719841347694',

View file

@ -3,7 +3,7 @@ from __future__ import unicode_literals
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from .theplatform import ThePlatformIE from .adobepass import AdobePassIE
from ..utils import ( from ..utils import (
smuggle_url, smuggle_url,
url_basename, url_basename,
@ -65,7 +65,7 @@ class NationalGeographicVideoIE(InfoExtractor):
} }
class NationalGeographicIE(ThePlatformIE): class NationalGeographicIE(AdobePassIE):
IE_NAME = 'natgeo' IE_NAME = 'natgeo'
_VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:wild/)?[^/]+/(?:videos|episodes)/(?P<id>[^/?]+)' _VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:wild/)?[^/]+/(?:videos|episodes)/(?P<id>[^/?]+)'
@ -131,7 +131,7 @@ class NationalGeographicIE(ThePlatformIE):
} }
class NationalGeographicEpisodeGuideIE(ThePlatformIE): class NationalGeographicEpisodeGuideIE(InfoExtractor):
IE_NAME = 'natgeo:episodeguide' IE_NAME = 'natgeo:episodeguide'
_VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:wild/)?(?P<id>[^/]+)/episode-guide' _VALID_URL = r'https?://channel\.nationalgeographic\.com/(?:wild/)?(?P<id>[^/]+)/episode-guide'
_TESTS = [ _TESTS = [

View file

@ -1,13 +1,13 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from .theplatform import ThePlatformIE from .adobepass import AdobePassIE
from ..utils import ( from ..utils import (
update_url_query, update_url_query,
smuggle_url, smuggle_url,
) )
class SyfyIE(ThePlatformIE): class SyfyIE(AdobePassIE):
_VALID_URL = r'https?://www\.syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)' _VALID_URL = r'https?://www\.syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)'
_TESTS = [{ _TESTS = [{
'url': 'http://www.syfy.com/theinternetruinedmylife/videos/the-internet-ruined-my-life-season-1-trailer', 'url': 'http://www.syfy.com/theinternetruinedmylife/videos/the-internet-ruined-my-life-season-1-trailer',

View file

@ -9,7 +9,7 @@ import hashlib
from .once import OnceIE from .once import OnceIE
from .adobepass import AdobePass from .adobepass import AdobePassIE
from ..compat import ( from ..compat import (
compat_parse_qs, compat_parse_qs,
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
@ -93,7 +93,7 @@ class ThePlatformBaseIE(OnceIE):
return self._parse_theplatform_metadata(info) return self._parse_theplatform_metadata(info)
class ThePlatformIE(ThePlatformBaseIE, AdobePass): class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
_VALID_URL = r'''(?x) _VALID_URL = r'''(?x)
(?:https?://(?:link|player)\.theplatform\.com/[sp]/(?P<provider_id>[^/]+)/ (?:https?://(?:link|player)\.theplatform\.com/[sp]/(?P<provider_id>[^/]+)/
(?:(?:(?:[^/]+/)+select/)?(?P<media>media/(?:guid/\d+/)?)|(?P<config>(?:[^/\?]+/(?:swf|config)|onsite)/select/))? (?:(?:(?:[^/]+/)+select/)?(?P<media>media/(?:guid/\d+/)?)|(?P<config>(?:[^/\?]+/(?:swf|config)|onsite)/select/))?
@ -164,7 +164,6 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePass):
'url': 'http://player.theplatform.com/p/NnzsPC/onsite_universal/select/media/guid/2410887629/2928790?fwsitesection=nbc_the_blacklist_video_library&autoPlay=true&carouselID=137781', 'url': 'http://player.theplatform.com/p/NnzsPC/onsite_universal/select/media/guid/2410887629/2928790?fwsitesection=nbc_the_blacklist_video_library&autoPlay=true&carouselID=137781',
'only_matching': True, 'only_matching': True,
}] }]
_SERVICE_PROVIDER_TEMPLATE = 'https://sp.auth.adobe.com/adobe-services/%s'
@classmethod @classmethod
def _extract_urls(cls, webpage): def _extract_urls(cls, webpage):

View file

@ -5,7 +5,7 @@ import time
import hashlib import hashlib
import json import json
from .adobepass import AdobePass from .adobepass import AdobePassIE
from ..compat import compat_HTTPError from ..compat import compat_HTTPError
from ..utils import ( from ..utils import (
int_or_none, int_or_none,
@ -17,7 +17,7 @@ from ..utils import (
) )
class VicelandIE(AdobePass): class VicelandIE(AdobePassIE):
_VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)' _VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)'
_TEST = { _TEST = {
'url': 'https://www.viceland.com/en_us/video/cyberwar-trailer/57608447973ee7705f6fbd4e', 'url': 'https://www.viceland.com/en_us/video/cyberwar-trailer/57608447973ee7705f6fbd4e',