mrsrmn / RedditEasy

RedditEasy is a rapidly-fast API wrapper for getting posts using the Reddit JSON API with both sync and async options
https://redditeasy.readthedocs.io/
GNU General Public License v3.0
9 stars 2 forks source link

Error when processing media #2

Open RedCIaws opened 2 years ago

RedCIaws commented 2 years ago

In base.py line 87 : contenttext = post[randompost]["data"]["media"]["reddit_video"]["scrubber_media_url"] seems to trigger an error when processing redgif video, as I understand there is no reddit_video attribute. Feel free to ask for more information if needed, it's my first issue on GitHub and I'm not sure about what to put in the description of the issue.

I also noticed that when querying a random post for a subreddit it always takes 25 posts, it's not an issue and it's probably to get better performances but I could be a nice addition to allow users to have an optional param for the number of posts queried. Nice work anyway.

mrsrmn commented 2 years ago

Thank you for the report! Could you please give me the name of the subreddit you used?

RedCIaws commented 2 years ago

It's a bit embarrassing... To give you some context I m currently trying to make my own discord bot just for fun. One of the commands I implements call your lib to pull some spicy content from reddit. Some posts are image, gif, or video. And some of the video posts use the Redgifs platform for sharing. Anyway you can try to reproduce this issue with subreddit like r/boobs or r/gonewild.

mrsrmn commented 2 years ago

Thank you! I will look at the error and let you know when it's fixed.