projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d0e958c
)
[Yam] Add an error detection and update test cases
author
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 6 Mar 2015 16:53:52 +0000
(
00:53
+0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 6 Mar 2015 16:53:52 +0000
(
00:53
+0800)
youtube_dl/extractor/yam.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/yam.py
b/youtube_dl/extractor/yam.py
index b294767c5b6bc5a7ec918e9108cc4cff1a5fac40..19ad74d04f32f0a9819af61b01254e4af8a849a5 100644
(file)
--- a/
youtube_dl/extractor/yam.py
+++ b/
youtube_dl/extractor/yam.py
@@
-8,6
+8,7
@@
from ..compat import compat_urlparse
from ..utils import (
float_or_none,
month_by_abbreviation,
from ..utils import (
float_or_none,
month_by_abbreviation,
+ ExtractorError,
)
)
@@
-28,23
+29,44
@@
class YamIE(InfoExtractor):
}
}, {
# An external video hosted on YouTube
}
}, {
# An external video hosted on YouTube
- 'url': 'http://mymedia.yam.com/m/359
8173
',
- 'md5': '0
238ceec479c654e8c2f1223755bf3e9
',
+ 'url': 'http://mymedia.yam.com/m/359
9430
',
+ 'md5': '0
3127cf10d8f35d120a9e8e52e3b17c6
',
'info_dict': {
'info_dict': {
- 'id': '
pJ2Deys283c
',
+ 'id': '
CNpEoQlrIgA
',
'ext': 'mp4',
'ext': 'mp4',
- 'upload_date': '20150
202
',
+ 'upload_date': '20150
306
',
'uploader': '新莊社大瑜伽社',
'uploader': '新莊社大瑜伽社',
- 'description': 'md5:
f5cc72f0baf259a70fb731654b0d2eff
',
+ 'description': 'md5:
11e2e405311633ace874f2e6226c8b17
',
'uploader_id': '2323agoy',
'uploader_id': '2323agoy',
- 'title': '
外婆的澎湖灣KTV-潘安邦
',
+ 'title': '
20090412陽明山二子坪-1
',
}
}
+ }, {
+ 'url': 'http://mymedia.yam.com/m/3598173',
+ 'info_dict': {
+ 'id': '3598173',
+ 'ext': 'mp4',
+ },
+ 'skip': 'cause Yam system error',
+ }, {
+ 'url': 'http://mymedia.yam.com/m/3599437',
+ 'info_dict': {
+ 'id': '3599437',
+ 'ext': 'mp4',
+ },
+ 'skip': 'invalid YouTube URL',
}]
def _real_extract(self, url):
video_id = self._match_id(url)
page = self._download_webpage(url, video_id)
}]
def _real_extract(self, url):
video_id = self._match_id(url)
page = self._download_webpage(url, video_id)
+ # Check for errors
+ system_msg = self._html_search_regex(
+ r'系統訊息(?:<br>|\n|\r)*([^<>]+)<br>', page, 'system message',
+ default=None)
+ if system_msg:
+ raise ExtractorError(system_msg, expected=True)
+
# Is it hosted externally on YouTube?
youtube_url = self._html_search_regex(
r'<embed src="(http://www.youtube.com/[^"]+)"',
# Is it hosted externally on YouTube?
youtube_url = self._html_search_regex(
r'<embed src="(http://www.youtube.com/[^"]+)"',