dchristl / macless-haystack

Create your own AirTag with OpenHaystack, but without the need to own an Apple device
GNU General Public License v3.0
414 stars 66 forks source link

"ValueError: Invalid format string" error when trying to fetch #138

Closed Philip2809 closed 4 weeks ago

Philip2809 commented 4 weeks ago

I was having problems with getting my 2FA codes and then the too low score problem, solved this by running the python script directly (changing the phoneid to 2) and signing in to a real mac device.

I however now get this error:

Exception occurred during processing of request from ('127.0.0.1', 52715)
Traceback (most recent call last):
  File "C:\Users\Philip\AppData\Local\Programs\Python\Python39\lib\socketserver.py", line 316, in _handle_request_noblock       
    self.process_request(request, client_address)
  File "C:\Users\Philip\AppData\Local\Programs\Python\Python39\lib\socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "C:\Users\Philip\AppData\Local\Programs\Python\Python39\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)     
  File "C:\Users\Philip\AppData\Local\Programs\Python\Python39\lib\socketserver.py", line 747, in __init__
    self.handle()
  File "C:\Users\Philip\AppData\Local\Programs\Python\Python39\lib\http\server.py", line 425, in handle
    self.handle_one_request()
  File "C:\Users\Philip\AppData\Local\Programs\Python\Python39\lib\http\server.py", line 413, in handle_one_request
    method()
  File "C:\Philip\GitHub\macless-haystack\endpoint\mh_endpoint.py", line 89, in do_POST
    unixEpoch = int(datetime.now().strftime('%s'))
ValueError: Invalid format string

When it tried to query to 7 days with my id. Any ideas what could be causing this?

Philip2809 commented 4 weeks ago

nevermind I am just stupid, replace int(datetime.now().strftime('%s')) with int(datetime.now().timestamp()) and it works perfectly!

Thank for this awesome project!