RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

400 HTTP response, heres the output

Open p1x3lll opened this issue 4 years ago • 4 comments

C:\Users\pizzabagel\Desktop\RedditVideoMakerBot-master>py main.py

Thanks for using this tool! Feel free to contribute to this project on GitHub! If you have any questions, feel free to reach out to me on Twitter or submit a GitHub issue.

╭────────────────────────── ─────────╮ │ Getting AskReddit threads... │ ╰───────────────────────── ──────────╯ Traceback (most recent call last): File "C:\Users\pizzabagel\Desktop\RedditVideoMakerBot-master\main.py", line 17, in reddit_object = get_subreddit_threads() File "C:\Users\pizzabagel\Desktop\RedditVideoMakerBot-master\reddit\subreddit.py", line 52, in get_subreddit_threads submission = list(threads)[random.randrange(0, 25)] File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\models\listing\generator.py", line 63, in next self._next_batch() File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\models\listing\generator.py", line 89, in _next_batch self._listing = self._reddit.get(self.url, params=self.params) File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\util\deprecate_args.py", line 43, in wrapped return func(**dict(zip(_old_args, args)), **kwargs) File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\reddit.py", line 634, in get return self._objectify_request(method="GET", params=params, path=path) File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\reddit.py", line 739, in _objectify_request self.request( File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\util\deprecate_args.py", line 43, in wrapped return func(**dict(zip(_old_args, args)), **kwargs) File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\reddit.py", line 941, in request return self._core.request( File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\sessions.py", line 330, in request return self._request_with_retries( File "C:\Users\pizzabagel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\sessions.py", line 266, in _request_with_retries raise self.STATUS_EXCEPTIONSresponse.status_code prawcore.exceptions.BadRequest: received 400 HTTP response

p1x3lll avatar Jun 02 '22 21:06 p1x3lll

I am not sure if this helps but I got the same 400 error when inputting r/Askreddit I re ran the program by ignoring the input field when asked and just pressing enter, this seemed to have worked for me

2StrokeDiesel avatar Jun 02 '22 22:06 2StrokeDiesel

what do you mean by "re ran the program by ignoring the input field when asked and just pressing enter"? did you remove r/AskReddit from the .env file or what

p1x3lll avatar Jun 02 '22 22:06 p1x3lll

I fixed it by removing the r/ from the .env file

p1x3lll avatar Jun 02 '22 22:06 p1x3lll

In the .env file i never put a specific sub reddit all i did was leave it blank and it asked me appon running the program

2StrokeDiesel avatar Jun 02 '22 22:06 2StrokeDiesel