diff options
| author | 2024-12-08 00:01:09 -0500 | |
|---|---|---|
| committer | 2024-12-08 00:01:09 -0500 | |
| commit | 692abf540cfcd68cbebe3b03fb5c24f983330b9a (patch) | |
| tree | 00c86317703323f375cca0a149c176af316777e3 /src/portal/py/tests | |
| parent | d81c406f62e996840d86333b81c41d0ae4aff347 (diff) | |
| download | camu-692abf540cfcd68cbebe3b03fb5c24f983330b9a.tar.gz camu-692abf540cfcd68cbebe3b03fb5c24f983330b9a.tar.bz2 camu-692abf540cfcd68cbebe3b03fb5c24f983330b9a.zip | |
Misc portal updates
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/portal/py/tests')
| -rw-r--r-- | src/portal/py/tests/archive_query.py | 7 | ||||
| -rw-r--r-- | src/portal/py/tests/test.py | 10 |
2 files changed, 9 insertions, 8 deletions
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) |