From 43489a67bd0588f9a20324c9c4a26ddc4f9b549d Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Sun, 12 Jun 2022 00:04:55 +0300 Subject: [PATCH] Fix extending list of posts for download --- .gitignore | 4 +++- archive.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9706e1e..2160027 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ .vscode .mypy_cache __pycache__ -*.db \ No newline at end of file +*.db +*.db-shm +*.db-wal diff --git a/archive.py b/archive.py index 85d2997..1830ac5 100644 --- a/archive.py +++ b/archive.py @@ -65,7 +65,7 @@ else: download_count -= 100 download_offset += 100 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"]) posts = posts_raw["items"] for p in posts: @@ -105,4 +105,4 @@ for p in parsed_posts: group_last_post_count['count'] += 1 last_post_count_table.upsert(group_last_post_count, ['group']) c += 1 - print(f"Progress: {c}/{len(parsed_posts)}") \ No newline at end of file + print(f"Progress: {c}/{len(parsed_posts)}")