Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/bazarr/blame/commit/193805bbed1a912433759701809035b6a29970e1/libs/requests_oauthlib/compliance_fixes/douban.py You should set ROOT_URL correctly, otherwise the web may not work correctly.

19 lines
473 B

import json
from oauthlib.common import to_unicode
def douban_compliance_fix(session):
def fix_token_type(r):
token = json.loads(r.text)
token.setdefault('token_type', 'Bearer')
fixed_token = json.dumps(token)
r._content = to_unicode(fixed_token).encode('utf-8')
return r
session._client_default_token_placement = 'query'
session.register_compliance_hook('access_token_response', fix_token_type)
return session