Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ ENV/

# Rope project settings
.ropeproject

# Pycharm IDE
.idea/
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Error Codes

- **401 "Unauthorized"**: Your ``access_token`` is invalid. Either
you messed up, or it is outdated. You need to call
``refresh_access_token()`` or ``refresh_all_token()`` (check the
``refresh_access_token()`` or ``refresh_all_tokens()`` (check the
above section on account creation).
- **401 "Action not allowed"**: You are using a ``4.48`` account
with ``is_legacy=True``, but ``4.48`` accounts are not allowed
Expand All @@ -230,7 +230,9 @@ Error Codes
to one specific endpoint.
- **477 "Signed Request Expected"**: This library should handle request
signing. Make sure to upgrade to the latest version of ``jodel_api``,
as the signing key changes every few weeks.
as the signing key changes every few weeks. You can set the signing key
and version manually through these environment variables:
JODEL_API_JODELKEY and JODEL_API_JODELVERSION (jodel_api will prefer newer versions)
- **478 "Account not verified"**: Verify the account through GCM.
- **502 "Bad Gateway"**: Something went wrong server-side. This happens
pretty randomly. ``jodel_api`` automatically retries two times when
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
long_description = f.read()

setup(name='jodel_api',
version='1.2.11',
version='1.2.12',
description='Unoffical Python Interface to the Jodel API',
long_description=long_description,
url='https://github.com/nborrmann/jodel_api',
Expand Down
19 changes: 17 additions & 2 deletions src/jodel_api/jodel_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from urllib.parse import urlparse
from jodel_api import gcmhack
import time
from os import environ
from re import findall

s = requests.Session()

Expand All @@ -24,10 +26,23 @@ class JodelAccount:

api_url = "https://api.go-tellm.com/api{}"
client_id = '81e8a76e-1e02-4d17-9ba0-8a7020261b26'
secret = 'HtJoqSysGFQXgFqYZRgwbpcFVAzLFSioVKTCwMcL'.encode('ascii')
version = '4.79.1'
secret_legacy = 'hyTBJcvtpDLSgGUWjybbYUNKSSoVvMcfdjtjiQvf'.encode('ascii')
version_legacy = '4.47.0'
secret = 'DKUdMXSujwAPihgJiMzHIDcXaxUNJwhBagBgBYlg'.encode('ascii')
version = '4.84.1'


if not (environ.get('JODEL_API_JODELKEY') == None or environ.get('JODEL_API_JODELVERSION') == None):
ver_environ = [int(s) for s in findall(r'\b\d+\b', environ.get('JODEL_API_JODELVERSION'))]
ver_builtin = [int(s) for s in findall(r'\b\d+\b', version)]

for i in range(len(ver_environ)):
if ver_builtin[i] < ver_environ[i]:
secret = environ.get('JODEL_API_JODELKEY').encode('ascii')
version = environ.get('JODEL_API_JODELVERSION')
break
elif ver_builtin[i] > ver_environ[i]:
break


access_token = None
Expand Down