Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Does not work with PRAW 7.7.1, throws a 429 HTTP Response instead #954

Open
iammarxg opened this issue Mar 26, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@iammarxg
Copy link

  • [ yes ] I am reporting a bug.
  • [ yes ] I am running the latest version of BDfR
  • [ yes ] I have read the Opening an issue

Description

Using PRAW 7.7.1 returns a 429 HTTP Response. Using 7.7.0 does not, and it allows bdfr to run normally.

Command

py -m bdfr download ./REDDIT-DL -s SUBREDDITNAME -S new -t all --file-scheme {DATE}-{TITLE}-{POSTID}

Environment (please complete the following information)

  • OS: Windows 11
  • Python version: 3.10

Logs

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\lib\site-packages\bdfr\__main__.py", line 222, in <module>
    cli()
  File "C:\Python310\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Python310\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python310\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\Python310\lib\site-packages\bdfr\__main__.py", line 117, in cli_download
    reddit_downloader = RedditDownloader(config, [stream])
  File "C:\Python310\lib\site-packages\bdfr\downloader.py", line 41, in __init__
    super(RedditDownloader, self).__init__(args, logging_handlers)
  File "C:\Python310\lib\site-packages\bdfr\connector.py", line 65, in __init__
    self.reddit_lists = self.retrieve_reddit_lists()
  File "C:\Python310\lib\site-packages\bdfr\connector.py", line 168, in retrieve_reddit_lists
    master_list.extend(self.get_subreddits())
  File "C:\Python310\lib\site-packages\bdfr\connector.py", line 276, in get_subreddits
    self.check_subreddit_status(reddit)
  File "C:\Python310\lib\site-packages\bdfr\connector.py", line 438, in check_subreddit_status
    assert subreddit.id
  File "C:\Python310\lib\site-packages\praw\models\reddit\base.py", line 35, in __getattr__
    self._fetch()
  File "C:\Python310\lib\site-packages\praw\models\reddit\subreddit.py", line 827, in _fetch
    data = self._fetch_data()
  File "C:\Python310\lib\site-packages\praw\models\reddit\base.py", line 89, in _fetch_data
    return self._reddit.request(method="GET", params=params, path=path)
  File "C:\Python310\lib\site-packages\praw\util\deprecate_args.py", line 43, in wrapped
    return func(**dict(zip(_old_args, args)), **kwargs)
  File "C:\Python310\lib\site-packages\praw\reddit.py", line 941, in request
    return self._core.request(
  File "C:\Python310\lib\site-packages\prawcore\sessions.py", line 330, in request
    return self._request_with_retries(
  File "C:\Python310\lib\site-packages\prawcore\sessions.py", line 266, in _request_with_retries
    raise self.STATUS_EXCEPTIONS[response.status_code](response)
prawcore.exceptions.TooManyRequests: received 429 HTTP response
@iammarxg iammarxg added the bug Something isn't working label Mar 26, 2024
@mbarr564
Copy link

This was working for me just three weeks ago, with praw 7.7.1, and may be something reddit broke on their API recently.
I tried my working environment again today, and I'm now getting HTTP 429 responses.
Thanks for mentioning the praw downlevel workaround.

@jgore077
Copy link

@mbarr564 Is this fix still working?

@jgore077
Copy link

I can confirm that the frequency of 429's goes down when using praw 7.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants