Merge branch 'master' into BlenderCloud-issue-13282

This commit is contained in:
Parmjit Virk 2017-06-26 17:01:00 -05:00
commit 8db3010181
3 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,9 @@
version <unreleased>
Extractors
+ [niconico] Support sp subdomain (#13494)
version 2017.06.25 version 2017.06.25
Core Core

View File

@ -83,9 +83,12 @@ class NiconicoIE(InfoExtractor):
'uploader_id': '312', 'uploader_id': '312',
}, },
'skip': 'The viewing period of the video you were searching for has expired.', 'skip': 'The viewing period of the video you were searching for has expired.',
}, {
'url': 'http://sp.nicovideo.jp/watch/sm28964488?ss_pos=1&cp_in=wt_tg',
'only_matching': True,
}] }]
_VALID_URL = r'https?://(?:www\.|secure\.)?nicovideo\.jp/watch/(?P<id>(?:[a-z]{2})?[0-9]+)' _VALID_URL = r'https?://(?:www\.|secure\.|sp\.)?nicovideo\.jp/watch/(?P<id>(?:[a-z]{2})?[0-9]+)'
_NETRC_MACHINE = 'niconico' _NETRC_MACHINE = 'niconico'
def _real_initialize(self): def _real_initialize(self):

View File

@ -10,13 +10,13 @@ from ..utils import (
class PandaTVIE(InfoExtractor): class PandaTVIE(InfoExtractor):
IE_DESC = '熊猫TV' IE_DESC = '熊猫TV'
_VALID_URL = r'http://(?:www\.)?panda\.tv/(?P<id>[0-9]+)' _VALID_URL = r'https?://(?:www\.)?panda\.tv/(?P<id>[0-9]+)'
_TEST = { _TESTS = [{
'url': 'http://www.panda.tv/10091', 'url': 'http://www.panda.tv/66666',
'info_dict': { 'info_dict': {
'id': '10091', 'id': '66666',
'title': 're:.+', 'title': 're:.+',
'uploader': '囚徒', 'uploader': '刘杀鸡',
'ext': 'flv', 'ext': 'flv',
'is_live': True, 'is_live': True,
}, },
@ -24,13 +24,16 @@ class PandaTVIE(InfoExtractor):
'skip_download': True, 'skip_download': True,
}, },
'skip': 'Live stream is offline', 'skip': 'Live stream is offline',
} }, {
'url': 'https://www.panda.tv/66666',
'only_matching': True,
}]
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
config = self._download_json( config = self._download_json(
'http://www.panda.tv/api_room?roomid=%s' % video_id, video_id) 'https://www.panda.tv/api_room?roomid=%s' % video_id, video_id)
error_code = config.get('errno', 0) error_code = config.get('errno', 0)
if error_code is not 0: if error_code is not 0:
@ -74,7 +77,7 @@ class PandaTVIE(InfoExtractor):
continue continue
for pref, (ext, pl) in enumerate((('m3u8', '-hls'), ('flv', ''))): for pref, (ext, pl) in enumerate((('m3u8', '-hls'), ('flv', ''))):
formats.append({ formats.append({
'url': 'http://pl%s%s.live.panda.tv/live_panda/%s%s%s.%s' 'url': 'https://pl%s%s.live.panda.tv/live_panda/%s%s%s.%s'
% (pl, plflag1, room_key, live_panda, suffix[quality], ext), % (pl, plflag1, room_key, live_panda, suffix[quality], ext),
'format_id': '%s-%s' % (k, ext), 'format_id': '%s-%s' % (k, ext),
'quality': quality, 'quality': quality,