coskundeniz / ad_clicker

Google Ads clicker
https://coskundeniz.github.io/ad_clicker/
GNU General Public License v3.0
161 stars 62 forks source link

Bought a proxy for a a specific country, but when I run the script it opens Google Chrome localized in a different country #24

Closed sipy closed 1 year ago

sipy commented 1 year ago

Hello, I bought a static proxy for a a specific country, but when I run the script it opens Google Chrome localized in a different country. Why does it happen if I am 100% sure that the IP is located in the country and city i need it to be in?

Thanks

coskundeniz commented 1 year ago

It shouldn't. It sets the geolocation and the timezone according to the proxy country. You can reserve a slot for free to check together.

sipy commented 1 year ago

Yes, thank you.

sipy commented 1 year ago

Hi @coskundeniz , is it possibile to hardcode the geolocalization of the generated chrome browser instance? In my case it would be enough simply hardcode the location. This will solve my specific problem

Thanks

coskundeniz commented 1 year ago

Yes, you can try changing the following parts in utils.py file.

    ```
    # lat, long = get_location(geolocation_db_client, proxy, auth) --> commented

    if lat and long:  --> remove this line, unindent the code below, and replace <> parts with your values 
        driver.execute_cdp_cmd(
            "Emulation.setGeolocationOverride",
            {"latitude": <your latitude>, "longitude": <your longitude>, "accuracy": accuracy},
        )

        response = requests.get(
            f"http://timezonefinder.michelfe.it/api/0_{<your longitude>}_{<your latitude>}", timeout=5
        )
sipy commented 1 year ago

Ok, I made the changes you suggested, but it still localizes the wrong country. Romania instead of Bulgaria. Here is the code:

image

coskundeniz commented 1 year ago

Also, remove the parenthesis here but it won't change the result anyway. f"http://timezonefinder.michelfe.it/api/0_{<your longitude>}_{<your latitude>}", timeout=5

I don't have an idea why it happens.

coskundeniz commented 1 year ago

Closing since there is no obvious thing to do on the tool side.