aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/sohu.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-03-15 01:05:01 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-03-15 01:05:01 +0800
commit2cb434e53ee861c8bcbd538455be107085f444ae (patch)
tree2cf7f38446cd5e2548cf25ab9702930ad383d1e5 /youtube_dl/extractor/sohu.py
parentcd65491c306f644d7bb3c7ad98795a3f8660be49 (diff)
[Sohu] Fix title extraction
Diffstat (limited to 'youtube_dl/extractor/sohu.py')
-rw-r--r--youtube_dl/extractor/sohu.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/youtube_dl/extractor/sohu.py b/youtube_dl/extractor/sohu.py
index 7db5b2f13..ea5cc06b9 100644
--- a/youtube_dl/extractor/sohu.py
+++ b/youtube_dl/extractor/sohu.py
@@ -73,6 +73,17 @@ class SohuIE(InfoExtractor):
'title': '【神探苍实战秘籍】第13期 战争之影 赫卡里姆',
}
}]
+ }, {
+ 'info': 'Video with title containing dash',
+ 'url': 'http://my.tv.sohu.com/us/249884221/78932792.shtml',
+ 'info_dict': {
+ 'id': '78932792',
+ 'ext': 'mp4',
+ 'title': 'youtube-dl testing video',
+ },
+ 'params': {
+ 'skip_download': True
+ }
}]
def _real_extract(self, url):
@@ -97,10 +108,8 @@ class SohuIE(InfoExtractor):
mytv = mobj.group('mytv') is not None
webpage = self._download_webpage(url, video_id)
- raw_title = self._html_search_regex(
- r'(?s)<title>(.+?)</title>',
- webpage, 'video title')
- title = raw_title.partition('-')[0].strip()
+
+ title = self._og_search_title(webpage)
vid = self._html_search_regex(
r'var vid ?= ?["\'](\d+)["\']',