From 28af439fcadcd37e6171baddda433ffa0fe5a684 Mon Sep 17 00:00:00 2001 From: SHMoney2021 <15300607716@163.com> Date: Mon, 8 Mar 2021 08:52:43 +0800 Subject: [PATCH] fix page count error in 'space_video' case --- src/you_get/extractors/bilibili.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/you_get/extractors/bilibili.py b/src/you_get/extractors/bilibili.py index cdcccf20..a812d72d 100644 --- a/src/you_get/extractors/bilibili.py +++ b/src/you_get/extractors/bilibili.py @@ -4,6 +4,8 @@ from ..common import * from ..extractor import VideoExtractor import hashlib +import math + class Bilibili(VideoExtractor): name = "Bilibili" @@ -734,7 +736,8 @@ class Bilibili(VideoExtractor): api_url = self.bilibili_space_video_api(mid) api_content = get_content(api_url, headers=self.bilibili_headers()) videos_info = json.loads(api_content) - pc = videos_info['data']['page']['count'] // videos_info['data']['page']['ps'] + # pc = videos_info['data']['page']['count'] // videos_info['data']['page']['ps'] + pc = math.ceil(videos_info['data']['page']['count'] / videos_info['data']['page']['ps']) for pn in range(1, pc + 1): api_url = self.bilibili_space_video_api(mid, pn=pn)