1

So the code is correct, but it seems there is something not working.The proxies file path is correct here Proxies file path: C:\Users\duczl\OneDrive\Desktop\v2main\modules\tools\proxies.txt I run every possible diagnostic. As you can see here in utilityfetcher.py the code is also correct

def GetProxyPairs():
    try:
        prox_pair = {}
        # Use the full path to the "tools" directory
        TOOLS_DIR = join(dirname(abspath(__file__)), "tools")
        proxies_file_path = join(TOOLS_DIR, "proxies.txt")
        print("Proxies file path:", proxies_file_path)  # Print the path for debugging
        with open(proxies_file_path, "r") as f:
            proxy_list = f.readlines()
            for i in range(len(proxy_list)):
                proxy_list[i] = proxy_list[i].strip()
                prox_pair[proxy_list[i].split("-")[0]] = proxy_list[i].split("-")[1]
        proxy_list.clear()
    except:
        logger.PrintColored("Error in GetProxyPairs -> No file or directory tools/proxies.txt", "fail")
        return {}
    return prox_pair

I have also this in main source code idk if it helps

cookies = utility_fetcher.GetCookies()
proxy_pairs = utility_fetcher.GetProxyPairs()
bot_instances = []

The proxies pasted in the proxies.txt is proxies from webshare so that is good also. Idk guys pls help me I use absolute path also.

I want to run the script and make it work

John Gordon
  • 29,573
  • 7
  • 33
  • 58
  • 1
    (1) Format the code properly. (2) Show the full traceback of the error as properly formatted text (formatted as code) in the question. – Michael Butscher Jul 29 '23 at 15:12
  • The file path `C:\Users\duczl\OneDrive\Desktop\v2main\modules\tools\proxies.txt` is just wrong. Simple as that. – John Gordon Jul 29 '23 at 15:22
  • You can use this code to show the actual filenames in that directory `print(os.listdir(r'C:\Users\duczl\OneDrive\Desktop\v2main\modules\tools'))` – John Gordon Jul 29 '23 at 15:33
  • So I fixed the file directory, but still getting this. I tried everything now and still. D:\v2main\Scripts\python.exe C:\Users\duczl\OneDrive\Desktop\v2main\source.py Removing .gitingore... Proxies file path: C:\Users\duczl\OneDrive\Desktop\v2main\modules\tools\proxies.txt Error in GetProxyPairs -> No file or directory tools/proxies.txt – Hashin Veselko Jul 29 '23 at 21:40

0 Answers0