frederikme / TinderBotz

Automated Tinder bot and scraper using selenium in python.
MIT License
563 stars 144 forks source link

Steps to make it run #142

Open mizitean opened 2 months ago

mizitean commented 2 months ago

GET CODE FROM THIS PULL REQUEST https://github.com/frederikme/TinderBotz/pull/130#issue-2081949157

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
        ...
6. Save the Changes:
`Press Control + X, then Y, then Enter
`
7. Set the Environment Variable in session.py

import os import certifi os.environ['SSL_CERT_FILE'] = certifi.where()



https://github.com/frederikme/TinderBotz/pull/130#issuecomment-2211444862
CyberSardinha commented 1 month ago

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 commented 1 month ago

message me on telegram @mizitean

CyberSardinha commented 1 month ago

I managed to fix it.

Add to the patcher.py

import ssl
import certifi