mirror of
https://github.com/soimort/you-get.git
synced 2025-02-02 16:24:00 +03:00
Merge branch 'arix00-patch-1' of https://github.com/arix00/you-get-test into arix00-arix00-patch-1
This commit is contained in:
commit
35182d6a29
@ -748,13 +748,20 @@ class Bilibili(VideoExtractor):
|
|||||||
elif sort == 'space_channel_series':
|
elif sort == 'space_channel_series':
|
||||||
m = re.match(r'https?://space\.?bilibili\.com/(\d+)/channel/seriesdetail\?.*sid=(\d+)', self.url)
|
m = re.match(r'https?://space\.?bilibili\.com/(\d+)/channel/seriesdetail\?.*sid=(\d+)', self.url)
|
||||||
mid, sid = m.group(1), m.group(2)
|
mid, sid = m.group(1), m.group(2)
|
||||||
api_url = self.bilibili_series_archives_api(mid, sid)
|
pn = 1
|
||||||
api_content = get_content(api_url, headers=self.bilibili_headers(referer=self.url))
|
video_list = []
|
||||||
archives_info = json.loads(api_content)
|
while True:
|
||||||
# TBD: channel of more than 100 videos
|
api_url = self.bilibili_series_archives_api(mid, sid, pn)
|
||||||
|
api_content = get_content(api_url, headers=self.bilibili_headers(referer=self.url))
|
||||||
|
archives_info = json.loads(api_content)
|
||||||
|
video_list.extend(archives_info['data']['archives'])
|
||||||
|
if len(video_list) < archives_info['data']['page']['total'] and len(archives_info['data']['archives']) > 0:
|
||||||
|
pn += 1
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
epn, i = len(archives_info['data']['archives']), 0
|
epn, i = len(video_list), 0
|
||||||
for video in archives_info['data']['archives']:
|
for video in video_list:
|
||||||
i += 1; log.w('Extracting %s of %s videos ...' % (i, epn))
|
i += 1; log.w('Extracting %s of %s videos ...' % (i, epn))
|
||||||
url = 'https://www.bilibili.com/video/av%s' % video['aid']
|
url = 'https://www.bilibili.com/video/av%s' % video['aid']
|
||||||
self.__class__().download_playlist_by_url(url, **kwargs)
|
self.__class__().download_playlist_by_url(url, **kwargs)
|
||||||
@ -762,13 +769,20 @@ class Bilibili(VideoExtractor):
|
|||||||
elif sort == 'space_channel_collection':
|
elif sort == 'space_channel_collection':
|
||||||
m = re.match(r'https?://space\.?bilibili\.com/(\d+)/channel/collectiondetail\?.*sid=(\d+)', self.url)
|
m = re.match(r'https?://space\.?bilibili\.com/(\d+)/channel/collectiondetail\?.*sid=(\d+)', self.url)
|
||||||
mid, sid = m.group(1), m.group(2)
|
mid, sid = m.group(1), m.group(2)
|
||||||
api_url = self.bilibili_space_collection_api(mid, sid)
|
pn = 1
|
||||||
api_content = get_content(api_url, headers=self.bilibili_headers(referer=self.url))
|
video_list = []
|
||||||
archives_info = json.loads(api_content)
|
while True:
|
||||||
# TBD: channel of more than 100 videos
|
api_url = self.bilibili_space_collection_api(mid, sid, pn)
|
||||||
|
api_content = get_content(api_url, headers=self.bilibili_headers(referer=self.url))
|
||||||
|
archives_info = json.loads(api_content)
|
||||||
|
video_list.extend(archives_info['data']['archives'])
|
||||||
|
if len(video_list) < archives_info['data']['page']['total'] and len(archives_info['data']['archives']) > 0:
|
||||||
|
pn += 1
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
epn, i = len(archives_info['data']['archives']), 0
|
epn, i = len(video_list), 0
|
||||||
for video in archives_info['data']['archives']:
|
for video in video_list:
|
||||||
i += 1; log.w('Extracting %s of %s videos ...' % (i, epn))
|
i += 1; log.w('Extracting %s of %s videos ...' % (i, epn))
|
||||||
url = 'https://www.bilibili.com/video/av%s' % video['aid']
|
url = 'https://www.bilibili.com/video/av%s' % video['aid']
|
||||||
self.__class__().download_playlist_by_url(url, **kwargs)
|
self.__class__().download_playlist_by_url(url, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user