aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-12-23 02:54:32 +0600
committerSergey M․ <dstftw@gmail.com>2015-12-23 02:54:32 +0600
commit3a70ed9ebeac782b922cc3cb3b74cd999e60845a (patch)
tree27d2b5d18ac8d3873fca1e4ba4a61b8e79294c9d /youtube_dl
parent89abf7bf4d5dfc8c161924067f4430b7d81a8b32 (diff)
[daum] Fix extraction (Closes #7949)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/daum.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/daum.py b/youtube_dl/extractor/daum.py
index 934da765e..e3fc639b0 100644
--- a/youtube_dl/extractor/daum.py
+++ b/youtube_dl/extractor/daum.py
@@ -37,9 +37,11 @@ class DaumIE(InfoExtractor):
video_id = mobj.group('id')
canonical_url = 'http://tvpot.daum.net/v/%s' % video_id
webpage = self._download_webpage(canonical_url, video_id)
+ og_url = self._og_search_url(webpage, default=None) or self._search_regex(
+ r'<link[^>]+rel=(["\'])canonical\1[^>]+href=(["\'])(?P<url>.+?)\2',
+ webpage, 'canonical url', group='url')
full_id = self._search_regex(
- r'src=["\']http://videofarm\.daum\.net/controller/video/viewer/Video\.html\?.*?vid=(.+?)[&"\']',
- webpage, 'full id')
+ r'tvpot\.daum\.net/v/([^/]+)', og_url, 'full id')
query = compat_urllib_parse.urlencode({'vid': full_id})
info = self._download_xml(
'http://tvpot.daum.net/clip/ClipInfoXml.do?' + query, video_id,