Open prajwalrajup opened 1 year ago
If you just want to fetch the top x amount of posts instead of a stream you can just use the following
for submission in reddit.subreddit("forsen").top(limit=25): print(submission)
You can also use that method to fetch the top posts from multiple subreddits
for submission in reddit.subreddit("forsen+twitch").top(time_filter="all"): print(submission)
Alternatively after setting up PRAW you can just use the stream method to get a continuous stream of submissions and/or comments.
for submission in reddit.subreddit("forsen").stream.submissions(skip_existing=True): print(submission)
By using skip_existing you will not fetch posts that have already been placed, only posts that are placed after you started running the script.
If you want to check if the post is a video just use
if submission.is_video print(submission)
I'm able to get the submissions, but I'm unsure how to convert the stream into an MP4 file that can be uploaded to Instagram. can you please help me with that.
If you just want to fetch the top x amount of posts instead of a stream you can just use the following
You can also use that method to fetch the top posts from multiple subreddits
Alternatively after setting up PRAW you can just use the stream method to get a continuous stream of submissions and/or comments.
By using skip_existing you will not fetch posts that have already been placed, only posts that are placed after you started running the script.
If you want to check if the post is a video just use