From 692abf540cfcd68cbebe3b03fb5c24f983330b9a Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sun, 8 Dec 2024 00:01:09 -0500 Subject: Misc portal updates Signed-off-by: Andrew Opalach --- src/portal/py/tests/archive_query.py | 7 +++---- src/portal/py/tests/test.py | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/portal/py/tests') diff --git a/src/portal/py/tests/archive_query.py b/src/portal/py/tests/archive_query.py index 1097634..cff5e5d 100644 --- a/src/portal/py/tests/archive_query.py +++ b/src/portal/py/tests/archive_query.py @@ -90,7 +90,7 @@ class QueryDownloadThread(threading.Thread): return False del post.raw_responses['detached_api'] if post.type != PostType.TOMBSTONE: - message += f':{datetime.fromtimestamp(post.dates[DateType.CREATED], tz=timezone.utc).isoformat()} from {post.author.username}({post.author.display_name}):{post.author.unique_id}.' + message += f':{datetime.fromtimestamp(post.dates[0].range[0], tz=timezone.utc).isoformat()} from {post.author.username}({post.author.display_name}):{post.author.unique_id}.' else: message += '.' output_path = self.make_path(post) @@ -258,6 +258,5 @@ def signal_handler(sig, frame): else: is_running = False -if __name__ == "__main__": - signal.signal(signal.SIGINT, signal_handler) - download_args() +signal.signal(signal.SIGINT, signal_handler) +download_args() diff --git a/src/portal/py/tests/test.py b/src/portal/py/tests/test.py index bee7265..15bde0a 100644 --- a/src/portal/py/tests/test.py +++ b/src/portal/py/tests/test.py @@ -55,11 +55,13 @@ from modules import ALL_MODULES # else: # print('Skipping file') -ALL_MODULES['youtube'][0].init() -search = ALL_MODULES['youtube'][0].search('yoyoyoy') +module = ALL_MODULES['instagram'][0] +module.init() +search = module.search('plottttwistttttt') page = search.get_page(0) -print(page) -#print(json.dumps(page, indent=4, cls=PostEncoder)) +for unique_id in page: + post = module.get_item(unique_id) + print(json.dumps(post, indent=4, cls=PostEncoder)) #d = Date(DateType.EDITED, (0.0, 0.0), DateMeta.EDITED_AT_UNKNOWN_TIME) #d = Date(DateType.EDITED, (0.0, 0.0), DateMeta.NONE) -- cgit v1.2.3-101-g0448