Open antonioli86 opened 1 year ago
@antonioli86 (most recent call last): File "C:\Users\rober\OneDrive\Pulpit\am_bot-main\watch_script.py", line 239, in refresh foodsi() File "C:\Users\rober\OneDrive\Pulpit\am_bot-main\watch_script.py", line 159, in foodsi items = parse_foodsi_api(foodsi_api.json()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\rober\OneDrive\Pulpit\am_bot-main\watch_script.py", line 121, in parse_foodsi_api for restaurant in api_result['data']:
KeyError: 'data'
Can u get it working to me so it can check only favorites items if anything is available bc the code u told me doesnt work @antonioli86
I had some spare time... check only favorites items is more complex since is not possible to filter out in the GET request. I tried to use some filters and do not work. Also in app is not possible to filter the favorites based on availability. Request to see the favorites and see the related offers: https://api.foodsi.pl/api/v3/user/favourites?include=package.current_offer Only filter possible to use is the one related with deliveries not.
To do a bot only for the favorites is necessary to go offer by offer from the response and check current_quantity and so on. @Robertnoob12, please ignore what I wrote before. That URL before just returns the favorites ids. Sorry for that.
I updated the general script: watch_script2.zip
Maybe you will note some repeated offers... it is coming directly from the Foodsi API, is not generated by this code.
@antonioli86 it can to check offers its not necessary to check favorites. I favorited all avilable products when u load in the app.
Could u make it work so it checks offers @antonioli86 like main page ones if u cant favorites like to give me the foodsi_api request get whole code
Updated code is above - few minutes ago. For now working:
Updated code is above - few minutes ago. For now working:
Works for all offers available for app or only favorites bc as i told earlier i have 10 shops in my app that use foodsi so if any of these will drop any available it will send notifitation?
Or i will have to use this code @antonioli86 related offers: https://api.foodsi.pl/api/v3/user/favourites?include=package.current_offer Only filter possible to use is the one
Updated code is above - few minutes ago. For now working:
Works for all offers available for app or only favorites bc as i told earlier i have 10 shops in my app that use foodsi so if any of these will drop any available it will send notifitation?
Works to all offers in the range you defined in the app (with your user account) - first tab in the app. For favorites only is necessary to update the code.
Ill test it at home
Updated code is above - few minutes ago. For now working:
Works for all offers available for app or only favorites bc as i told earlier i have 10 shops in my app that use foodsi so if any of these will drop any available it will send notifitation?
Works to all offers in the range you defined in the app (with your user account) - first tab in the app. For favorites only is necessary to update the code.
Ok thats good so i can just run the python code u sent and ill be fine?
Hopefully no updates soon. It took a long time to get it working ugh
theres a problem @antonioli86 back home and ugh... it grabs info from not my location.
and it crashes after
Are you using same user in the script config as in the app? In my side is still running and no issues.
im not from there either
oh wait
now this i changed the details the acc was outdated i think
it was working earlier now its completely broken
its a good config i guess?
below email is password
Are you using same user in the script config as in the app? In my side is still running and no issues.
and yeah
Did you changed anything in the code I sent. like the request? Confirm if the details of you user are fine - in the code do a request to https://api.foodsi.pl/api/v3/user/users/current and print the result. It should be something like:
Then you confirm if the coordinates and range are fine.
i cant do anything
everytime i open that happens
You need to debug... add a print in the code after the request (like print(foodsi_api.json()) ). this will fail - is normal - is just to test. You dont need to put the result here... just check if the coordinate and the range are fine
You need to debug... add a print in the code after the request (like print(foodsi_api.json()) ). this will fail - is normal - is just to test. You dont need to put the result here... just check if the coordinate and the range are fine
it must be ok
it was ok earlier and it broke somehow when i switched to the acc i was using on foodsi...
when i added print(foodsi_api.json()) it crashed insta
App will crash... check in the window the output. "when i switched to the acc " - I dont understand.
i made a new account , deleted the old one edited the config same issue
App will crash... check in the window the output. "when i switched to the acc " - I dont understand.
i logged out and logged in the account that i used on the Foodsi config, then it broke
So its normal that app crashed. Please update in the app all parameters - location and range. Then in config put this new user and password and start application.
do i have to change this foodsi_api = requests.get('https://api.foodsi.pl/api/v3/user/offers?filter[package_category_ids][not_eq]=[13]&filter[package_category_ids][eq]=[9,1]&filter[active][eq]=true&filter[current_quantity][gt]=0&filter[pickup_to][gt]='+waw_dt.strftime('%Y-%m-%dT%H:%M:%S%z')+'&page[size]=15&sort=distance,pickup_from', headers = {'Content-type':'application/json', 'system-version':'android_3.0.0', 'user-agent':'okhttp/3.12.0', 'Access-Token': access_token, 'Client': client, 'Uid': uid})
So its normal that app crashed. Please update in the app all parameters - location and range. Then in config put this new user and password and start application.
i dont mean the app, the whole python script before i ran it showed information that some products were available but now it shows me KeyError: 'links'
the products were not in my city by the way
do i have to change this foodsi_api = requests.get('https://api.foodsi.pl/api/v3/user/offers?filter[package_category_ids][not_eq]=[13]&filter[package_category_ids][eq]=[9,1]&filter[active][eq]=true&filter[current_quantity][gt]=0&filter[pickup_to][gt]='+waw_dt.strftime('%Y-%m-%dT%H:%M:%S%z')+'&page[size]=15&sort=distance,pickup_from', headers = {'Content-type':'application/json', 'system-version':'android_3.0.0', 'user-agent':'okhttp/3.12.0', 'Access-Token': access_token, 'Client': client, 'Uid': uid})
If you want to debug, change that to foodsi_api = requests.get('https://api.foodsi.pl/api/v3/user/users/current', headers = {'Content-type':'application/json', 'system-version':'android_3.0.0', 'user-agent':'okhttp/3.12.0', 'Access-Token': access_token, 'Client': client, 'Uid': uid})
and add below
print(foodsi_api.json())
App will crash. Check is if your account details are fine.
it doesnt work ill try to record
it doesnt work ill try to record
Should be something like that in the code.
Then when you run will crash but will appear the results in the window:
and as u can see the update date of the json file it is same as before, nothing changed @antonioli86
ill try like u do
You need to run from command line to debug. CMD Then go to the folder where you have the script python3 "script name"
ugh...
i got it working @antonioli86
App crashes - is normal. coordinates and range are fine? If yes - put the original code and should be fine.
it didnt crash @antonioli86
i updated coordinates
OFCOURSE!!!
Hi,
Seems with latest update they changed something:
Someone already debug it?