projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[youku] compare bytes and str for compatible; use compat_urllib_parse for making...
[youtube-dl]
/
youtube_dl
/
extractor
/
miomio.py
diff --git
a/youtube_dl/extractor/miomio.py
b/youtube_dl/extractor/miomio.py
index cc3f2719484d7011e5f88a882af90d95dafe905e..a784fc5fba41c5931f6b1f040042e1900a6ff791 100644
(file)
--- a/
youtube_dl/extractor/miomio.py
+++ b/
youtube_dl/extractor/miomio.py
@@
-7,6
+7,7
@@
from .common import InfoExtractor
from ..utils import (
xpath_text,
int_or_none,
from ..utils import (
xpath_text,
int_or_none,
+ ExtractorError,
)
)
@@
-14,13
+15,14
@@
class MioMioIE(InfoExtractor):
IE_NAME = 'miomio.tv'
_VALID_URL = r'https?://(?:www\.)?miomio\.tv/watch/cc(?P<id>[0-9]+)'
_TESTS = [{
IE_NAME = 'miomio.tv'
_VALID_URL = r'https?://(?:www\.)?miomio\.tv/watch/cc(?P<id>[0-9]+)'
_TESTS = [{
- 'url': 'http://www.miomio.tv/watch/cc179734/',
- 'md5': '48de02137d0739c15b440a224ad364b9',
+ # "type=video" in flashvars
+ 'url': 'http://www.miomio.tv/watch/cc88912/',
+ 'md5': '317a5f7f6b544ce8419b784ca8edae65',
'info_dict': {
'info_dict': {
- 'id': '
179734
',
+ 'id': '
88912
',
'ext': 'flv',
'ext': 'flv',
- 'title': '
æ
\89
\8b
ç»
\98
å
\8a
¨æ¼«é¬¼æ³£ä½
\86
ä¸
\81
å
\85
¨ç¨
\8b
ç
\94
»æ³
\95
',
- 'duration':
354
,
+ 'title': '
ã
\80
\90
SKYã
\80
\91
å
\97
å¹
\95
é
\93
æ¦æ
\98
å
\92
\8c
VSå¹³æ
\88
\90
å
\81
\87
é
\9d
¢éª
\91
士大æ
\88
\98
FEATæ
\88
\98
é
\98
\9f
é
\94
æ
\98
\9f
å
\97
å¹
\95
ç»
\84
å
\97
å¹
\95
',
+ 'duration':
5923
,
},
}, {
'url': 'http://www.miomio.tv/watch/cc184024/',
},
}, {
'url': 'http://www.miomio.tv/watch/cc184024/',
@@
-29,6
+31,14
@@
class MioMioIE(InfoExtractor):
'title': '《动漫同人插画绘制》',
},
'playlist_mincount': 86,
'title': '《动漫同人插画绘制》',
},
'playlist_mincount': 86,
+ 'skip': 'This video takes time too long for retrieving the URL',
+ }, {
+ 'url': 'http://www.miomio.tv/watch/cc173113/',
+ 'info_dict': {
+ 'id': '173113',
+ 'title': 'The New Macbook 2015 上手试玩与简评'
+ },
+ 'playlist_mincount': 2,
}]
def _real_extract(self, url):
}]
def _real_extract(self, url):
@@
-42,7
+52,7
@@
class MioMioIE(InfoExtractor):
r'src="(/mioplayer/[^"]+)"', webpage, 'ref_path')
xml_config = self._search_regex(
r'src="(/mioplayer/[^"]+)"', webpage, 'ref_path')
xml_config = self._search_regex(
- r'flashvars="type=
sina
&(.+?)&',
+ r'flashvars="type=
(?:sina|video)
&(.+?)&',
webpage, 'xml config')
# skipping the following page causes lags and eventually connection drop-outs
webpage, 'xml config')
# skipping the following page causes lags and eventually connection drop-outs
@@
-59,6
+69,9
@@
class MioMioIE(InfoExtractor):
'Referer': 'http://www.miomio.tv%s' % mioplayer_path,
}
'Referer': 'http://www.miomio.tv%s' % mioplayer_path,
}
+ if not int_or_none(xpath_text(vid_config, 'timelength')):
+ raise ExtractorError('Unable to load videos!', expected=True)
+
entries = []
for f in vid_config.findall('./durl'):
segment_url = xpath_text(f, 'url', 'video url')
entries = []
for f in vid_config.findall('./durl'):
segment_url = xpath_text(f, 'url', 'video url')