-
Notifications
You must be signed in to change notification settings - Fork 16
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
SpiffyTitles no longer pulling for reddit -- 403 #58
Comments
Yeah, someone mentioned this to me yesterday... Knew this was coming eventually with the API changes... I need to look at the documentation, chances are an API key will now be required at minimum... |
@hello-party |
I've got this working locally, but I lack the skills to properly implement it. You will need new Reddit "app" and set it to type SCRIPT, set the redirect URL to whatever, like Run the following code locally to fetch a Token (create a .py file, run it after): #!/usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth
# Replace these with your client ID and secret from Reddit
client_id = 'CLIENT_ID'
client_secret = 'CLIENT_SECRET'
# Headers and data for the request
headers = {
'User-Agent': 'Limnoria'
}
data = {
'grant_type': 'client_credentials'
}
# Request to get the access token
response = requests.post('https://www.reddit.com/api/v1/access_token',
auth=HTTPBasicAuth(client_id, client_secret),
data=data, headers=headers)
# Extract the access token from the response
access_token = response.json().get('access_token')
print("Access Token:", access_token) (please be aware that I lazied this with ChatGPT, but it works, replace the Client ID and Secret with the ones you got from creating the app on reddit.com) Once you run the code, you will get the your new Access token. In headers = { "User-Agent": "Limnoria",
"Authorization": "bearer YOUR_ACCESS_TOKEN" } Replace the pattern URLs with Should be easy to implement by someone with more coding skills than me. EDIT: Right... I completely didn't realize that the Reddit token has a TTL, which is 24 hours right now. Back to the drawing board. |
/me keeps his fingers crossed |
I have made a PR to this issue. Hope it get merged :) |
This is in the log. The URL is valid, however.
The text was updated successfully, but these errors were encountered: