mirror of
https://github.com/saveweb/biliarchiver.git
synced 2024-09-19 11:05:28 -07:00
re-enable total_size assert check
This commit is contained in:
parent
3b225aa053
commit
a9214f0c25
@ -156,6 +156,8 @@ async def by_up_videos(url_or_mid: str, truncate: int = int(1e10)) -> Path:
|
||||
)
|
||||
)
|
||||
print(_("(如果最新的视频为合作视频的非主作者,UP 名可能会识别错误,但不影响获取 bvid 列表)"))
|
||||
|
||||
ensure_total_size = True
|
||||
while pn < total_size / ps:
|
||||
pn += 1
|
||||
print(ngettext("获取第 {} 页", "获取第 {} 页", pn).format(pn))
|
||||
@ -165,11 +167,16 @@ async def by_up_videos(url_or_mid: str, truncate: int = int(1e10)) -> Path:
|
||||
|
||||
if len(bv_ids) >= truncate:
|
||||
print("truncate at", truncate)
|
||||
ensure_total_size = False
|
||||
break
|
||||
|
||||
print(mid, up_name, total_size)
|
||||
await client.aclose()
|
||||
|
||||
assert len(bv_ids) == len(set(bv_ids)), _("有重复的 bv_id")
|
||||
if ensure_total_size:
|
||||
assert total_size == len(bv_ids), _("视频总数不匹配")
|
||||
|
||||
filepath = f"bvids/by-up_videos/mid-{mid}-{int(time.time())}.txt"
|
||||
os.makedirs(os.path.dirname(filepath), exist_ok=True)
|
||||
abs_filepath = os.path.abspath(filepath)
|
||||
|
Loading…
Reference in New Issue
Block a user