TraySimpson / RedditVideoGenerator

334 stars 135 forks source link

what should i do for this #16

Closed chris6676776 closed 1 year ago

chris6676776 commented 1 year ago

when I run main.py I get this error

line 7, in createVideo outputDir = config["General"]["OutputDirectory"]

line 87, in createVideo()

kalix123 commented 1 year ago

Did you create the output directory that is set inside of config.ini?

chris6676776 commented 1 year ago

I fixed it but now I am getting this when I run the code

File "C:\Users\Chris\Documents\GitHub\try-auto\main.py", line 87, in createVideo() File "C:\Users\Chris\Documents\GitHub\try-auto\main.py", line 17, in createVideo script = reddit.getContent(outputDir, postOptionCount) File "C:\Users\Chris\Documents\GitHub\try-auto\reddit.py", line 14, in getContent for submission in reddit.subreddit("askreddit").top(time_filter="day", limit=postOptionCount*3): File "C:\Users\Chris\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\Chris\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\Chris\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\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\reddit.py", line 712, in get return self._objectify_request(method="GET", params=params, path=path) File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\praw\reddit.py", line 517, in _objectify_request self.request( File "C:\Users\Chris\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\Chris\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\Chris\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\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\sessions.py", line 228, in _request_with_retries response, saved_exception = self._make_request( File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\sessions.py", line 185, in _make_request response = self._rate_limiter.call( File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\rate_limit.py", line 33, in call kwargs["headers"] = set_header_callback() File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\sessions.py", line 283, in _set_header_callback self._authorizer.refresh() File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\auth.py", line 373, in refresh self._request_token( File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\auth.py", line 155, in _request_token response = self._authenticator._post(url, **data) File "C:\Users\Chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prawcore\auth.py", line 38, in _post raise ResponseException(response) prawcore.exceptions.ResponseException: received 401 HTTP response

alexlostorto commented 1 year ago

Now that is a beautiful stack trace - I definitely would not want to be the one debugging that!

:O

camden-pina commented 1 year ago

I fixed this error when incorrectly setting the 'CLIENT_ID' variable in reddit.py. Ensure your configuration variables are correct.