Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Binary Location Must be a String #4

Open
P6g9YHK6 opened this issue Dec 29, 2024 · 2 comments
Open

TypeError: Binary Location Must be a String #4

P6g9YHK6 opened this issue Dec 29, 2024 · 2 comments

Comments

@P6g9YHK6
Copy link

I am getting the following error, i am not certain that i am running it correctly tho.
also it seems to me that setuptools is missing from the requirements.

⚡XXXX ❯❯ & C:/Users/XXXX/AppData/Local/Programs/Python/Python312/python.exe c:/Users/XXXX/GoogleFindMyTools/main.py
[UsernameProvider] Username was not setup yet. Enter your Google Username (Email without @gmail.com)') and hit enter:XXXX.YYYYY          
[AppTokenRetrieval] Asking Server for android_device_manager token.
[TokenCache] Using cached username
GCM register request attempt 1 out of 2 has failed with Error=PHONE_REGISTRATION_ERROR
[FCMReceiver] Credentials updated.
[FCMReceiver] Retrieved FCM Token successfully: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[FCMReceiver] Listening for notifications.
[AuthFlow] This script will now open Google Chrome on your device.
    Make that you allow Python (or PyCharm) to control Chrome (macOS only).
    Please login with your Google account.
[AuthFlow] Press Enter to continue...
[AuthFlow] Installing ChromeDriver...
Traceback (most recent call last):
  File "c:\Users\XXXX\GoogleFindMyTools\main.py", line 9, in <module>
    list_devices()
  File "c:\Users\XXXX\GoogleFindMyTools\NovaApi\ListDevices\nbe_list_devices.py", line 43, in list_devices
    result_hex = request_device_list()
                 ^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\NovaApi\ListDevices\nbe_list_devices.py", line 19, in request_device_list
    result = nova_request(NOVA_LIST_DEVICS_API_SCOPE, hex_payload)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\NovaApi\nova_request.py", line 18, in nova_request
    android_device_manager_oauth_token = get_adm_token(get_username())
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\Auth\adm_token_retrieval.py", line 19, in get_adm_token
    cached_adm_token = request_token(username, "android_device_manager")
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\Auth\token_retrieval.py", line 16, in request_token
    aas_token = get_aas_token()
                ^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\Auth\aas_token_retrieval.py", line 27, in get_aas_token
    return get_cached_value_or_set('aas_token', _generate_aas_token)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\Auth\token_cache.py", line 18, in get_cached_value_or_set
    value = generator()
            ^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\Auth\aas_token_retrieval.py", line 17, in _generate_aas_token
    token = request_oauth_account_token_flow()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\XXXX\GoogleFindMyTools\Auth\auth_flow.py", line 26, in request_oauth_account_token_flow
    driver = uc.Chrome(options=chrome_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python312\Lib\site-packages\undetected_chromedriver\__init__.py", line 372, in __init__
    options.binary_location = (
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\chromium\options.py", line 54, in binary_location
    raise TypeError(self.BINARY_LOCATION_ERROR)
TypeError: Binary Location Must be a String
P6g9YHK6 added a commit to P6g9YHK6/GoogleFindMyTools that referenced this issue Dec 29, 2024
@P6g9YHK6 P6g9YHK6 mentioned this issue Dec 29, 2024
@P6g9YHK6
Copy link
Author

P6g9YHK6 commented Dec 29, 2024

the issue was that chrome was not installed on my device in the way that the library was expecting.
i installed ungoogled-chromium via chocolatey and declared the path found with

py
>>> import shutil
>>> print(shutil.which("chrome"))
C:\ProgramData\chocolatey\bin\chrome.EXE

set it in the binary variable added in the PR and voila.

Btw nice project i had a look a couple of month ago on doing exactly this but when looking at the source code of the pages of find my device i could not see anything that could have been exploited

i will order a bluetooth tracker to see if this project works well and could be a replacement to my tile tracker scraping tool
https://github.com/P6g9YHK6/TiletoNextcloud

Openhaystack is a bit too much hassle as it requires a dedicated VM running 24/7.

if you need any help just give shout :)

@leonboe1
Copy link
Owner

leonboe1 commented Jan 2, 2025

Great that it works for you now. I also tried to debug this issue today. Weirdly, for my system it would not work if I set the path. Therefore, I only added a console print if Chrome is not detected on the system. In this case, your solution if offered. That's some python library weirdness, haha.

Regarding your project - Not sure what you are trying to accomplish, but so far, the network quality of Google's Find My seems to be lacking. Sadly, it aggressively drops sightings from other devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants