projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c42327
)
[aftenposten] Adapt to new URL format
author
Sergey M․
<dstftw@gmail.com>
Sun, 15 Mar 2015 04:08:14 +0000
(10:08 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 15 Mar 2015 04:08:14 +0000
(10:08 +0600)
youtube_dl/extractor/aftenposten.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/aftenposten.py
b/youtube_dl/extractor/aftenposten.py
index 2b257ede7457e2844250f3034f6a8031d31624a9..e15c015fbafd466aaba089bef979843a397f1ab7 100644
(file)
--- a/
youtube_dl/extractor/aftenposten.py
+++ b/
youtube_dl/extractor/aftenposten.py
@@
-14,10
+14,10
@@
from ..utils import (
class AftenpostenIE(InfoExtractor):
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 = {
_TEST = {
- 'url': 'http://www.aftenposten.no/webtv/
serier-og-programmer/sweatshopenglish/TRAILER-SWEATSHOP---I-cant-take-any-more-7800835.html?paging=§ion=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',
'md5': 'fd828cd29774a729bf4d4425fe192972',
'info_dict': {
'id': '21039',
@@
-30,12
+30,7
@@
class AftenpostenIE(InfoExtractor):
}
def _real_extract(self, url):
}
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)
data = self._download_xml(
'http://frontend.xstream.dk/ap/feed/video/?platform=web&id=%s' % video_id, video_id)