projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5150 from yan12125/yam_fix
[youtube-dl]
/
youtube_dl
/
extractor
/
newstube.py
diff --git
a/youtube_dl/extractor/newstube.py
b/youtube_dl/extractor/newstube.py
index 2fd5b8f0430351cd7eadf8b5acef3cf5786d27ab..85fcad06b51dc9ce87bdd563043c92a126cc8eea 100644
(file)
--- a/
youtube_dl/extractor/newstube.py
+++ b/
youtube_dl/extractor/newstube.py
@@
-4,18
+4,19
@@
from __future__ import unicode_literals
import re
from .common import InfoExtractor
import re
from .common import InfoExtractor
+from ..utils import ExtractorError
class NewstubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newstube\.ru/media/(?P<id>.+)'
_TEST = {
class NewstubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newstube\.ru/media/(?P<id>.+)'
_TEST = {
- 'url': 'http://
newstube.ru/media/na-korable-progress-prodolzhaetsya-testirovanie-sistemy-kurs
',
+ 'url': 'http://
www.newstube.ru/media/telekanal-cnn-peremestil-gorod-slavyansk-v-krym
',
'info_dict': {
'info_dict': {
- 'id': '
d156a237-a6e9-4111-a682-039995f721f1
',
+ 'id': '
728e0ef2-e187-4012-bac0-5a081fdcb1f6
',
'ext': 'flv',
'ext': 'flv',
- 'title': 'Ð
\9d
а коÑ
\80
абле «Ð
\9f
Ñ
\80
огÑ
\80
еÑ
\81
Ñ
\81
» пÑ
\80
одолжаеÑ
\82
Ñ
\81
Ñ
\8f
Ñ
\82
еÑ
\81
Ñ
\82
иÑ
\80
ование Ñ
\81
иÑ
\81
Ñ
\82
емÑ
\8b
«Ð
\9a
Ñ
\83
Ñ
\80
Ñ
\81
»
',
- 'description': 'md5:
d0cbe7b4a6f600552617e48548d5dc77
',
- 'duration':
20.04
,
+ 'title': 'Ð
¢ÐµÐ»ÐµÐºÐ°Ð½Ð°Ð» CNN пеÑ
\80
емеÑ
\81
Ñ
\82
ил гоÑ
\80
од СлавÑ
\8f
нÑ
\81
к в Ð
\9a
Ñ
\80
Ñ
\8b
м
',
+ 'description': 'md5:
419a8c9f03442bc0b0a794d689360335
',
+ 'duration':
31.05
,
},
'params': {
# rtmp download
},
'params': {
# rtmp download
@@
-40,6
+41,10
@@
class NewstubeIE(InfoExtractor):
def ns(s):
return s.replace('/', '/%(ns)s') % {'ns': '{http://app1.newstube.ru/N2SiteWS/player.asmx}'}
def ns(s):
return s.replace('/', '/%(ns)s') % {'ns': '{http://app1.newstube.ru/N2SiteWS/player.asmx}'}
+ error_message = player.find(ns('./ErrorMessage'))
+ if error_message is not None:
+ raise ExtractorError('%s returned error: %s' % (self.IE_NAME, error_message.text), expected=True)
+
session_id = player.find(ns('./SessionId')).text
media_info = player.find(ns('./Medias/MediaInfo'))
title = media_info.find(ns('./Name')).text
session_id = player.find(ns('./SessionId')).text
media_info = player.find(ns('./Medias/MediaInfo'))
title = media_info.find(ns('./Name')).text
@@
-84,4
+89,4
@@
class NewstubeIE(InfoExtractor):
'thumbnail': thumbnail,
'duration': duration,
'formats': formats,
'thumbnail': thumbnail,
'duration': duration,
'formats': formats,
- }
\ No newline at end of file
+ }