Skip to content

Commit

Permalink
Improved --all command
Browse files Browse the repository at this point in the history
  • Loading branch information
Xewdy444 committed Dec 30, 2024
1 parent 8ed28d9 commit 1313c3a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,19 @@ async def main() -> None:
elif args.all is not None:
logger.info("Fetching posts from user's feed and messages...")

feed_posts = await passes.get_feed(
args.all, limit=args.limit, post_filter=post_filter
feed_task = asyncio.create_task(
passes.get_feed(args.all, limit=args.limit, post_filter=post_filter)
)

message_posts = await passes.get_messages(
args.all, limit=args.limit, post_filter=post_filter
messages_task = asyncio.create_task(
passes.get_messages(args.all, limit=args.limit, post_filter=post_filter)
)

posts = feed_posts + message_posts
results = await asyncio.gather(feed_task, messages_task, return_exceptions=True)

posts = [
item for result in results if isinstance(result, list) for item in result
]
elif args.file is not None:
logger.info("Fetching posts from URLs in file...")

Expand Down

0 comments on commit 1313c3a

Please sign in to comment.