jodel_api icon indicating copy to clipboard operation
jodel_api copied to clipboard

Verification

Open guitar9 opened this issue 7 years ago • 13 comments

Issue

i cant verify my account. I get this error code:

Creating new account.
Traceback (most recent call last):
  File "jodelUser.py", line 16, in <module>
    j.verify(a)
  File "/usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg/jodel_api/jodel_api.py", line 171, in verify
    verification = self._read_verificiation(android_account)
  File "/usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg/jodel_api/jodel_api.py", line 183, in _read_verificiation
    return android_account.receive_verification_from_gcm()
  File "/usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg/jodel_api/gcmhack.py", line 128, in receive_verification_from_gcm
    return self.receive_verification_from_gcm(False)
  File "/usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg/jodel_api/gcmhack.py", line 98, in receive_verification_from_gcm
    raise Exception("socket closed by server")
Exception: socket closed by server

This is the Code

lat, lng, city = 48.148434, 11.567867, "Munich"
j = jodel_api.JodelAccount(lat=lat, lng=lng, city=city)
a = jodel_api.AndroidAccount()
j.verify(a)
print j.get_account_data()

i dont want to spam anything on jodel. I need only j.get_post_details_v3('postid'). However sometimes it works sometimes and sometimes i get errorcode 478 ...

Environment

If you're reporting a bug, please attach the output of the following commands:

$ pip show jodel_api
Name: jodel-api
Version: 1.2.7
Summary: Unoffical Python Interface to the Jodel API
Home-page: https://github.com/nborrmann/jodel_api
Author: Nils Borrmann
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg
Requires: requests, future, mock, varint, protobuf

$ pip -V
pip 9.0.1 from /home/t/.local/lib/python2.7/site-packages (python 2.7)

$ python -V
Python 2.7.12

$ python -c "import jodel_api; print(jodel_api.JodelAccount.version); print(jodel_api.JodelAccount.secret)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg/jodel_api/__init__.py", line 6, in <module>
    from jodel_api.jodel_api import *
  File "/usr/local/lib/python2.7/dist-packages/jodel_api-1.2.7-py2.7.egg/jodel_api/jodel_api.py", line 6, in <module>
    install_aliases()
  File "/usr/local/lib/python2.7/dist-packages/future/standard_library/__init__.py", line 483, in install_aliases
    import test
  File "test.py", line 2, in <module>
    requests.get('https://api.github.com/user', auth=('user', 'pass'))
NameError: name 'requests' is not defined

guitar9 avatar Jan 02 '18 19:01 guitar9

Looks like Google changed something about the GCM protocol. Don't really have time to debug this now. You can try to add some print statements to see what messages we still receive.

nborrmann avatar Jan 02 '18 21:01 nborrmann

I encountered the same problem, the weird thing is that it will work at some point. It will fail many times and eventually it starts verifying all accounts perfectly. Later it will fail the whole time again and so on. From my experience it's like 15min constant fails and then 15min of success in a loop. Dunno whats going on but it works if you have patience.

ioncodes avatar Jan 03 '18 12:01 ioncodes

oh nice :) Yes sometimes it works and sometimes not

guitar9 avatar Jan 03 '18 16:01 guitar9

Is the account verification still working? With the latest key I started to get Error=PHONE_REGISTRATION_ERROR when tried to verificate new account.

File "C:\...\Python\Python36-32\lib\site-packages\jodel_api\gcmhack.py", line 74, in get_push_token raise GcmException(r.text) jodel_api.gcmhack.GcmException: Error=PHONE_REGISTRATION_ERROR

vaahtokarkki avatar Feb 14 '18 08:02 vaahtokarkki

I checked out the GCM website and got this message: "Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future."

I'm not sure but I think this is the issue, basically we need an update.

Faddy96 avatar Feb 14 '18 21:02 Faddy96

Meh, I'm not sure. They said the same thing a few months back when I wrote the thing. Pretty sure they can't disable the old endpoints, because of old devices without updates.

nborrmann avatar Feb 14 '18 22:02 nborrmann

Thinking the same as @nborrmann. Maybe something changed in the data to GCM? I'm not familiar at all with GCM or FCM so just guessing..

vaahtokarkki avatar Feb 14 '18 22:02 vaahtokarkki

Now the verification with GCM is working again! Maybe it was just some issues with the GCM connection or something else sketchy 🙄

vaahtokarkki avatar Feb 20 '18 15:02 vaahtokarkki

Which steps do you take to add a new account? j.verify_account() or j.get_captcha() doesnt exist. I tried to take a look at the jodel_api.py and discoverd verify() verify_push() and _read_verification() but how do I exactly use them? I tried to print(j.verify) but I get no code in return. _read_verification() always wants a android_account but what is this?

leon1995 avatar Feb 22 '18 19:02 leon1995

rtfm 🙂

nborrmann avatar Feb 22 '18 19:02 nborrmann

@Asdfgasdfg312 For me activation still occasionally fails on PHONE_REGISTRATION_ERROR and socket closed by server. I haven't figured out any pattern why it fails so I guess its just some issues with GCM and just have to deal with it.

vaahtokarkki avatar Feb 28 '18 08:02 vaahtokarkki

In order to devote more time and attention to improving FCM, today we’re announcing that you must upgrade to FCM in the next year. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. We recommend you upgrade sooner rather than later so you can start taking advantage of the new features in FCM today.

Looks like we're good for another year.

nborrmann avatar Apr 11 '18 08:04 nborrmann

Since 2 days the verification is needed to get any jodel. I tried to verify it using the code: lat, lng, city = 48.148434, 11.567867, "Munich" j = jodel_api.JodelAccount(lat=lat, lng=lng, city=city) a = jodel_api.AndroidAccount() j.verify(a) print j.get_account_data()

But the responses are still empty, do you got a way to verify it correctly?

Daedra223 avatar Apr 28 '18 09:04 Daedra223