JodelRaccoons / jodel_api

Unoffical Python Interface to the Jodel API
https://github.com/nborrmann/jodel_api
MIT License
18 stars 7 forks source link

Getting 477, '{"error":"Signed request expected","metadata":null}' Even though using new Key #9

Closed FutureCyberMan closed 3 years ago

FutureCyberMan commented 3 years ago

Issue

When initializing the JodelAccount class with my own secret key and version #, I am still getting the error above. Is there something I am missing? I am looking for guidance because this is the only API that seems to be up to date right now, so this would be a huge help.

Thank you for the help.

Unbrick commented 3 years ago

Could you include the key and version number you used?

FutureCyberMan commented 3 years ago

Could you include the key and version number you used?

Secret: LGxrRUBWxgsqQTLFLvcWXLTyxAXcLomxPRqFcgAW Version #: 5.112.0.

I got the key using your frida method.

Unbrick commented 3 years ago

Got the same key right here but for version 5.112.1. The tests inbuilt in the jodel_api all pass with this secret and version number except for three tests:

test/test_jodel_api.py::TestUnverifiedAccount::test_popular_after FAILED                                                                                                                                                                               [ 20%]
test/test_jodel_api.py::TestUnverifiedAccount::test_channel_after FAILED                                                                                                                                                                               [ 23%]
test/test_jodel_api.py::TestUnverifiedAccount::test_get_posts_channel FAILED
FutureCyberMan commented 3 years ago

So I ran the test file, and I am getting all failures using the key and version '5.112.1'. Just to confirm, I am instantiating the Jode Account like this:

>>> import jodel_api
>>> lat, lng, city = 48.148434, 11.567867, "Munich"
>>> secret = 'LGxrRUBWxgsqQTLFLvcWXLTyxAXcLomxPRqFcgAW'.encode('ascii')
>>> version = '5.112.1'
>>> j = jodel_api.JodelAccount(lat=lat, lng=lng, city=city, _secret=secret, _version=version) 

I also modified the test document to match the correct keys/version accordingly to run it. I feel as if I am missing something here. I appreciate the help.

Unbrick commented 3 years ago

When you run the tests (python setup.py test) you have to change the key and version inside the jodel_api.py file itself.

Which path did you use to install the jodel_api package? Do you use the official egg by nborrmann (pip install jodel_api) or ours (pip3 install git+git://github.com/JodelRaccoons/jodel_api.git#egg=jodel-api)? The official one by nborrmann is outdated and most probably will not work anymore.

Additionally did you check your IP-Address? Sometimes i have seen some address spaces to be limited due to massive botting. You might want to try a vpn or a proxy.

The code i use for manual testing looks like this:

from jodel_api import JodelAccount

lat, lng, city = 48.148434, 11.567867, "Munich"
secret = 'LGxrRUBWxgsqQTLFLvcWXLTyxAXcLomxPRqFcgAW'.encode('ascii')
version = '5.112.1'
j = JodelAccount(lat=lat, lng=lng, city=city, _secret=secret, _version=version)
posts = j.get_posts_popular(timeRange='pastWeek', lat=lat, lng=lng)
print(posts)

and so far it works like a charm! I'll update the jodel_api.py in the repo with the current key and version number right away, could make testing easier for you!

FutureCyberMan commented 3 years ago

When you run the tests (python setup.py test) you have to change the key and version inside the jodel_api.py file itself.

Which path did you use to install the jodel_api package? Do you use the official egg by nborrmann (pip install jodel_api) or ours (pip3 install git+git://github.com/JodelRaccoons/jodel_api.git#egg=jodel-api)? The official one by nborrmann is outdated and most probably will not work anymore.

Additionally did you check your IP-Address? Sometimes i have seen some address spaces to be limited due to massive botting. You might want to try a vpn or a proxy.

The code i use for manual testing looks like this:

from jodel_api import JodelAccount

lat, lng, city = 48.148434, 11.567867, "Munich"
secret = 'LGxrRUBWxgsqQTLFLvcWXLTyxAXcLomxPRqFcgAW'.encode('ascii')
version = '5.112.1'
j = JodelAccount(lat=lat, lng=lng, city=city, _secret=secret, _version=version)
posts = j.get_posts_popular(timeRange='pastWeek', lat=lat, lng=lng)
print(posts)

and so far it works like a charm! I'll update the jodel_api.py in the repo with the current key and version number right away, could make testing easier for you!

I appreciate the help. As of now, I am up and running. Great stuff. It works very well.

Just a quick follow-up question, what is the max # of posts I can gather in a single "get_posts" request? Currently it doesn't seem to be too much. Not a huge issue beacause I can just do more requests over a given time interval; however, I am just curious because an increase would be nice.

Thank you again for the prompt response. Really making my life easy.

Unbrick commented 3 years ago

Glad I could help!

As of my knowledge you can define the amount of posts to retrieve with the limit parameter within the request. I'll look into it later!

Unbrick commented 3 years ago

Does the limit argument work for you?

FutureCyberMan commented 3 years ago

Currently, no matter what I set the limit to, I receive 30 posts/post data. For example, limit = 15 results in 30 posts and limit = 60 results in 30 posts.

ToasteR1032 commented 3 years ago

Currently, no matter what I set the limit to, I receive 30 posts/post data. For example, limit = 15 results in 30 posts and limit = 60 results in 30 posts.

This should be fixed by PR #10. You could try (re-)installing the newest version of jodel_api.

Unbrick commented 3 years ago

Closing this issue due to inactivity. @ToasteR1032 thank you for your help!