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] Error when sending a command that requires authentication #941

Open
3 tasks done
DasMadScientist opened this issue Feb 5, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@DasMadScientist
Copy link

DasMadScientist commented Feb 5, 2024

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

Description

I was trying to check how BDfR worked, and I tried to run a command to download my saved posts, but when it tried to authenticate me, it errored into those logs I posted. I already configured the config file putting my client ID and secret (I actually did it three times as I tried an older one, but also created a couple more for scripts and web apps), and BDfR works normally not counting the auth thing. But I'm stuck at auth when I try something like downloading saved posts or upvotes.
Thanks in advance.

Command

bdfr download ./downloads --user me --saved --authenticate
bdfr download ./downloads --user me --saved --authenticate -L 25 --file-scheme '{POSTID}'
bdfr download ./downloads --user me --saved --authenticate --file-scheme '{POSTID}'
bdfr download ./downloads --user me --upvoted  --authenticate

Environment

  • OS: Windows 11 Pro v23H2
  • Python version: 3.12.1

Logs

log_output.txt

[2024-02-05 03:39:54,971 - bdfr.connector - DEBUG] - Disabling the following modules: 
[2024-02-05 03:39:54,972 - bdfr.connector - Level 9] - Created download filter
[2024-02-05 03:39:54,972 - bdfr.connector - Level 9] - Created time filter
[2024-02-05 03:39:54,972 - bdfr.connector - Level 9] - Created sort filter
[2024-02-05 03:39:55,013 - bdfr.connector - Level 9] - Create file name formatter
[2024-02-05 03:39:55,013 - bdfr.connector - DEBUG] - Using authenticated Reddit instance
[2024-02-05 03:39:55,014 - bdfr.connector - Level 9] - Commencing OAuth2 authentication
[2024-02-05 03:39:55,500 - root - ERROR] - Downloader exited unexpectedly
Traceback (most recent call last):
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\__main__.py", line 117, in cli_download
    reddit_downloader = RedditDownloader(config, [stream])
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\downloader.py", line 41, in __init__
    super(RedditDownloader, self).__init__(args, logging_handlers)
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\connector.py", line 63, in __init__
    self._setup_internal_objects()
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\connector.py", line 80, in _setup_internal_objects
    self.create_reddit_instance()
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\connector.py", line 139, in create_reddit_instance
    oauth2_authenticator = OAuth2Authenticator(
                           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\oauth2.py", line 21, in __init__
    self._check_scopes(wanted_scopes)
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\bdfr\oauth2.py", line 31, in _check_scopes
    known_scopes = [scope for scope, data in response.json().items()]
                                             ^^^^^^^^^^^^^^^
  File "C:\Users\Dashy\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@DasMadScientist DasMadScientist added the bug Something isn't working label Feb 5, 2024
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

1 participant