nborrmann / jodel_api

Unoffical Python Interface to the Jodel API
MIT License
150 stars 33 forks source link

Verification #61

Open guitar9 opened 6 years ago

guitar9 commented 6 years ago

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: n.borrmann@googlemail.com
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
nborrmann commented 6 years ago

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.

ioncodes commented 6 years ago

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.

guitar9 commented 6 years ago

oh nice :) Yes sometimes it works and sometimes not

vaahtokarkki commented 6 years ago

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

Faddy96 commented 6 years ago

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.

nborrmann commented 6 years ago

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.

vaahtokarkki commented 6 years ago

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 commented 6 years ago

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

leon1995 commented 6 years ago

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?

nborrmann commented 6 years ago

rtfm 🙂

vaahtokarkki commented 6 years ago

@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.

nborrmann commented 6 years ago

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.

Daedra223 commented 6 years ago

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?