This module is simply just an API Wrapper and account generator. So it's an API Wrapper with free copilots.
This module uses emailnator to generate new accounts. As you know, when you create a new account, you will have 5 copilots. That's how it works! This module will generate you new gmails (using @googlemail.com right now) with emailnator and you will have UNLIMITED COPILOTS!
- requests
- beautifulsoup4
- lxml (Parser for BeautifulSoup)
- websocket-client
Install requirements with:
pip3 install -r requirements.txt
or with single-line command:
pip3 install requests&&pip3 install beautifulsoup4&&pip3 install lxml&&pip3 install websocket-client
First thing first, Perplexity.ai is protected by cloudflare, and emailnator too. We need to open this pages manually and get the cookies. And do not forget these cookies are temporary, so you need to renew them continuously. Here how to get your cookies.
import perplexity
perplexity_headers = <your headers here>
perplexity_cookies = <your cookies here>
emailnator_headers = <your headers here>
emailnator_cookies = <your cookies here>
perplexity_cli = perplexity.Client(perplexity_headers, perplexity_cookies)
perplexity_cli.create_account(emailnator_headers, emailnator_cookies) # Creates a new gmail, so your 5 copilots will be renewed. You can pass this one if you are not going to use "copilot" mode
# modes = ['concise', 'copilot']
# focus = ['internet', 'scholar', 'writing', 'wolfram', 'youtube', 'reddit', 'wikipedia']
print(perplexity_cli.search('Your query here', mode='copilot', focus='internet'))
# perplexity_cli.create_account(emailnator_headers, emailnator_cookies) # Call this function when you're out of copilots
Do not forget these cookies are temporary, so you need to renew them continuously.
- Open emailnator website. Click F12 or Ctrl + Shift + I to open inspector. Check "Preserve log" button, go to the "Network" tab in the inspector, click the "Go !" button in the website, right click the "message-list" in the Network Tab and hover on "Copy" and click to "Copy as cURL (bash)". Now go to the curlconverter, paste your code here. The header and cookies dictionary will appear, copy them and use in your codes.
- Open Perplexity.ai website. Sign out if you're signed in. Click F12 or Ctrl + Shift + I to open inspector. Check "Preserve log" button, go to the "Network" tab in the inspector, click the "Sign Up" button in the website, write a random email and click "Continue with Email" button, right click the "email" in the Network Tab and hover on "Copy" and click to "Copy as cURL (bash)". Now go to the curlconverter, paste your code here. The header and cookies dictionary will appear, copy them and use in your codes.
- Don't confuse the headers and cookies for emailnator and Perplexity.ai, look at How To Use to learn how to use them.