summaryrefslogtreecommitdiff
path: root/src/portal/py/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/portal/py/tests')
-rw-r--r--src/portal/py/tests/archive_query.py7
-rw-r--r--src/portal/py/tests/test.py10
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)