aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-12-04 08:37:08 +0100
committerremitamine <remitamine@gmail.com>2015-12-04 08:37:08 +0100
commit2c3b9f35703def516e455448666af0b4c5b31ec9 (patch)
tree0ba76aa334b5afe798a0ec5b017f9a5e749eabe5 /youtube_dl/extractor
parent9a605c8859e5ecf164719b890ea62b76afb0b874 (diff)
[adobetv] use a variable for api base url
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/adobetv.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/youtube_dl/extractor/adobetv.py b/youtube_dl/extractor/adobetv.py
index d0bfafa45..d65826932 100644
--- a/youtube_dl/extractor/adobetv.py
+++ b/youtube_dl/extractor/adobetv.py
@@ -14,7 +14,11 @@ from ..utils import (
)
-class AdobeTVIE(InfoExtractor):
+class AdobeTVBaseIE(InfoExtractor):
+ _API_BASE_URL = 'http://tv.adobe.com/api/v4/'
+
+
+class AdobeTVIE(AdobeTVBaseIE):
_VALID_URL = r'https?://tv\.adobe\.com/(?:(?P<language>fr|de|es|jp)/)?watch/(?P<show_urlname>[^/]+)/(?P<id>[^/]+)'
_TEST = {
@@ -38,7 +42,7 @@ class AdobeTVIE(InfoExtractor):
language = 'en'
video_data = self._download_json(
- 'http://tv.adobe.com/api/v4/episode/get/?language=%s&show_urlname=%s&urlname=%s&disclosure=standard' % (language, show_urlname, urlname),
+ self._API_BASE_URL + 'episode/get/?language=%s&show_urlname=%s&urlname=%s&disclosure=standard' % (language, show_urlname, urlname),
urlname)['data'][0]
formats = [{
@@ -62,7 +66,7 @@ class AdobeTVIE(InfoExtractor):
}
-class AdobeTVPlaylistBaseIE(InfoExtractor):
+class AdobeTVPlaylistBaseIE(AdobeTVBaseIE):
def _parse_page_data(self, page_data):
return [self.url_result(self._get_element_url(element_data)) for element_data in page_data]
@@ -97,11 +101,10 @@ class AdobeTVShowIE(AdobeTVPlaylistBaseIE):
language = 'en'
query = 'language=%s&show_urlname=%s' % (language, show_urlname)
- show_data = self._download_json(
- 'http://tv.adobe.com/api/v4/show/get/?%s' % query, show_urlname)['data'][0]
+ show_data = self._download_json(self._API_BASE_URL + 'show/get/?%s' % query, show_urlname)['data'][0]
return self.playlist_result(
- self._extract_playlist_entries('http://tv.adobe.com/api/v4/episode/?%s' % query, show_urlname),
+ self._extract_playlist_entries(self._API_BASE_URL + 'episode/?%s' % query, show_urlname),
str(show_data['id']),
show_data['show_name'],
show_data['show_description'])
@@ -130,7 +133,7 @@ class AdobeTVChannelIE(AdobeTVPlaylistBaseIE):
query += '&category_urlname=%s' % category_urlname
return self.playlist_result(
- self._extract_playlist_entries('http://tv.adobe.com/api/v4/show/?%s' % query, channel_urlname),
+ self._extract_playlist_entries(self._API_BASE_URL + 'show/?%s' % query, channel_urlname),
channel_urlname)