re-enable total_size assert check

This commit is contained in:
yzqzss 2024-06-16 00:22:45 +08:00
parent 3b225aa053
commit a9214f0c25

View File

@ -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)