Fix extending list of posts for download

This commit is contained in:
ChronosX88 2022-06-12 00:04:55 +03:00
parent 65521ac145
commit 43489a67bd
Signed by: ChronosXYZ
GPG Key ID: 52A90DE5862D8321
2 changed files with 5 additions and 3 deletions

4
.gitignore vendored
View File

@ -2,4 +2,6 @@
.vscode .vscode
.mypy_cache .mypy_cache
__pycache__ __pycache__
*.db *.db
*.db-shm
*.db-wal

View File

@ -65,7 +65,7 @@ else:
download_count -= 100 download_count -= 100
download_offset += 100 download_offset += 100
posts_raw_tmp = vk.wall.get(domain=args.group, offset=download_offset, count=to_download) posts_raw_tmp = vk.wall.get(domain=args.group, offset=download_offset, count=to_download)
posts_raw["items"].append(*posts_raw_tmp["items"]) posts_raw["items"].extend(posts_raw_tmp["items"])
last_post_count += len(posts_raw_tmp["items"]) last_post_count += len(posts_raw_tmp["items"])
posts = posts_raw["items"] posts = posts_raw["items"]
for p in posts: for p in posts:
@ -105,4 +105,4 @@ for p in parsed_posts:
group_last_post_count['count'] += 1 group_last_post_count['count'] += 1
last_post_count_table.upsert(group_last_post_count, ['group']) last_post_count_table.upsert(group_last_post_count, ['group'])
c += 1 c += 1
print(f"Progress: {c}/{len(parsed_posts)}") print(f"Progress: {c}/{len(parsed_posts)}")