Comments (2)
I just corrected the part where it gets a token, not where it was complaining continually that I need to add the user back again. I can't test that until I rebuild the docker container and push that to the machines that run things.
It was fun tracking it down and I learned a bit about python.
from plex_debrid.
The change fixed it, it now works perfectly. :)
This is the change that I made to /content/services/trakt.py
Starting around line 159, replaced the post and the oauth functions.
def post(url, data, auth=False):
try:
if auth:
headers = {
'Content-type': "application/json"
}
else:
headers={
'Content-type': "application/json", "trakt-api-key": client_id, "trakt-api-version": "2",
"Authorization": "Bearer " + current_user[1]}
response = session.post(url, headers=headers, data=data)
logerror(response)
response = json.loads(response.content, object_hook=lambda d: SimpleNamespace(**d))
time.sleep(1.1)
except:
response = None
return response
def oauth(code=""):
if code == "":
response = post(url='https://api.trakt.tv/oauth/device/code', data=json.dumps({'client_id': client_id}), auth=True)
if not response is None:
return response.device_code, response.user_code
else:
print("trakt.tv could not be reached right now! Please try again later. The script will most likely exit after this message.")
time.sleep(5)
else:
response = None
while response is None:
response = post(url='https://api.trakt.tv/oauth/device/token', data=json.dumps(
{'code': code, 'client_id': client_id, 'client_secret': client_secret}),auth=True)
time.sleep(1)
return response.access_token
from plex_debrid.
Related Issues (20)
- [SOLVED:] Additional Users - Does Not Work HOT 1
- SUGGESTION - Plex-Debrid Logo
- failed to create shim task: OCI runtime create failed: HOT 1
- Can't add Overseerr to plex_debrid HOT 1
- Permissions plex folders HOT 1
- Script not working at all for last two months HOT 11
- 1337x unavailable
- Trakt New API integration required HOT 20
- Unable to get Trakt added HOT 1
- Zurg Media Becomes Unavailable
- 4k and HD
- regex HOT 1
- Error adding Trakt user HOT 4
- Version Question/Issue
- Unablet to connect to real debrid
- plex debrid unable to reach trakt HOT 2
- Trakt collection not updating HOT 2
- Playback error, requires restart to stream HOT 5
- Files downloaded in wrong directory, cannot move HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plex_debrid.