Compare commits

..

No commits in common. "44452fe850f78fd6092d68e8e16a91d5715dc651" and "ace367aaf3c6c3fb33b96542aa21fb31ea510061" have entirely different histories.

View File

@ -195,7 +195,7 @@ class BilibiliBaseIE(InfoExtractor):
}))) })))
# use dict to combine edges that use the same video section (same cid) # use dict to combine edges that use the same video section (same cid)
cid_edges.setdefault(edges[edge_id]['cid'], {})[edge_id] = edges[edge_id] cid_edges.setdefault(edges[edge_id]['cid'], {})[edge_id] = edges[edge_id]
for choice in traverse_obj(edges, (edge_id, 'choices', ...)): for choice in traverse_obj(edges, ('edge_id', 'choices', ...)):
if choice['edge_id'] not in edges: if choice['edge_id'] not in edges:
edges[choice['edge_id']] = {'cid': choice['cid']} edges[choice['edge_id']] = {'cid': choice['cid']}
self._get_divisions(video_id, graph_version, edges, choice['edge_id'], cid_edges=cid_edges) self._get_divisions(video_id, graph_version, edges, choice['edge_id'], cid_edges=cid_edges)
@ -243,7 +243,7 @@ class BiliBiliIE(BilibiliBaseIE):
'view_count': int, 'view_count': int,
}, },
}, { }, {
'note': 'old av URL version', # old av URL version
'url': 'http://www.bilibili.com/video/av1074402/', 'url': 'http://www.bilibili.com/video/av1074402/',
'info_dict': { 'info_dict': {
'thumbnail': r're:^https?://.*\.(jpg|jpeg)$', 'thumbnail': r're:^https?://.*\.(jpg|jpeg)$',
@ -443,26 +443,6 @@ class BiliBiliIE(BilibiliBaseIE):
'thumbnail': r're:^https?://.*\.(jpg|jpeg|png)$', 'thumbnail': r're:^https?://.*\.(jpg|jpeg|png)$',
}, },
}], }],
}, {
'note': '301 redirect to bangumi link',
'url': 'https://www.bilibili.com/video/BV1TE411f7f1',
'info_dict': {
'id': '288525',
'title': '李永乐老师 钱学森弹道和乘波体飞行器是什么?',
'ext': 'mp4',
'series': '我和我的祖国',
'series_id': '4780',
'season': '幕后纪实',
'season_id': '28609',
'season_number': 1,
'episode': '钱学森弹道和乘波体飞行器是什么?',
'episode_id': '288525',
'episode_number': 105,
'duration': 1183.957,
'timestamp': 1571648124,
'upload_date': '20191021',
'thumbnail': r're:^https?://.*\.(jpg|jpeg|png)$',
},
}, { }, {
'url': 'https://www.bilibili.com/video/BV1jL41167ZG/', 'url': 'https://www.bilibili.com/video/BV1jL41167ZG/',
'info_dict': { 'info_dict': {
@ -491,10 +471,7 @@ class BiliBiliIE(BilibiliBaseIE):
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage, urlh = self._download_webpage_handle(url, video_id) webpage = self._download_webpage(url, video_id)
if not self._match_valid_url(urlh.url):
return self.url_result(urlh.url)
initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', video_id) initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', video_id)
is_festival = 'videoData' not in initial_state is_festival = 'videoData' not in initial_state