aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/aftenposten.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-15 10:08:14 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-15 10:08:14 +0600
commit8f4cc22455f1c08f8e95f867f40c9f378bfe7a49 (patch)
tree2210b9b61123a5d9a7f428ee28e0d7f399490709 /youtube_dl/extractor/aftenposten.py
parent7c42327e0e2f62a64771769e17cda33ea2a4a10d (diff)
[aftenposten] Adapt to new URL format
Diffstat (limited to 'youtube_dl/extractor/aftenposten.py')
-rw-r--r--youtube_dl/extractor/aftenposten.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/youtube_dl/extractor/aftenposten.py b/youtube_dl/extractor/aftenposten.py
index 2b257ede7..e15c015fb 100644
--- a/youtube_dl/extractor/aftenposten.py
+++ b/youtube_dl/extractor/aftenposten.py
@@ -14,10 +14,10 @@ from ..utils import (
class AftenpostenIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aftenposten\.no/webtv/([^/]+/)*(?P<id>[^/]+)-\d+\.html'
+ _VALID_URL = r'https?://(?:www\.)?aftenposten\.no/webtv/(?:#!/)?video/(?P<id>\d+)'
_TEST = {
- 'url': 'http://www.aftenposten.no/webtv/serier-og-programmer/sweatshopenglish/TRAILER-SWEATSHOP---I-cant-take-any-more-7800835.html?paging=&section=webtv_serierogprogrammer_sweatshop_sweatshopenglish',
+ 'url': 'http://www.aftenposten.no/webtv/#!/video/21039/trailer-sweatshop-i-can-t-take-any-more',
'md5': 'fd828cd29774a729bf4d4425fe192972',
'info_dict': {
'id': '21039',
@@ -30,12 +30,7 @@ class AftenpostenIE(InfoExtractor):
}
def _real_extract(self, url):
- display_id = self._match_id(url)
-
- webpage = self._download_webpage(url, display_id)
-
- video_id = self._html_search_regex(
- r'data-xs-id="(\d+)"', webpage, 'video id')
+ video_id = self._match_id(url)
data = self._download_xml(
'http://frontend.xstream.dk/ap/feed/video/?platform=web&id=%s' % video_id, video_id)