0
# Create the Reddit instance
reddit = praw.Reddit(
    client_id=client_id,
    client_secret=client_secret,
    redirect_uri=redirect_uri,
    user_agent=user_agent
)

all_scopes = ['creddits', 'edit', 'flair', 'history', 'identity', 'modconfig', 'modcontributors',
              'modflair', 'modlog', 'modothers', 'modposts', 'modself', 'modwiki', 'mysubreddits',
              'privatemessages', 'read', 'report', 'save', 'submit', 'subscribe', 'vote', 'wikiedit', 'wikiread']

auth_url = reddit.auth.url(all_scopes, 'UniqueState', 'permanent')

# Print the authorization URL and instruct the user to visit it in a web browser
print("Please visit the following URL to authorize the application:")
print(auth_url)

chrome.open(auth_url)


# Wait for the auth_code to be captured by the server
while auth_code is None:
    time.sleep(1)

access_token = reddit.auth.authorize(auth_code)


reddit.redditor("<username>").block() # 403 error code

reddit.redditor("<username>").block() gives me error code 403, while reading and writting submissions work, I tried to provide all the oAuth scopes that are listed here https://praw.readthedocs.io/en/v3.6.2/pages/oauth.html#oauth-scopes and still it is the same.

Through the reddit.com I can search the user to his profile and block him, however praw gives me 403, any idea why through the UI works and with the application not and how to achive the same programatically?

Jim
  • 109
  • 2

0 Answers0