projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cd65491
)
[Sohu] Fix title extraction
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sat, 14 Mar 2015 17:05:01 +0000
(
01:05
+0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sat, 14 Mar 2015 17:05:01 +0000
(
01:05
+0800)
youtube_dl/extractor/sohu.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/sohu.py
b/youtube_dl/extractor/sohu.py
index 7db5b2f13367749aebef75e0785bc842bdba19fd..ea5cc06b980771fb4c9ab29459846084269c75a2 100644
(file)
--- a/
youtube_dl/extractor/sohu.py
+++ b/
youtube_dl/extractor/sohu.py
@@
-73,6
+73,17
@@
class SohuIE(InfoExtractor):
'title': '【神探苍实战秘籍】第13期 战争之影 赫卡里姆',
}
}]
'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):
}]
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)
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+)["\']',
vid = self._html_search_regex(
r'var vid ?= ?["\'](\d+)["\']',