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

Steps to make it run #142

Open
mizitean opened this issue Jul 5, 2024 · 4 comments
Open

Steps to make it run #142

mizitean opened this issue Jul 5, 2024 · 4 comments

Comments

@mizitean
Copy link

mizitean commented Jul 5, 2024

GET CODE FROM THIS PULL REQUEST
#130 (comment)

and then follow steps

U MIGHT HAVE DIFFERENT VERSION THAN MINE (3.10), BUT IT SHOULD WORK FOR YOUR VERSION ALSO

  1. Comment in session.py
    # self.browser.quit()

  2. Navigate to the undetected_chromedriver Package Directory:
    cd /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/undetected_chromedriver

  3. Update certifi: Ensure you have the latest version of the certifi package:
    /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --upgrade certifi

  4. Edit the patcher.py File
    nano patcher.py

  5. Modify the fetch_release_number Method:

def fetch_release_number(self):
    context = ssl.create_default_context(cafile=certifi.where())
    
    with urlopen(self.url_repo + path, context=context) as conn:
        # existing code to fetch and process the release number
        ...

  1. Save the Changes:
    Press Control + X, then Y, then Enter
  2. Set the Environment Variable in session.py
import os
import certifi
os.environ['SSL_CERT_FILE'] = certifi.where()

#130 (comment)

@CyberSardinha
Copy link

CyberSardinha commented Aug 13, 2024

Thank for your time and help,

I've tried to follow your steps but now I get a ssl error.

Traceback (most recent call last):
File "/home/user/TinderBotz/quickstart.py", line 10, in
session = Session()
^^^^^^^^^
File "/home/user/TinderBotz/tinderbotz/session.py", line 120, in init
self.browser = uc.Chrome(options=options) # ChromeDriverManager().install(),
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.12/site-packages/undetected_chromedriver/init.py", line 258, in init
self.patcher.auto()
File "/home/user/.local/lib/python3.12/site-packages/undetected_chromedriver/patcher.py", line 175, in auto
release = self.fetch_release_number()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.12/site-packages/undetected_chromedriver/patcher.py", line 233, in fetch_release_number
context = ssl.create_default_context(cafile=certifi.where())
^^^
NameError: name 'ssl' is not defined. Did you forget to import 'ssl'?

I've tried on windows as well and I get:

PS C:\Users\user\Desktop\bot> python quickstart.py
Getting ChromeDriver ...
Traceback (most recent call last):
File "C:\Users\user\Desktop\bot\quickstart.py", line 10, in
session = Session()
File "C:\Users\user\Desktop\bot\tinderbotz\session.py", line 120, in init
self.browser = uc.Chrome(options=options) # ChromeDriverManager().install(),
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\undetected_chromedriver_init_.py", line 258, in init
self.patcher.auto()
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\undetected_chromedriver\patcher.py", line 175, in auto
release = self.fetch_release_number()
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\undetected_chromedriver\patcher.py", line 234, in fetch_release_number
context = ssl.create_default_context(cafile=certifi.where())
NameError: name 'ssl' is not defined
/==============\

Tinderbotz
duration: 0
like: 0
dislike: 0
superlike: 0
==============/
Started session: 2024-08-13 15:13:12
Ended session: 2024-08-13 15:13:12

@mizitean
Copy link
Author

message me on telegram @mizitean

@CyberSardinha
Copy link

CyberSardinha commented Aug 14, 2024

I managed to fix it.

Add to the patcher.py

import ssl
import certifi

@Nivid-Dot
Copy link

I managed to fix it.

Add to the patcher.py

import ssl
import certifi

still not working tho, getting exactly the same error message as u in python3 even if I follow the steps described by miziteam

Getting ChromeDriver ...
Traceback (most recent call last):
  File "/home/nivid/Bureau/TinderBotz/quickstart.py", line 16, in <module>
    session = Session(proxy="ip:9001")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nivid/Bureau/TinderBotz/tinderbotz/session.py", line 117, in __init__
    self.browser = uc.Chrome(options=options)  # ChromeDriverManager().install(),
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nivid/.local/lib/python3.12/site-packages/undetected_chromedriver/__init__.py", line 246, in __init__
    self.patcher.auto()
  File "/home/nivid/.local/lib/python3.12/site-packages/undetected_chromedriver/patcher.py", line 125, in auto
    release = self.fetch_release_number()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nivid/.local/lib/python3.12/site-packages/undetected_chromedriver/patcher.py", line 143, in fetch_release_number
    with urlopen(self.url_repo + path, context=context) as conn:
                                 ^^^^
UnboundLocalError: cannot access local variable 'path' where it is not associated with a value

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

3 participants