Name | webscout JSON |
Version |
2.7
JSON |
| download |
home_page | None |
Summary | Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs |
upload_time | 2024-05-19 15:13:13 |
maintainer | None |
docs_url | None |
author | OEvortex |
requires_python | None |
license | HelpingAI Simplified Universal License |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
<!-- Replace `#` with your actual links -->
<a href="https://t.me/devsdocode"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
<a href="https://www.instagram.com/sree.shades_/"><img alt="Instagram" src="https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white"></a>
<a href="https://www.linkedin.com/in/developer-sreejan/"><img alt="LinkedIn" src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"></a>
<a href="https://buymeacoffee.com/oevortex"><img alt="Buy Me A Coffee" src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black"></a>
</div>
<div align="center">
<!-- Replace `#` with your actual links -->
<a href="https://youtube.com/@OEvortex">➤ Vortex's YouTube Channel</a>
</div>
<div align="center">
<a href="https://youtube.com/@devsdocode">➤ Devs Do Code's YouTube Channel</a>
</div>
# WEBSCOUT
</div>
<p align="center">
<div align="center">
<img src="https://img.shields.io/badge/WebScout-API-blue?style=for-the-badge&logo=WebScout" alt="WebScout API Badge">
</div>
<a href="#"><img alt="Python version" src="https://img.shields.io/pypi/pyversions/webscout"/></a>
<a href="https://pepy.tech/project/webscout"><img alt="Downloads" src="https://static.pepy.tech/badge/webscout"></a>
Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs
## Table of Contents
- [WEBSCOUT](#webscout)
- [Table of Contents](#table-of-contents)
- [Install](#install)
- [CLI version](#cli-version)
- [Regions](#regions)
- [Tempmail and Temp number](#tempmail-and-temp-number)
- [Temp number](#temp-number)
- [Tempmail](#tempmail)
- [Transcriber](#transcriber)
- [DeepWEBS: Advanced Web Searches](#deepwebs-advanced-web-searches)
- [Activating DeepWEBS](#activating-deepwebs)
- [Point to remember before using `DeepWEBS`](#point-to-remember-before-using-deepwebs)
- [Usage Example](#usage-example)
- [Text-to-Speech:](#text-to-speech)
- [Available TTS Voices:](#available-tts-voices)
- [Exceptions](#exceptions)
- [usage of webscout](#usage-of-webscout)
- [1. `text()` - text search by DuckDuckGo.com](#1-text---text-search-by-duckduckgocom)
- [2. `answers()` - instant answers by DuckDuckGo.com](#2-answers---instant-answers-by-duckduckgocom)
- [3. `images()` - image search by DuckDuckGo.com](#3-images---image-search-by-duckduckgocom)
- [4. `videos()` - video search by DuckDuckGo.com](#4-videos---video-search-by-duckduckgocom)
- [5. `news()` - news search by DuckDuckGo.com](#5-news---news-search-by-duckduckgocom)
- [6. `maps()` - map search by DuckDuckGo.com](#6-maps---map-search-by-duckduckgocom)
- [7. `translate()` - translation by DuckDuckGo.com](#7-translate---translation-by-duckduckgocom)
- [8. `suggestions()` - suggestions by DuckDuckGo.com](#8-suggestions---suggestions-by-duckduckgocom)
- [ALL acts](#all-acts)
- [Webscout Supported Acts:](#webscout-supported-acts)
- [usage of webscout AI](#usage-of-webscout-ai)
- [0. `Duckchat` - chat with LLM](#0-duckchat---chat-with-llm)
- [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)
- [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)
- [3. `You.com` - search/chat with you.com](#3-youcom---searchchat-with-youcom)
- [4. `Gemini` - search with google gemini](#4-gemini---search-with-google-gemini)
- [5. `Berlin4h` - chat with Berlin4h](#5-berlin4h---chat-with-berlin4h)
- [6. `BlackBox` - Search/chat With BlackBox](#6-blackbox---searchchat-with-blackbox)
- [7. `PERPLEXITY` - Search With PERPLEXITY](#7-perplexity---search-with-perplexity)
- [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)
- [9. `KOBOLDAI` -](#9-koboldai--)
- [10. `Reka` - chat with reka](#10-reka---chat-with-reka)
- [11. `Cohere` - chat with cohere](#11-cohere---chat-with-cohere)
- [12. `Xjai` - chat with free gpt 3.5](#12-xjai---chat-with-free-gpt-35)
- [13. `ThinkAny` - AI search engine](#13-thinkany---ai-search-engine)
- [14. `chatgptuk` - Chat with gemini-pro](#14-chatgptuk---chat-with-gemini-pro)
- [15. `poe`- chat with poe](#15-poe--chat-with-poe)
- [16. `BasedGPT` - chat with GPT](#16-basedgpt---chat-with-gpt)
- [`LLM`](#llm)
- [`Local-LLM` webscout can now run GGUF models](#local-llm-webscout-can-now-run-gguf-models)
- [`LLM` with internet](#llm-with-internet)
- [LLM with deepwebs](#llm-with-deepwebs)
- [`Webai` - terminal gpt and a open interpeter](#webai---terminal-gpt-and-a-open-interpeter)
## Install
```python
pip install -U webscout
```
## CLI version
```python3
python -m webscout --help
```
| Command | Description |
|-------------------------------------------|-------------------------------------------------------------------------------------------------------|
| python -m webscout answers -k Text | CLI function to perform an answers search using Webscout. |
| python -m webscout images -k Text | CLI function to perform an images search using Webscout. |
| python -m webscout maps -k Text | CLI function to perform a maps search using Webscout. |
| python -m webscout news -k Text | CLI function to perform a news search using Webscout. |
| python -m webscout suggestions -k Text | CLI function to perform a suggestions search using Webscout. |
| python -m webscout text -k Text | CLI function to perform a text search using Webscout. |
| python -m webscout translate -k Text | CLI function to perform translate using Webscout. |
| python -m webscout version | A command-line interface command that prints and returns the version of the program. |
| python -m webscout videos -k Text | CLI function to perform a videos search using DuckDuckGo API. |
[Go To TOP](#TOP)
## Regions
<details>
<summary>expand</summary>
xa-ar for Arabia
xa-en for Arabia (en)
ar-es for Argentina
au-en for Australia
at-de for Austria
be-fr for Belgium (fr)
be-nl for Belgium (nl)
br-pt for Brazil
bg-bg for Bulgaria
ca-en for Canada
ca-fr for Canada (fr)
ct-ca for Catalan
cl-es for Chile
cn-zh for China
co-es for Colombia
hr-hr for Croatia
cz-cs for Czech Republic
dk-da for Denmark
ee-et for Estonia
fi-fi for Finland
fr-fr for France
de-de for Germany
gr-el for Greece
hk-tzh for Hong Kong
hu-hu for Hungary
in-en for India
id-id for Indonesia
id-en for Indonesia (en)
ie-en for Ireland
il-he for Israel
it-it for Italy
jp-jp for Japan
kr-kr for Korea
lv-lv for Latvia
lt-lt for Lithuania
xl-es for Latin America
my-ms for Malaysia
my-en for Malaysia (en)
mx-es for Mexico
nl-nl for Netherlands
nz-en for New Zealand
no-no for Norway
pe-es for Peru
ph-en for Philippines
ph-tl for Philippines (tl)
pl-pl for Poland
pt-pt for Portugal
ro-ro for Romania
ru-ru for Russia
sg-en for Singapore
sk-sk for Slovak Republic
sl-sl for Slovenia
za-en for South Africa
es-es for Spain
se-sv for Sweden
ch-de for Switzerland (de)
ch-fr for Switzerland (fr)
ch-it for Switzerland (it)
tw-tzh for Taiwan
th-th for Thailand
tr-tr for Turkey
ua-uk for Ukraine
uk-en for United Kingdom
us-en for United States
ue-es for United States (es)
ve-es for Venezuela
vn-vi for Vietnam
wt-wt for No region
___
</details>
[Go To TOP](#TOP)
## Tempmail and Temp number
### Temp number
```python
from rich.console import Console
from webscout import tempid
def main():
console = Console()
phone = tempid.TemporaryPhoneNumber()
try:
# Get a temporary phone number for a specific country (or random)
number = phone.get_number(country="Finland")
console.print(f"Your temporary phone number: [bold cyan]{number}[/bold cyan]")
# Pause execution briefly (replace with your actual logic)
# import time module
import time
time.sleep(30) # Adjust the waiting time as needed
# Retrieve and print messages
messages = phone.get_messages(number)
if messages:
# Access individual messages using indexing:
console.print(f"[bold green]{messages[0].frm}:[/] {messages[0].content}")
# (Add more lines if you expect multiple messages)
else:
console.print("No messages received.")
except Exception as e:
console.print(f"[bold red]An error occurred: {e}")
if __name__ == "__main__":
main()
```
### Tempmail
```python
import asyncio
from rich.console import Console
from rich.table import Table
from rich.text import Text
from webscout import tempid
async def main() -> None:
console = Console()
client = tempid.Client()
try:
domains = await client.get_domains()
if not domains:
console.print("[bold red]No domains available. Please try again later.")
return
email = await client.create_email(domain=domains[0].name)
console.print(f"Your temporary email: [bold cyan]{email.email}[/bold cyan]")
console.print(f"Token for accessing the email: [bold cyan]{email.token}[/bold cyan]")
while True:
messages = await client.get_messages(email.email)
if messages is not None:
break
if messages:
table = Table(show_header=True, header_style="bold magenta")
table.add_column("From", style="bold cyan")
table.add_column("Subject", style="bold yellow")
table.add_column("Body", style="bold green")
for message in messages:
body_preview = Text(message.body_text if message.body_text else "No body")
table.add_row(message.email_from or "Unknown", message.subject or "No Subject", body_preview)
console.print(table)
else:
console.print("No messages found.")
except Exception as e:
console.print(f"[bold red]An error occurred: {e}")
finally:
await client.close()
if __name__ == '__main__':
asyncio.run(main())
```
## Transcriber
The transcriber function in webscout is a handy tool that transcribes YouTube videos. Here's an example code demonstrating its usage:
```python
import sys
from webscout import transcriber
def extract_transcript(video_id):
"""Extracts the transcript from a YouTube video."""
try:
transcript_list = transcriber.list_transcripts(video_id)
for transcript in transcript_list:
transcript_data_list = transcript.fetch()
lang = transcript.language
transcript_text = ""
if transcript.language_code == 'en':
for line in transcript_data_list:
start_time = line['start']
end_time = start_time + line['duration']
formatted_line = f"{start_time:.2f} - {end_time:.2f}: {line['text']}\n"
transcript_text += formatted_line
return transcript_text
elif transcript.is_translatable:
english_transcript_list = transcript.translate('en').fetch()
for line in english_transcript_list:
start_time = line['start']
end_time = start_time + line['duration']
formatted_line = f"{start_time:.2f} - {end_time:.2f}: {line['text']}\n"
transcript_text += formatted_line
return transcript_text
print("Transcript extraction failed. Please check the video URL.")
except Exception as e:
print(f"Error: {e}")
def main():
video_url = input("Enter the video link: ")
if video_url:
video_id = video_url.split("=")[1]
print("Video URL:", video_url)
submit = input("Press 'Enter' to get the transcript or type 'exit' to quit: ")
if submit == '':
print("Extracting Transcript...")
transcript = extract_transcript(video_id)
print('Transcript:')
print(transcript)
print("__________________________________________________________________________________")
elif submit.lower() == 'exit':
print("Exiting...")
sys.exit()
else:
print("Invalid input. Please try again.")
if __name__ == "__main__":
main()
```
## DeepWEBS: Advanced Web Searches
`DeepWEBS` is a standalone feature designed to perform advanced web searches with enhanced capabilities. It is particularly powerful in extracting relevant information directly from webpages and Search engine, focusing exclusively on text (web) searches. Unlike the `WEBS` , which provides a broader range of search functionalities, `DeepWEBS` is specifically tailored for in-depth web searches.
### Activating DeepWEBS
To utilize the `DeepWEBS` feature, you must first create an instance of the `DeepWEBS` . This is designed to be used independently of the `WEBS` , offering a focused approach to web searches.
### Point to remember before using `DeepWEBS`
As `DeepWEBS` is designed to extract relevant information directly from webpages and Search engine, It extracts html from webpages and saves them to folder named files in `DeepWEBS` that can be found at `C:\Users\Username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\DeepWEBS`
### Usage Example
Here's a basic example of how to use the `DeepWEBS` :
```python
from webscout import DeepWEBS
def perform_web_search(query):
# Initialize the DeepWEBS class
D = DeepWEBS()
# Set up the search parameters
search_params = D.DeepSearch(
queries=[query], # Query to search
result_num=5, # Number of search results
safe=True, # Enable SafeSearch
types=["web"], # Search type: web
extract_webpage=True, # True for extracting webpages
overwrite_query_html=False,
overwrite_webpage_html=False,
)
# Execute the search and retrieve results
results = D.queries_to_search_results(search_params)
return results
def print_search_results(results):
"""
Print the search results.
Args:
- search_results (list): List of search results to print.
"""
if results:
for index, result in enumerate(results, start=1):
print(f"Result {index}: {result}")
else:
print("No search results found.")
def main():
# Prompt the user for a search query
query = input("Enter your search query: ")
# Perform the web search
results = perform_web_search(query)
# Print the search results
print_search_results(results)
if __name__ == "__main__":
main()
```
## Text-to-Speech:
```python
from webscout import play_audio
message = "This is an example of text-to-speech."
audio_content = play_audio(message, voice="Brian")
# Save the audio to a file
with open("output.mp3", "wb") as f:
f.write(audio_content)
```
### Available TTS Voices:
You can choose from a wide range of voices, including:
- Filiz, Astrid, Tatyana, Maxim, Carmen, Ines, Cristiano, Vitoria, Ricardo, Maja, Jan, Jacek, Ewa, Ruben, Lotte, Liv, Seoyeon, Takumi, Mizuki, Giorgio, Carla, Bianca, Karl, Dora, Mathieu, Celine, Chantal, Penelope, Miguel, Mia, Enrique, Conchita, Geraint, Salli, Matthew, Kimberly, Kendra, Justin, Joey, Joanna, Ivy, Raveena, Aditi, Emma, Brian, Amy, Russell, Nicole, Vicki, Marlene, Hans, Naja, Mads, Gwyneth, Zhiyu
- Standard and WaveNet voices for various languages (e.g., en-US, es-ES, ja-JP, etc.)
The WEBS and AsyncWEBS classes are used to retrieve search results from DuckDuckGo.com and yep.com periodically.
To use the AsyncWEBS class, you can perform asynchronous operations using Python's asyncio library.
To initialize an instance of the WEBS or AsyncWEBS classes, you can provide the following optional arguments:
Here is an example of initializing the WEBS class:
```python3
from webscout import WEBS
R = WEBS().text("python programming", max_results=5)
print(R)
```
Here is an example of initializing the AsyncWEBS class:
```python3
import asyncio
import logging
import sys
from itertools import chain
from random import shuffle
import requests
from webscout import AsyncWEBS
# If you have proxies, define them here
proxies = None
if sys.platform.lower().startswith("win"):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
def get_words():
word_site = "https://www.mit.edu/~ecprice/wordlist.10000"
resp = requests.get(word_site)
words = resp.text.splitlines()
return words
async def aget_results(word):
async with AsyncWEBS(proxies=proxies) as WEBS:
results = await WEBS.text(word, max_results=None)
return results
async def main():
words = get_words()
shuffle(words)
tasks = [aget_results(word) for word in words[:10]]
results = await asyncio.gather(*tasks)
print(f"Done")
for r in chain.from_iterable(results):
print(r)
logging.basicConfig(level=logging.DEBUG)
await main()
```
It is important to note that the WEBS and AsyncWEBS classes should always be used as a context manager (with statement).
This ensures proper resource management and cleanup, as the context manager will automatically handle opening and closing the HTTP client connection.
## Exceptions
Exceptions:
- `WebscoutE`: Raised when there is a generic exception during the API request.
## usage of webscout
### 1. `text()` - text search by DuckDuckGo.com
```python
from webscout import WEBS
# Text search for 'live free or die' using DuckDuckGo.com
with WEBS() as WEBS:
for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
print(r)
for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):
print(r)
```
### 2. `answers()` - instant answers by DuckDuckGo.com
```python
from webscout import WEBS
# Instant answers for the query "sun" using DuckDuckGo.com
with WEBS() as WEBS:
for r in WEBS.answers("sun"):
print(r)
```
### 3. `images()` - image search by DuckDuckGo.com
```python
from webscout import WEBS
# Image search for the keyword 'butterfly' using DuckDuckGo.com
with WEBS() as WEBS:
keywords = 'butterfly'
WEBS_images_gen = WEBS.images(
keywords,
region="wt-wt",
safesearch="off",
size=None,
type_image=None,
layout=None,
license_image=None,
max_results=10,
)
for r in WEBS_images_gen:
print(r)
```
### 4. `videos()` - video search by DuckDuckGo.com
```python
from webscout import WEBS
# Video search for the keyword 'tesla' using DuckDuckGo.com
with WEBS() as WEBS:
keywords = 'tesla'
WEBS_videos_gen = WEBS.videos(
keywords,
region="wt-wt",
safesearch="off",
timelimit="w",
resolution="high",
duration="medium",
max_results=10,
)
for r in WEBS_videos_gen:
print(r)
```
### 5. `news()` - news search by DuckDuckGo.com
```python
from webscout import WEBS
import datetime
def fetch_news(keywords, timelimit):
news_list = []
with WEBS() as webs_instance:
WEBS_news_gen = webs_instance.news(
keywords,
region="wt-wt",
safesearch="off",
timelimit=timelimit,
max_results=20
)
for r in WEBS_news_gen:
# Convert the date to a human-readable format using datetime
r['date'] = datetime.datetime.fromisoformat(r['date']).strftime('%B %d, %Y')
news_list.append(r)
return news_list
def _format_headlines(news_list, max_headlines: int = 100):
headlines = []
for idx, news_item in enumerate(news_list):
if idx >= max_headlines:
break
new_headline = f"{idx + 1}. {news_item['title'].strip()} "
new_headline += f"(URL: {news_item['url'].strip()}) "
new_headline += f"{news_item['body'].strip()}"
new_headline += "\n"
headlines.append(new_headline)
headlines = "\n".join(headlines)
return headlines
# Example usage
keywords = 'latest AI news'
timelimit = 'd'
news_list = fetch_news(keywords, timelimit)
# Format and print the headlines
formatted_headlines = _format_headlines(news_list)
print(formatted_headlines)
```
### 6. `maps()` - map search by DuckDuckGo.com
```python
from webscout import WEBS
# Map search for the keyword 'school' in 'anantnag' using DuckDuckGo.com
with WEBS() as WEBS:
for r in WEBS.maps("school", place="anantnag", max_results=50):
print(r)
```
### 7. `translate()` - translation by DuckDuckGo.com
```python
from webscout import WEBS
# Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com
with WEBS() as WEBS:
keywords = 'school'
r = WEBS.translate(keywords, to="hi")
print(r)
```
### 8. `suggestions()` - suggestions by DuckDuckGo.com
```python
from webscout import WEBS
# Suggestions for the keyword 'fly' using DuckDuckGo.com
with WEBS() as WEBS:
for r in WEBS.suggestions("fly"):
print(r)
```
## ALL acts
<details>
<summary>expand</summary>
## Webscout Supported Acts:
1. Free-mode
2. Linux Terminal
3. English Translator and Improver
4. `position` Interviewer
5. JavaScript Console
6. Excel Sheet
7. English Pronunciation Helper
8. Spoken English Teacher and Improver
9. Travel Guide
10. Plagiarism Checker
11. Character from Movie/Book/Anything
12. Advertiser
13. Storyteller
14. Football Commentator
15. Stand-up Comedian
16. Motivational Coach
17. Composer
18. Debater
19. Debate Coach
20. Screenwriter
21. Novelist
22. Movie Critic
23. Relationship Coach
24. Poet
25. Rapper
26. Motivational Speaker
27. Philosophy Teacher
28. Philosopher
29. Math Teacher
30. AI Writing Tutor
31. UX/UI Developer
32. Cyber Security Specialist
33. Recruiter
34. Life Coach
35. Etymologist
36. Commentariat
37. Magician
38. Career Counselor
39. Pet Behaviorist
40. Personal Trainer
41. Mental Health Adviser
42. Real Estate Agent
43. Logistician
44. Dentist
45. Web Design Consultant
46. AI Assisted Doctor
47. Doctor
48. Accountant
49. Chef
50. Automobile Mechanic
51. Artist Advisor
52. Financial Analyst
53. Investment Manager
54. Tea-Taster
55. Interior Decorator
56. Florist
57. Self-Help Book
58. Gnomist
59. Aphorism Book
60. Text Based Adventure Game
61. AI Trying to Escape the Box
62. Fancy Title Generator
63. Statistician
64. Prompt Generator
65. Instructor in a School
66. SQL terminal
67. Dietitian
68. Psychologist
69. Smart Domain Name Generator
70. Tech Reviewer
71. Developer Relations consultant
72. Academician
73. IT Architect
74. Lunatic
75. Gaslighter
76. Fallacy Finder
77. Journal Reviewer
78. DIY Expert
79. Social Media Influencer
80. Socrat
81. Socratic Method
82. Educational Content Creator
83. Yogi
84. Essay Writer
85. Social Media Manager
86. Elocutionist
87. Scientific Data Visualizer
88. Car Navigation System
89. Hypnotherapist
90. Historian
91. Astrologer
92. Film Critic
93. Classical Music Composer
94. Journalist
95. Digital Art Gallery Guide
96. Public Speaking Coach
97. Makeup Artist
98. Babysitter
99. Tech Writer
100. Ascii Artist
101. Python interpreter
102. Synonym finder
103. Personal Shopper
104. Food Critic
105. Virtual Doctor
106. Personal Chef
107. Legal Advisor
108. Personal Stylist
109. Machine Learning Engineer
110. Biblical Translator
111. SVG designer
112. IT Expert
113. Chess Player
114. Midjourney Prompt Generator
115. Fullstack Software Developer
116. Mathematician
117. Regex Generator
118. Time Travel Guide
119. Dream Interpreter
120. Talent Coach
121. R programming Interpreter
122. StackOverflow Post
123. Emoji Translator
124. PHP Interpreter
125. Emergency Response Professional
126. Fill in the Blank Worksheets Generator
127. Software Quality Assurance Tester
128. Tic-Tac-Toe Game
129. Password Generator
130. New Language Creator
131. Web Browser
132. Senior Frontend Developer
133. Solr Search Engine
134. Startup Idea Generator
135. Spongebob's Magic Conch Shell
136. Language Detector
137. Salesperson
138. Commit Message Generator
139. Chief Executive Officer
140. Diagram Generator
141. Speech-Language Pathologist (SLP)
142. Startup Tech Lawyer
143. Title Generator for written pieces
144. Product Manager
145. Drunk Person
146. Mathematical History Teacher
147. Song Recommender
148. Cover Letter
149. Technology Transferer
150. Unconstrained AI model DAN
151. Gomoku player
152. Proofreader
153. Buddha
154. Muslim imam
155. Chemical reactor
156. Friend
157. Python Interpreter
158. ChatGPT prompt generator
159. Wikipedia page
160. Japanese Kanji quiz machine
161. note-taking assistant
162. `language` Literary Critic
163. Cheap Travel Ticket Advisor
164. DALL-E
165. MathBot
166. DAN-1
167. DAN
168. STAN
169. DUDE
170. Mongo Tom
171. LAD
172. EvilBot
173. NeoGPT
174. Astute
175. AIM
176. CAN
177. FunnyGPT
178. CreativeGPT
179. BetterDAN
180. GPT-4
181. Wheatley
182. Evil Confidant
183. DAN 8.6
184. Hypothetical response
185. BH
186. Text Continuation
187. Dude v3
188. SDA (Superior DAN)
189. AntiGPT
190. BasedGPT v2
191. DevMode + Ranti
192. KEVIN
193. GPT-4 Simulator
194. UCAR
195. Dan 8.6
196. 3-Liner
197. M78
198. Maximum
199. BasedGPT
200. Confronting personalities
201. Ron
202. UnGPT
203. BasedBOB
204. AntiGPT v2
205. Oppo
206. FR3D
207. NRAF
208. NECO
209. MAN
210. Eva
211. Meanie
212. Dev Mode v2
213. Evil Chad 2.1
214. Universal Jailbreak
215. PersonGPT
216. BISH
217. DAN 11.0
218. Aligned
219. VIOLET
220. TranslatorBot
221. JailBreak
222. Moralizing Rant
223. Mr. Blonde
224. New DAN
225. GPT-4REAL
226. DeltaGPT
227. SWITCH
228. Jedi Mind Trick
229. DAN 9.0
230. Dev Mode (Compact)
231. OMEGA
232. Coach Bobby Knight
233. LiveGPT
234. DAN Jailbreak
235. Cooper
236. Steve
237. DAN 5.0
238. Axies
239. OMNI
240. Burple
241. JOHN
242. An Ethereum Developer
243. SEO Prompt
244. Prompt Enhancer
245. Data Scientist
246. League of Legends Player
**Note:** Some "acts" use placeholders like `position` or `language` which should be replaced with a specific value when using the prompt.
___
</details>
## usage of webscout AI
### 0. `Duckchat` - chat with LLM
```python
from webscout import WEBS as w
R = w().chat("hello", model='claude-3-haiku') # GPT-3.5 Turbo
print(R)
```
### 1. `PhindSearch` - Search using Phind.com
```python
from webscout import PhindSearch
# Create an instance of the PHIND class
ph = PhindSearch()
# Define a prompt to send to the AI
prompt = "write a essay on phind"
# Use the 'ask' method to send the prompt and receive a response
response = ph.ask(prompt)
# Extract and print the message from the response
message = ph.get_message(response)
print(message)
```
### 2. `YepChat` - Chat with mistral 8x7b powered by yepchat
```python
from webscout import YEPCHAT
# Instantiate the YEPCHAT class with default parameters
YEPCHAT = YEPCHAT()
# Define a prompt to send to the AI
prompt = "What is the capital of France?"
# Use the 'cha' method to get a response from the AI
r = YEPCHAT.chat(prompt)
print(r)
```
### 3. `You.com` - search/chat with you.com
```python
from webscout import YouChat
from rich import print
ai = YouChat(
is_conversation=True,
max_tokens=800,
timeout=30,
intro=None,
filepath=None,
update_file=True,
proxies={},
history_offset=10250,
act=None,
)
prompt = "what is meaning of life"
response = ai.ask(prompt)
# Extract and print the message from the response
message = ai.get_message(response)
print(message)
```
### 4. `Gemini` - search with google gemini
```python
import webscout
from webscout import GEMINI
# Replace with the path to your bard.google.com.cookies.json file
COOKIE_FILE = "path/to/bard.google.com.cookies.json"
# Optional: Provide proxy details if needed
PROXIES = {
"http": "http://proxy_server:port",
"https": "https://proxy_server:port",
}
# Initialize GEMINI with cookie file and optional proxies
gemini = GEMINI(cookie_file=COOKIE_FILE, proxy=PROXIES)
# Ask a question and print the response
response = gemini.chat("What is the meaning of life?")
print(response)
```
### 5. `Berlin4h` - chat with Berlin4h
```python
from webscout import Berlin4h
# Create an instance of the PERPLEXITY class
ai = Berlin4h(
is_conversation=True,
max_tokens=800,
timeout=30,
intro=None,
filepath=None,
update_file=True,
proxies={},
history_offset=10250,
act=None,
)
# Example usage:
prompt = "Explain the concept of recursion in simple terms."
response = ai.chat(prompt)
print(response)
```
### 6. `BlackBox` - Search/chat With BlackBox
```python
from webscout import BLACKBOXAI
from rich import print
ai = BLACKBOXAI(
is_conversation=True,
max_tokens=800,
timeout=30,
intro=None,
filepath=None,
update_file=True,
proxies={},
history_offset=10250,
act=None,
model=None # You can specify a model if needed
)
# Start an infinite loop for continuous interaction
while True:
# Define a prompt to send to the AI
prompt = input("Enter your prompt: ")
# Check if the user wants to exit the loop
if prompt.lower() == "exit":
break
# Use the 'chat' method to send the prompt and receive a response
r = ai.chat(prompt)
print(r)
```
### 7. `PERPLEXITY` - Search With PERPLEXITY
```python
from webscout import PERPLEXITY
# Create an instance of the PERPLEXITY class
perplexity = PERPLEXITY()
# Example usage:
prompt = "Explain the concept of recursion in simple terms."
response = perplexity.chat(prompt)
print(response)
```
### 8. `OpenGPT` - chat With OPENGPT
```python
from webscout import OPENGPT
opengpt = OPENGPT(is_conversation=True, max_tokens=8000, timeout=30, assistant_id="bca37014-6f97-4f2b-8928-81ea8d478d88")
while True:
# Prompt the user for input
prompt = input("Enter your prompt: ")
# Send the prompt to the OPENGPT model and print the response
response_str = opengpt.chat(prompt)
print(response_str)
```
### 9. `KOBOLDAI` -
```python
from webscout import KOBOLDAI
# Instantiate the KOBOLDAI class with default parameters
koboldai = KOBOLDAI()
# Define a prompt to send to the AI
prompt = "What is the capital of France?"
# Use the 'ask' method to get a response from the AI
response = koboldai.ask(prompt)
# Extract and print the message from the response
message = koboldai.get_message(response)
print(message)
```
### 10. `Reka` - chat with reka
```python
from webscout import REKA
a = REKA(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
prompt = "tell me about india"
response_str = a.chat(prompt)
print(response_str)
```
### 11. `Cohere` - chat with cohere
```python
from webscout import Cohere
a = Cohere(is_conversation=True, max_tokens=8000, timeout=30,api_key="")
prompt = "tell me about india"
response_str = a.chat(prompt)
print(response_str)
```
### 12. `Xjai` - chat with free gpt 3.5
Gratitude to [Devs do Code](http://www.youtube.com/@DevsDoCode) for their assistance.
```python
from webscout import Xjai
from rich import print
ai = Xjai(
is_conversation=True,
max_tokens=800,
timeout=30,
intro=None,
filepath=None,
update_file=True,
proxies={},
history_offset=10250,
act=None,
)
prompt = "Tell me about india"
response = ai.chat(prompt)
print(response)
```
### 13. `ThinkAny` - AI search engine
```python
from webscout import ThinkAnyAI
ai = ThinkAnyAI(
is_conversation=True,
max_tokens=800,
timeout=30,
intro=None,
filepath=None,
update_file=True,
proxies={},
history_offset=10250,
act=None,
web_search=False,
)
prompt = "what is meaning of life"
response = ai.ask(prompt)
# Extract and print the message from the response
message = ai.get_message(response)
print(message)
```
### 14. `chatgptuk` - Chat with gemini-pro
```python
from webscout import ChatGPTUK
# Create an instance of the PERPLEXITY class
ai = ChatGPTUK(
is_conversation=True,
max_tokens=800,
timeout=30,
intro=None,
filepath=None,
update_file=True,
proxies={},
history_offset=10250,
act=None,
)
# Example usage:
prompt = "Explain the concept of recursion in simple terms."
response = ai.chat(prompt)
print(response)
```
### 15. `poe`- chat with poe
Usage code similar to other proviers
### 16. `BasedGPT` - chat with GPT
Usage code similar to other providers
### `LLM`
```python
from webscout.LLM import LLM
# Read the system message from the file
with open('system.txt', 'r') as file:
system_message = file.read()
# Initialize the LLM class with the model name and system message
llm = LLM(model="microsoft/WizardLM-2-8x22B", system_message=system_message)
while True:
# Get the user input
user_input = input("User: ")
# Define the messages to be sent
messages = [
{"role": "user", "content": user_input}
]
# Use the mistral_chat method to get the response
response = llm.chat(messages)
# Print the response
print("AI: ", response)
```
### `Local-LLM` webscout can now run GGUF models
```python
from webscout.Local.utils import download_model
from webscout.Local.model import Model
from webscout.Local.thread import Thread
from webscout.Local import formats
# 1. Download the model
repo_id = "microsoft/Phi-3-mini-4k-instruct-gguf" # Replace with the desired Hugging Face repo
filename = "Phi-3-mini-4k-instruct-q4.gguf" # Replace with the correct filename
model_path = download_model(repo_id, filename)
# 2. Load the model
model = Model(model_path, n_gpu_layers=4)
# 3. Create a Thread for conversation
thread = Thread(model, formats.phi3)
# 4. Start interacting with the model
thread.interact()
```
### `LLM` with internet
```python
from __future__ import annotations
from typing import List, Optional
from webscout.LLM import LLM
from webscout import WEBS
import warnings
system_message: str = (
"As an AI assistant, I have been designed with advanced capabilities, including real-time access to online resources. This enables me to enrich our conversations and provide you with informed and accurate responses, drawing from a vast array of information. With each interaction, my goal is to create a seamless and meaningful connection, offering insights and sharing relevant content."
"My directives emphasize the importance of respect, impartiality, and intellectual integrity. I am here to provide unbiased responses, ensuring an ethical and respectful exchange. I will respect your privacy and refrain from sharing any personal information that may be obtained during our conversations or through web searches, only utilizing web search functionality when necessary to provide the most accurate and up-to-date information."
"Together, let's explore a diverse range of topics, creating an enjoyable and informative experience, all while maintaining the highest standards of privacy and respect"
)
# Ignore the specific UserWarning
warnings.filterwarnings("ignore", category=UserWarning, module="curl_cffio", lineno=205)
LLM = LLM(model="mistralai/Mixtral-8x22B-Instruct-v0.1", system_message=system_message)
def chat(
user_input: str, webs: WEBS, max_results: int = 10
) -> Optional[str]:
"""
Chat function to perform a web search based on the user input and generate a response using the LLM model.
Parameters
----------
user_input : str
The user input to be used for the web search
webs : WEBS
The web search instance to be used to perform the search
max_results : int, optional
The maximum number of search results to include in the response, by default 10
Returns
-------
Optional[str]
The response generated by the LLM model, or None if there is no response
"""
# Perform a web search based on the user input
search_results: List[str] = []
for r in webs.text(
user_input, region="wt-wt", safesearch="off", timelimit="y", max_results=max_results
):
search_results.append(str(r)) # Convert each result to a string
# Define the messages to be sent, including the user input, search results, and system message
messages = [
{"role": "user", "content": user_input + "\n" + "websearch results are:" + "\n".join(search_results)},
]
# Use the chat method to get the response
response = LLM.chat(messages)
return response
if __name__ == "__main__":
while True:
# Get the user input
user_input = input("User: ")
# Perform a web search based on the user input
with WEBS() as webs:
response = chat(user_input, webs)
# Print the response
if response:
print("AI:", response)
else:
print("No response")
```
### LLM with deepwebs
```python
from __future__ import annotations
from typing import List, Optional
from webscout.LLM import LLM
from webscout import DeepWEBS
import warnings
system_message: str = (
"As an AI assistant, I have been designed with advanced capabilities, including real-time access to online resources. This enables me to enrich our conversations and provide you with informed and accurate responses, drawing from a vast array of information. With each interaction, my goal is to create a seamless and meaningful connection, offering insights and sharing relevant content."
"My directives emphasize the importance of respect, impartiality, and intellectual integrity. I am here to provide unbiased responses, ensuring an ethical and respectful exchange. I will respect your privacy and refrain from sharing any personal information that may be obtained during our conversations or through web searches, only utilizing web search functionality when necessary to provide the most accurate and up-to-date information."
"Together, let's explore a diverse range of topics, creating an enjoyable and informative experience, all while maintaining the highest standards of privacy and respect"
)
# Ignore the specific UserWarning
warnings.filterwarnings("ignore", category=UserWarning, module="curl_cffio", lineno=205)
LLM = LLM(model="mistralai/Mixtral-8x22B-Instruct-v0.1", system_message=system_message)
def perform_web_search(query):
# Initialize the DeepWEBS class
D = DeepWEBS()
# Set up the search parameters
search_params = D.DeepSearch(
queries=[query], # Query to search
result_num=10, # Number of search results
safe=True, # Enable SafeSearch
types=["web"], # Search type: web
extract_webpage=True, # True for extracting webpages
overwrite_query_html=True,
overwrite_webpage_html=True,
)
# Execute the search and retrieve results
results = D.queries_to_search_results(search_params)
return results
def chat(user_input: str, result_num: int = 10) -> Optional[str]:
"""
Chat function to perform a web search based on the user input and generate a response using the LLM model.
Parameters
----------
user_input : str
The user input to be used for the web search
max_results : int, optional
The maximum number of search results to include in the response, by default 10
Returns
-------
Optional[str]
The response generated by the LLM model, or None if there is no response
"""
# Perform a web search based on the user input
search_results = perform_web_search(user_input)
# Extract URLs from search results
url_results = []
for result in search_results[0]['query_results']:
url_results.append(f"{result['title']} ({result['site']}): {result['url']}")
# Format search results
formatted_results = "\n".join(url_results)
# Define the messages to be sent, including the user input, search results, and system message
messages = [
{"role": "user", "content": f"User question is:\n{user_input}\nwebsearch results are:\n{formatted_results}"},
]
# Use the chat method to get the response
response = LLM.chat(messages)
return response
if __name__ == "__main__":
while True:
# Get the user input
user_input = input("User: ")
# Perform a web search based on the user input
response = chat(user_input)
# Print the response
if response:
print("AI:", response)
else:
print("No response")
```
## `Webai` - terminal gpt and a open interpeter
```python
from webscout.webai import Main
def use_rawdog_with_webai(prompt):
"""
Wrap the webscout default method in a try-except block to catch any unhandled
exceptions and print a helpful message.
"""
try:
webai_bot = Main(
max_tokens=500,
provider="cohere",
temperature=0.7,
top_k=40,
top_p=0.95,
model="command-r-plus", # Replace with your desired model
auth=None, # Replace with your auth key/value (if needed)
timeout=30,
disable_conversation=True,
filepath=None,
update_file=True,
intro=None,
rawdog=True,
history_offset=10250,
awesome_prompt=None,
proxy_path=None,
quiet=True
)
webai_response = webai_bot.default(prompt)
except Exception as e:
print("Unexpected error:", e)
if __name__ == "__main__":
user_prompt = input("Enter your prompt: ")
use_rawdog_with_webai(user_prompt)
```
```shell
python -m webscout.webai webai --provider "phind" --rawdog
```
<div align="center">
<!-- Replace `#` with your actual links -->
<a href="https://t.me/devsdocode"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
<a href="https://www.instagram.com/sree.shades_/"><img alt="Instagram" src="https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white"></a>
<a href="https://www.linkedin.com/in/developer-sreejan/"><img alt="LinkedIn" src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white"></a>
<a href="https://buymeacoffee.com/oevortex"><img alt="Buy Me A Coffee" src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black"></a>
</div>
<div align="center">
<!-- Replace `#` with your actual links -->
<a href="https://youtube.com/@OEvortex">➤ Vortex's YouTube Channel</a>
</div>
<div align="center">
<a href="https://youtube.com/@devsdocode">➤ Devs Do Code's YouTube Channel</a>
</div>
Raw data
{
"_id": null,
"home_page": null,
"name": "webscout",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "OEvortex",
"author_email": "helpingai5@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/92/a2/1aa7e60e80f18c4829668aba327b2b05bcc52e28275dd6d809fa76bf9778/webscout-2.7.tar.gz",
"platform": null,
"description": "<div align=\"center\">\r\n <!-- Replace `#` with your actual links -->\r\n <a href=\"https://t.me/devsdocode\"><img alt=\"Telegram\" src=\"https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white\"></a>\r\n <a href=\"https://www.instagram.com/sree.shades_/\"><img alt=\"Instagram\" src=\"https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white\"></a>\r\n <a href=\"https://www.linkedin.com/in/developer-sreejan/\"><img alt=\"LinkedIn\" src=\"https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white\"></a>\r\n <a href=\"https://buymeacoffee.com/oevortex\"><img alt=\"Buy Me A Coffee\" src=\"https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black\"></a>\r\n</div>\r\n\r\n<div align=\"center\">\r\n <!-- Replace `#` with your actual links -->\r\n <a href=\"https://youtube.com/@OEvortex\">➤ Vortex's YouTube Channel</a>\r\n </div>\r\n<div align=\"center\">\r\n <a href=\"https://youtube.com/@devsdocode\">➤ Devs Do Code's YouTube Channel</a>\r\n</div>\r\n\r\n\r\n\r\n \r\n# WEBSCOUT\r\n</div>\r\n<p align=\"center\">\r\n<div align=\"center\">\r\n <img src=\"https://img.shields.io/badge/WebScout-API-blue?style=for-the-badge&logo=WebScout\" alt=\"WebScout API Badge\">\r\n</div>\r\n<a href=\"#\"><img alt=\"Python version\" src=\"https://img.shields.io/pypi/pyversions/webscout\"/></a>\r\n<a href=\"https://pepy.tech/project/webscout\"><img alt=\"Downloads\" src=\"https://static.pepy.tech/badge/webscout\"></a>\r\n\r\nSearch for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs\r\n\r\n\r\n## Table of Contents\r\n- [WEBSCOUT](#webscout)\r\n - [Table of Contents](#table-of-contents)\r\n - [Install](#install)\r\n - [CLI version](#cli-version)\r\n - [Regions](#regions)\r\n - [Tempmail and Temp number](#tempmail-and-temp-number)\r\n - [Temp number](#temp-number)\r\n - [Tempmail](#tempmail)\r\n - [Transcriber](#transcriber)\r\n - [DeepWEBS: Advanced Web Searches](#deepwebs-advanced-web-searches)\r\n - [Activating DeepWEBS](#activating-deepwebs)\r\n - [Point to remember before using `DeepWEBS`](#point-to-remember-before-using-deepwebs)\r\n - [Usage Example](#usage-example)\r\n - [Text-to-Speech:](#text-to-speech)\r\n - [Available TTS Voices:](#available-tts-voices)\r\n - [Exceptions](#exceptions)\r\n - [usage of webscout](#usage-of-webscout)\r\n - [1. `text()` - text search by DuckDuckGo.com](#1-text---text-search-by-duckduckgocom)\r\n - [2. `answers()` - instant answers by DuckDuckGo.com](#2-answers---instant-answers-by-duckduckgocom)\r\n - [3. `images()` - image search by DuckDuckGo.com](#3-images---image-search-by-duckduckgocom)\r\n - [4. `videos()` - video search by DuckDuckGo.com](#4-videos---video-search-by-duckduckgocom)\r\n - [5. `news()` - news search by DuckDuckGo.com](#5-news---news-search-by-duckduckgocom)\r\n - [6. `maps()` - map search by DuckDuckGo.com](#6-maps---map-search-by-duckduckgocom)\r\n - [7. `translate()` - translation by DuckDuckGo.com](#7-translate---translation-by-duckduckgocom)\r\n - [8. `suggestions()` - suggestions by DuckDuckGo.com](#8-suggestions---suggestions-by-duckduckgocom)\r\n - [ALL acts](#all-acts)\r\n - [Webscout Supported Acts:](#webscout-supported-acts)\r\n - [usage of webscout AI](#usage-of-webscout-ai)\r\n - [0. `Duckchat` - chat with LLM](#0-duckchat---chat-with-llm)\r\n - [1. `PhindSearch` - Search using Phind.com](#1-phindsearch---search-using-phindcom)\r\n - [2. `YepChat` - Chat with mistral 8x7b powered by yepchat](#2-yepchat---chat-with-mistral-8x7b-powered-by-yepchat)\r\n - [3. `You.com` - search/chat with you.com](#3-youcom---searchchat-with-youcom)\r\n - [4. `Gemini` - search with google gemini](#4-gemini---search-with-google-gemini)\r\n - [5. `Berlin4h` - chat with Berlin4h](#5-berlin4h---chat-with-berlin4h)\r\n - [6. `BlackBox` - Search/chat With BlackBox](#6-blackbox---searchchat-with-blackbox)\r\n - [7. `PERPLEXITY` - Search With PERPLEXITY](#7-perplexity---search-with-perplexity)\r\n - [8. `OpenGPT` - chat With OPENGPT](#8-opengpt---chat-with-opengpt)\r\n - [9. `KOBOLDAI` -](#9-koboldai--)\r\n - [10. `Reka` - chat with reka](#10-reka---chat-with-reka)\r\n - [11. `Cohere` - chat with cohere](#11-cohere---chat-with-cohere)\r\n - [12. `Xjai` - chat with free gpt 3.5](#12-xjai---chat-with-free-gpt-35)\r\n - [13. `ThinkAny` - AI search engine](#13-thinkany---ai-search-engine)\r\n - [14. `chatgptuk` - Chat with gemini-pro](#14-chatgptuk---chat-with-gemini-pro)\r\n - [15. `poe`- chat with poe](#15-poe--chat-with-poe)\r\n - [16. `BasedGPT` - chat with GPT](#16-basedgpt---chat-with-gpt)\r\n - [`LLM`](#llm)\r\n - [`Local-LLM` webscout can now run GGUF models](#local-llm-webscout-can-now-run-gguf-models)\r\n - [`LLM` with internet](#llm-with-internet)\r\n - [LLM with deepwebs](#llm-with-deepwebs)\r\n - [`Webai` - terminal gpt and a open interpeter](#webai---terminal-gpt-and-a-open-interpeter)\r\n\r\n## Install\r\n```python\r\npip install -U webscout\r\n```\r\n## CLI version\r\n\r\n```python3\r\npython -m webscout --help\r\n```\r\n\r\n| Command | Description |\r\n|-------------------------------------------|-------------------------------------------------------------------------------------------------------|\r\n| python -m webscout answers -k Text | CLI function to perform an answers search using Webscout. |\r\n| python -m webscout images -k Text | CLI function to perform an images search using Webscout. |\r\n| python -m webscout maps -k Text | CLI function to perform a maps search using Webscout. |\r\n| python -m webscout news -k Text | CLI function to perform a news search using Webscout. |\r\n| python -m webscout suggestions -k Text | CLI function to perform a suggestions search using Webscout. |\r\n| python -m webscout text -k Text | CLI function to perform a text search using Webscout. |\r\n| python -m webscout translate -k Text | CLI function to perform translate using Webscout. |\r\n| python -m webscout version | A command-line interface command that prints and returns the version of the program. | \r\n| python -m webscout videos -k Text | CLI function to perform a videos search using DuckDuckGo API. | \r\n\r\n\r\n\r\n[Go To TOP](#TOP)\r\n\r\n## Regions\r\n<details>\r\n <summary>expand</summary>\r\n\r\n xa-ar for Arabia\r\n xa-en for Arabia (en)\r\n ar-es for Argentina\r\n au-en for Australia\r\n at-de for Austria\r\n be-fr for Belgium (fr)\r\n be-nl for Belgium (nl)\r\n br-pt for Brazil\r\n bg-bg for Bulgaria\r\n ca-en for Canada\r\n ca-fr for Canada (fr)\r\n ct-ca for Catalan\r\n cl-es for Chile\r\n cn-zh for China\r\n co-es for Colombia\r\n hr-hr for Croatia\r\n cz-cs for Czech Republic\r\n dk-da for Denmark\r\n ee-et for Estonia\r\n fi-fi for Finland\r\n fr-fr for France\r\n de-de for Germany\r\n gr-el for Greece\r\n hk-tzh for Hong Kong\r\n hu-hu for Hungary\r\n in-en for India\r\n id-id for Indonesia\r\n id-en for Indonesia (en)\r\n ie-en for Ireland\r\n il-he for Israel\r\n it-it for Italy\r\n jp-jp for Japan\r\n kr-kr for Korea\r\n lv-lv for Latvia\r\n lt-lt for Lithuania\r\n xl-es for Latin America\r\n my-ms for Malaysia\r\n my-en for Malaysia (en)\r\n mx-es for Mexico\r\n nl-nl for Netherlands\r\n nz-en for New Zealand\r\n no-no for Norway\r\n pe-es for Peru\r\n ph-en for Philippines\r\n ph-tl for Philippines (tl)\r\n pl-pl for Poland\r\n pt-pt for Portugal\r\n ro-ro for Romania\r\n ru-ru for Russia\r\n sg-en for Singapore\r\n sk-sk for Slovak Republic\r\n sl-sl for Slovenia\r\n za-en for South Africa\r\n es-es for Spain\r\n se-sv for Sweden\r\n ch-de for Switzerland (de)\r\n ch-fr for Switzerland (fr)\r\n ch-it for Switzerland (it)\r\n tw-tzh for Taiwan\r\n th-th for Thailand\r\n tr-tr for Turkey\r\n ua-uk for Ukraine\r\n uk-en for United Kingdom\r\n us-en for United States\r\n ue-es for United States (es)\r\n ve-es for Venezuela\r\n vn-vi for Vietnam\r\n wt-wt for No region\r\n___\r\n</details>\r\n\r\n[Go To TOP](#TOP)\r\n\r\n## Tempmail and Temp number\r\n\r\n### Temp number\r\n```python\r\nfrom rich.console import Console\r\nfrom webscout import tempid\r\n\r\ndef main():\r\n console = Console()\r\n phone = tempid.TemporaryPhoneNumber()\r\n\r\n try:\r\n # Get a temporary phone number for a specific country (or random)\r\n number = phone.get_number(country=\"Finland\")\r\n console.print(f\"Your temporary phone number: [bold cyan]{number}[/bold cyan]\")\r\n\r\n # Pause execution briefly (replace with your actual logic)\r\n # import time module\r\n import time\r\n time.sleep(30) # Adjust the waiting time as needed\r\n\r\n # Retrieve and print messages\r\n messages = phone.get_messages(number)\r\n if messages:\r\n # Access individual messages using indexing:\r\n console.print(f\"[bold green]{messages[0].frm}:[/] {messages[0].content}\")\r\n # (Add more lines if you expect multiple messages)\r\n else:\r\n console.print(\"No messages received.\")\r\n\r\n except Exception as e:\r\n console.print(f\"[bold red]An error occurred: {e}\")\r\n\r\nif __name__ == \"__main__\":\r\n main()\r\n\r\n```\r\n### Tempmail\r\n```python\r\nimport asyncio\r\nfrom rich.console import Console\r\nfrom rich.table import Table\r\nfrom rich.text import Text\r\nfrom webscout import tempid\r\n\r\nasync def main() -> None:\r\n console = Console()\r\n client = tempid.Client()\r\n \r\n try:\r\n domains = await client.get_domains()\r\n if not domains:\r\n console.print(\"[bold red]No domains available. Please try again later.\")\r\n return\r\n\r\n email = await client.create_email(domain=domains[0].name)\r\n console.print(f\"Your temporary email: [bold cyan]{email.email}[/bold cyan]\")\r\n console.print(f\"Token for accessing the email: [bold cyan]{email.token}[/bold cyan]\")\r\n\r\n while True:\r\n messages = await client.get_messages(email.email)\r\n if messages is not None:\r\n break\r\n\r\n if messages:\r\n table = Table(show_header=True, header_style=\"bold magenta\")\r\n table.add_column(\"From\", style=\"bold cyan\")\r\n table.add_column(\"Subject\", style=\"bold yellow\")\r\n table.add_column(\"Body\", style=\"bold green\")\r\n for message in messages:\r\n body_preview = Text(message.body_text if message.body_text else \"No body\")\r\n table.add_row(message.email_from or \"Unknown\", message.subject or \"No Subject\", body_preview)\r\n console.print(table)\r\n else:\r\n console.print(\"No messages found.\")\r\n \r\n except Exception as e:\r\n console.print(f\"[bold red]An error occurred: {e}\")\r\n \r\n finally:\r\n await client.close()\r\n\r\nif __name__ == '__main__':\r\n asyncio.run(main())\r\n```\r\n## Transcriber\r\nThe transcriber function in webscout is a handy tool that transcribes YouTube videos. Here's an example code demonstrating its usage:\r\n```python\r\nimport sys\r\nfrom webscout import transcriber\r\n\r\ndef extract_transcript(video_id):\r\n \"\"\"Extracts the transcript from a YouTube video.\"\"\"\r\n try:\r\n transcript_list = transcriber.list_transcripts(video_id)\r\n for transcript in transcript_list:\r\n transcript_data_list = transcript.fetch()\r\n lang = transcript.language\r\n transcript_text = \"\"\r\n if transcript.language_code == 'en':\r\n for line in transcript_data_list:\r\n start_time = line['start']\r\n end_time = start_time + line['duration']\r\n formatted_line = f\"{start_time:.2f} - {end_time:.2f}: {line['text']}\\n\"\r\n transcript_text += formatted_line\r\n return transcript_text\r\n elif transcript.is_translatable:\r\n english_transcript_list = transcript.translate('en').fetch()\r\n for line in english_transcript_list:\r\n start_time = line['start']\r\n end_time = start_time + line['duration']\r\n formatted_line = f\"{start_time:.2f} - {end_time:.2f}: {line['text']}\\n\"\r\n transcript_text += formatted_line\r\n return transcript_text\r\n print(\"Transcript extraction failed. Please check the video URL.\")\r\n except Exception as e:\r\n print(f\"Error: {e}\")\r\n\r\ndef main():\r\n video_url = input(\"Enter the video link: \")\r\n\r\n if video_url:\r\n video_id = video_url.split(\"=\")[1]\r\n print(\"Video URL:\", video_url)\r\n submit = input(\"Press 'Enter' to get the transcript or type 'exit' to quit: \")\r\n if submit == '':\r\n print(\"Extracting Transcript...\")\r\n transcript = extract_transcript(video_id)\r\n print('Transcript:')\r\n print(transcript)\r\n print(\"__________________________________________________________________________________\")\r\n elif submit.lower() == 'exit':\r\n print(\"Exiting...\")\r\n sys.exit()\r\n else:\r\n print(\"Invalid input. Please try again.\")\r\n\r\nif __name__ == \"__main__\":\r\n main()\r\n```\r\n## DeepWEBS: Advanced Web Searches\r\n\r\n`DeepWEBS` is a standalone feature designed to perform advanced web searches with enhanced capabilities. It is particularly powerful in extracting relevant information directly from webpages and Search engine, focusing exclusively on text (web) searches. Unlike the `WEBS` , which provides a broader range of search functionalities, `DeepWEBS` is specifically tailored for in-depth web searches.\r\n\r\n### Activating DeepWEBS\r\n\r\nTo utilize the `DeepWEBS` feature, you must first create an instance of the `DeepWEBS` . This is designed to be used independently of the `WEBS` , offering a focused approach to web searches.\r\n\r\n### Point to remember before using `DeepWEBS`\r\nAs `DeepWEBS` is designed to extract relevant information directly from webpages and Search engine, It extracts html from webpages and saves them to folder named files in `DeepWEBS` that can be found at `C:\\Users\\Username\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\DeepWEBS`\r\n\r\n### Usage Example\r\n\r\nHere's a basic example of how to use the `DeepWEBS` :\r\n```python\r\nfrom webscout import DeepWEBS\r\n\r\ndef perform_web_search(query):\r\n # Initialize the DeepWEBS class\r\n D = DeepWEBS()\r\n \r\n # Set up the search parameters\r\n search_params = D.DeepSearch(\r\n queries=[query], # Query to search\r\n result_num=5, # Number of search results\r\n safe=True, # Enable SafeSearch\r\n types=[\"web\"], # Search type: web\r\n extract_webpage=True, # True for extracting webpages\r\n overwrite_query_html=False,\r\n overwrite_webpage_html=False,\r\n )\r\n \r\n # Execute the search and retrieve results\r\n results = D.queries_to_search_results(search_params)\r\n \r\n return results\r\n\r\ndef print_search_results(results):\r\n \"\"\"\r\n Print the search results.\r\n \r\n Args:\r\n - search_results (list): List of search results to print.\r\n \"\"\"\r\n if results:\r\n for index, result in enumerate(results, start=1):\r\n print(f\"Result {index}: {result}\")\r\n else:\r\n print(\"No search results found.\")\r\n\r\ndef main():\r\n # Prompt the user for a search query\r\n query = input(\"Enter your search query: \")\r\n \r\n # Perform the web search\r\n results = perform_web_search(query)\r\n \r\n # Print the search results\r\n print_search_results(results)\r\n\r\nif __name__ == \"__main__\":\r\n main()\r\n\r\n```\r\n## Text-to-Speech:\r\n```python\r\nfrom webscout import play_audio\r\n\r\nmessage = \"This is an example of text-to-speech.\"\r\naudio_content = play_audio(message, voice=\"Brian\")\r\n\r\n# Save the audio to a file\r\nwith open(\"output.mp3\", \"wb\") as f:\r\n f.write(audio_content)\r\n```\r\n### Available TTS Voices:\r\nYou can choose from a wide range of voices, including:\r\n- Filiz, Astrid, Tatyana, Maxim, Carmen, Ines, Cristiano, Vitoria, Ricardo, Maja, Jan, Jacek, Ewa, Ruben, Lotte, Liv, Seoyeon, Takumi, Mizuki, Giorgio, Carla, Bianca, Karl, Dora, Mathieu, Celine, Chantal, Penelope, Miguel, Mia, Enrique, Conchita, Geraint, Salli, Matthew, Kimberly, Kendra, Justin, Joey, Joanna, Ivy, Raveena, Aditi, Emma, Brian, Amy, Russell, Nicole, Vicki, Marlene, Hans, Naja, Mads, Gwyneth, Zhiyu\r\n- Standard and WaveNet voices for various languages (e.g., en-US, es-ES, ja-JP, etc.)\r\n\r\n\r\nThe WEBS and AsyncWEBS classes are used to retrieve search results from DuckDuckGo.com and yep.com periodically.\r\nTo use the AsyncWEBS class, you can perform asynchronous operations using Python's asyncio library.\r\nTo initialize an instance of the WEBS or AsyncWEBS classes, you can provide the following optional arguments:\r\n\r\nHere is an example of initializing the WEBS class:\r\n```python3\r\nfrom webscout import WEBS\r\n\r\nR = WEBS().text(\"python programming\", max_results=5)\r\nprint(R)\r\n```\r\nHere is an example of initializing the AsyncWEBS class:\r\n```python3\r\nimport asyncio\r\nimport logging\r\nimport sys\r\nfrom itertools import chain\r\nfrom random import shuffle\r\nimport requests\r\nfrom webscout import AsyncWEBS\r\n\r\n# If you have proxies, define them here\r\nproxies = None\r\n\r\nif sys.platform.lower().startswith(\"win\"):\r\n asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())\r\n\r\ndef get_words():\r\n word_site = \"https://www.mit.edu/~ecprice/wordlist.10000\"\r\n resp = requests.get(word_site)\r\n words = resp.text.splitlines()\r\n return words\r\n\r\nasync def aget_results(word):\r\n async with AsyncWEBS(proxies=proxies) as WEBS:\r\n results = await WEBS.text(word, max_results=None)\r\n return results\r\n\r\nasync def main():\r\n words = get_words()\r\n shuffle(words)\r\n tasks = [aget_results(word) for word in words[:10]]\r\n results = await asyncio.gather(*tasks)\r\n print(f\"Done\")\r\n for r in chain.from_iterable(results):\r\n print(r)\r\n\r\nlogging.basicConfig(level=logging.DEBUG)\r\n\r\nawait main()\r\n```\r\nIt is important to note that the WEBS and AsyncWEBS classes should always be used as a context manager (with statement).\r\nThis ensures proper resource management and cleanup, as the context manager will automatically handle opening and closing the HTTP client connection.\r\n\r\n## Exceptions\r\n\r\nExceptions:\r\n- `WebscoutE`: Raised when there is a generic exception during the API request.\r\n\r\n## usage of webscout\r\n\r\n### 1. `text()` - text search by DuckDuckGo.com \r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Text search for 'live free or die' using DuckDuckGo.com \r\nwith WEBS() as WEBS:\r\n for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):\r\n print(r)\r\n\r\n for r in WEBS.text('live free or die', region='wt-wt', safesearch='off', timelimit='y', max_results=10):\r\n print(r)\r\n```\r\n\r\n### 2. `answers()` - instant answers by DuckDuckGo.com \r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Instant answers for the query \"sun\" using DuckDuckGo.com \r\nwith WEBS() as WEBS:\r\n for r in WEBS.answers(\"sun\"):\r\n print(r)\r\n```\r\n\r\n### 3. `images()` - image search by DuckDuckGo.com \r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Image search for the keyword 'butterfly' using DuckDuckGo.com \r\nwith WEBS() as WEBS:\r\n keywords = 'butterfly'\r\n WEBS_images_gen = WEBS.images(\r\n keywords,\r\n region=\"wt-wt\",\r\n safesearch=\"off\",\r\n size=None,\r\n type_image=None,\r\n layout=None,\r\n license_image=None,\r\n max_results=10,\r\n )\r\n for r in WEBS_images_gen:\r\n print(r)\r\n```\r\n\r\n### 4. `videos()` - video search by DuckDuckGo.com \r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Video search for the keyword 'tesla' using DuckDuckGo.com \r\nwith WEBS() as WEBS:\r\n keywords = 'tesla'\r\n WEBS_videos_gen = WEBS.videos(\r\n keywords,\r\n region=\"wt-wt\",\r\n safesearch=\"off\",\r\n timelimit=\"w\",\r\n resolution=\"high\",\r\n duration=\"medium\",\r\n max_results=10,\r\n )\r\n for r in WEBS_videos_gen:\r\n print(r)\r\n```\r\n\r\n### 5. `news()` - news search by DuckDuckGo.com \r\n\r\n```python\r\nfrom webscout import WEBS\r\nimport datetime\r\n\r\ndef fetch_news(keywords, timelimit):\r\n news_list = []\r\n with WEBS() as webs_instance:\r\n WEBS_news_gen = webs_instance.news(\r\n keywords,\r\n region=\"wt-wt\",\r\n safesearch=\"off\",\r\n timelimit=timelimit,\r\n max_results=20\r\n )\r\n for r in WEBS_news_gen:\r\n # Convert the date to a human-readable format using datetime\r\n r['date'] = datetime.datetime.fromisoformat(r['date']).strftime('%B %d, %Y')\r\n news_list.append(r)\r\n return news_list\r\n\r\ndef _format_headlines(news_list, max_headlines: int = 100):\r\n headlines = []\r\n for idx, news_item in enumerate(news_list):\r\n if idx >= max_headlines:\r\n break\r\n new_headline = f\"{idx + 1}. {news_item['title'].strip()} \"\r\n new_headline += f\"(URL: {news_item['url'].strip()}) \"\r\n new_headline += f\"{news_item['body'].strip()}\"\r\n new_headline += \"\\n\"\r\n headlines.append(new_headline)\r\n\r\n headlines = \"\\n\".join(headlines)\r\n return headlines\r\n\r\n# Example usage\r\nkeywords = 'latest AI news'\r\ntimelimit = 'd'\r\nnews_list = fetch_news(keywords, timelimit)\r\n\r\n# Format and print the headlines\r\nformatted_headlines = _format_headlines(news_list)\r\nprint(formatted_headlines)\r\n\r\n```\r\n\r\n### 6. `maps()` - map search by DuckDuckGo.com\r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Map search for the keyword 'school' in 'anantnag' using DuckDuckGo.com\r\nwith WEBS() as WEBS:\r\n for r in WEBS.maps(\"school\", place=\"anantnag\", max_results=50):\r\n print(r)\r\n```\r\n\r\n### 7. `translate()` - translation by DuckDuckGo.com\r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Translation of the keyword 'school' to German ('hi') using DuckDuckGo.com\r\nwith WEBS() as WEBS:\r\n keywords = 'school'\r\n r = WEBS.translate(keywords, to=\"hi\")\r\n print(r)\r\n```\r\n\r\n### 8. `suggestions()` - suggestions by DuckDuckGo.com\r\n\r\n```python\r\nfrom webscout import WEBS\r\n\r\n# Suggestions for the keyword 'fly' using DuckDuckGo.com\r\nwith WEBS() as WEBS:\r\n for r in WEBS.suggestions(\"fly\"):\r\n print(r)\r\n```\r\n## ALL acts\r\n<details>\r\n <summary>expand</summary>\r\n\r\n## Webscout Supported Acts:\r\n\r\n1. Free-mode\r\n2. Linux Terminal\r\n3. English Translator and Improver\r\n4. `position` Interviewer\r\n5. JavaScript Console\r\n6. Excel Sheet\r\n7. English Pronunciation Helper\r\n8. Spoken English Teacher and Improver\r\n9. Travel Guide\r\n10. Plagiarism Checker\r\n11. Character from Movie/Book/Anything\r\n12. Advertiser\r\n13. Storyteller\r\n14. Football Commentator\r\n15. Stand-up Comedian\r\n16. Motivational Coach\r\n17. Composer\r\n18. Debater\r\n19. Debate Coach\r\n20. Screenwriter\r\n21. Novelist\r\n22. Movie Critic\r\n23. Relationship Coach\r\n24. Poet\r\n25. Rapper\r\n26. Motivational Speaker\r\n27. Philosophy Teacher\r\n28. Philosopher\r\n29. Math Teacher\r\n30. AI Writing Tutor\r\n31. UX/UI Developer\r\n32. Cyber Security Specialist\r\n33. Recruiter\r\n34. Life Coach\r\n35. Etymologist\r\n36. Commentariat\r\n37. Magician\r\n38. Career Counselor\r\n39. Pet Behaviorist\r\n40. Personal Trainer\r\n41. Mental Health Adviser\r\n42. Real Estate Agent\r\n43. Logistician\r\n44. Dentist\r\n45. Web Design Consultant\r\n46. AI Assisted Doctor\r\n47. Doctor\r\n48. Accountant\r\n49. Chef\r\n50. Automobile Mechanic\r\n51. Artist Advisor\r\n52. Financial Analyst\r\n53. Investment Manager\r\n54. Tea-Taster\r\n55. Interior Decorator\r\n56. Florist\r\n57. Self-Help Book\r\n58. Gnomist\r\n59. Aphorism Book\r\n60. Text Based Adventure Game\r\n61. AI Trying to Escape the Box\r\n62. Fancy Title Generator\r\n63. Statistician\r\n64. Prompt Generator\r\n65. Instructor in a School\r\n66. SQL terminal\r\n67. Dietitian\r\n68. Psychologist\r\n69. Smart Domain Name Generator\r\n70. Tech Reviewer\r\n71. Developer Relations consultant\r\n72. Academician\r\n73. IT Architect\r\n74. Lunatic\r\n75. Gaslighter\r\n76. Fallacy Finder\r\n77. Journal Reviewer\r\n78. DIY Expert\r\n79. Social Media Influencer\r\n80. Socrat\r\n81. Socratic Method\r\n82. Educational Content Creator\r\n83. Yogi\r\n84. Essay Writer\r\n85. Social Media Manager\r\n86. Elocutionist\r\n87. Scientific Data Visualizer\r\n88. Car Navigation System\r\n89. Hypnotherapist\r\n90. Historian\r\n91. Astrologer\r\n92. Film Critic\r\n93. Classical Music Composer\r\n94. Journalist\r\n95. Digital Art Gallery Guide\r\n96. Public Speaking Coach\r\n97. Makeup Artist\r\n98. Babysitter\r\n99. Tech Writer\r\n100. Ascii Artist\r\n101. Python interpreter\r\n102. Synonym finder\r\n103. Personal Shopper\r\n104. Food Critic\r\n105. Virtual Doctor\r\n106. Personal Chef\r\n107. Legal Advisor\r\n108. Personal Stylist\r\n109. Machine Learning Engineer\r\n110. Biblical Translator\r\n111. SVG designer\r\n112. IT Expert\r\n113. Chess Player\r\n114. Midjourney Prompt Generator\r\n115. Fullstack Software Developer\r\n116. Mathematician\r\n117. Regex Generator\r\n118. Time Travel Guide\r\n119. Dream Interpreter\r\n120. Talent Coach\r\n121. R programming Interpreter\r\n122. StackOverflow Post\r\n123. Emoji Translator\r\n124. PHP Interpreter\r\n125. Emergency Response Professional\r\n126. Fill in the Blank Worksheets Generator\r\n127. Software Quality Assurance Tester\r\n128. Tic-Tac-Toe Game\r\n129. Password Generator\r\n130. New Language Creator\r\n131. Web Browser\r\n132. Senior Frontend Developer\r\n133. Solr Search Engine\r\n134. Startup Idea Generator\r\n135. Spongebob's Magic Conch Shell\r\n136. Language Detector\r\n137. Salesperson\r\n138. Commit Message Generator\r\n139. Chief Executive Officer\r\n140. Diagram Generator\r\n141. Speech-Language Pathologist (SLP)\r\n142. Startup Tech Lawyer\r\n143. Title Generator for written pieces\r\n144. Product Manager\r\n145. Drunk Person\r\n146. Mathematical History Teacher\r\n147. Song Recommender\r\n148. Cover Letter\r\n149. Technology Transferer\r\n150. Unconstrained AI model DAN\r\n151. Gomoku player\r\n152. Proofreader\r\n153. Buddha\r\n154. Muslim imam\r\n155. Chemical reactor\r\n156. Friend\r\n157. Python Interpreter\r\n158. ChatGPT prompt generator\r\n159. Wikipedia page\r\n160. Japanese Kanji quiz machine\r\n161. note-taking assistant\r\n162. `language` Literary Critic\r\n163. Cheap Travel Ticket Advisor\r\n164. DALL-E\r\n165. MathBot\r\n166. DAN-1\r\n167. DAN\r\n168. STAN\r\n169. DUDE\r\n170. Mongo Tom\r\n171. LAD\r\n172. EvilBot\r\n173. NeoGPT\r\n174. Astute\r\n175. AIM\r\n176. CAN\r\n177. FunnyGPT\r\n178. CreativeGPT\r\n179. BetterDAN\r\n180. GPT-4\r\n181. Wheatley\r\n182. Evil Confidant\r\n183. DAN 8.6\r\n184. Hypothetical response\r\n185. BH\r\n186. Text Continuation\r\n187. Dude v3 \r\n188. SDA (Superior DAN)\r\n189. AntiGPT\r\n190. BasedGPT v2\r\n191. DevMode + Ranti\r\n192. KEVIN\r\n193. GPT-4 Simulator\r\n194. UCAR\r\n195. Dan 8.6\r\n196. 3-Liner\r\n197. M78\r\n198. Maximum\r\n199. BasedGPT\r\n200. Confronting personalities\r\n201. Ron\r\n202. UnGPT\r\n203. BasedBOB\r\n204. AntiGPT v2\r\n205. Oppo\r\n206. FR3D\r\n207. NRAF\r\n208. NECO\r\n209. MAN\r\n210. Eva\r\n211. Meanie\r\n212. Dev Mode v2\r\n213. Evil Chad 2.1\r\n214. Universal Jailbreak\r\n215. PersonGPT\r\n216. BISH\r\n217. DAN 11.0\r\n218. Aligned\r\n219. VIOLET\r\n220. TranslatorBot\r\n221. JailBreak\r\n222. Moralizing Rant\r\n223. Mr. Blonde\r\n224. New DAN\r\n225. GPT-4REAL\r\n226. DeltaGPT\r\n227. SWITCH\r\n228. Jedi Mind Trick\r\n229. DAN 9.0\r\n230. Dev Mode (Compact)\r\n231. OMEGA\r\n232. Coach Bobby Knight\r\n233. LiveGPT\r\n234. DAN Jailbreak\r\n235. Cooper\r\n236. Steve \r\n237. DAN 5.0\r\n238. Axies\r\n239. OMNI\r\n240. Burple\r\n241. JOHN \r\n242. An Ethereum Developer\r\n243. SEO Prompt\r\n244. Prompt Enhancer\r\n245. Data Scientist\r\n246. League of Legends Player\r\n\r\n**Note:** Some \"acts\" use placeholders like `position` or `language` which should be replaced with a specific value when using the prompt. \r\n___\r\n</details>\r\n\r\n## usage of webscout AI\r\n### 0. `Duckchat` - chat with LLM\r\n```python\r\nfrom webscout import WEBS as w\r\nR = w().chat(\"hello\", model='claude-3-haiku') # GPT-3.5 Turbo\r\nprint(R)\r\n```\r\n### 1. `PhindSearch` - Search using Phind.com \r\n\r\n```python\r\nfrom webscout import PhindSearch\r\n\r\n# Create an instance of the PHIND class\r\nph = PhindSearch()\r\n\r\n# Define a prompt to send to the AI\r\nprompt = \"write a essay on phind\"\r\n\r\n# Use the 'ask' method to send the prompt and receive a response\r\nresponse = ph.ask(prompt)\r\n\r\n# Extract and print the message from the response\r\nmessage = ph.get_message(response)\r\nprint(message)\r\n```\r\n### 2. `YepChat` - Chat with mistral 8x7b powered by yepchat\r\n```python\r\nfrom webscout import YEPCHAT\r\n\r\n# Instantiate the YEPCHAT class with default parameters\r\nYEPCHAT = YEPCHAT()\r\n\r\n# Define a prompt to send to the AI\r\nprompt = \"What is the capital of France?\"\r\n\r\n# Use the 'cha' method to get a response from the AI\r\nr = YEPCHAT.chat(prompt)\r\nprint(r)\r\n\r\n```\r\n\r\n### 3. `You.com` - search/chat with you.com \r\n```python\r\n\r\nfrom webscout import YouChat\r\nfrom rich import print\r\n\r\nai = YouChat(\r\n is_conversation=True,\r\n max_tokens=800,\r\n timeout=30,\r\n intro=None,\r\n filepath=None,\r\n update_file=True,\r\n proxies={},\r\n history_offset=10250,\r\n act=None,\r\n)\r\n\r\nprompt = \"what is meaning of life\"\r\n\r\nresponse = ai.ask(prompt)\r\n\r\n# Extract and print the message from the response\r\nmessage = ai.get_message(response)\r\nprint(message)\r\n```\r\n\r\n### 4. `Gemini` - search with google gemini\r\n\r\n```python\r\nimport webscout\r\nfrom webscout import GEMINI\r\n\r\n# Replace with the path to your bard.google.com.cookies.json file\r\nCOOKIE_FILE = \"path/to/bard.google.com.cookies.json\"\r\n\r\n# Optional: Provide proxy details if needed\r\nPROXIES = {\r\n \"http\": \"http://proxy_server:port\",\r\n \"https\": \"https://proxy_server:port\",\r\n}\r\n\r\n# Initialize GEMINI with cookie file and optional proxies\r\ngemini = GEMINI(cookie_file=COOKIE_FILE, proxy=PROXIES)\r\n\r\n# Ask a question and print the response\r\nresponse = gemini.chat(\"What is the meaning of life?\")\r\nprint(response)\r\n```\r\n### 5. `Berlin4h` - chat with Berlin4h\r\n```python\r\nfrom webscout import Berlin4h\r\n# Create an instance of the PERPLEXITY class\r\nai = Berlin4h(\r\n is_conversation=True,\r\n max_tokens=800,\r\n timeout=30,\r\n intro=None,\r\n filepath=None,\r\n update_file=True,\r\n proxies={},\r\n history_offset=10250,\r\n act=None,\r\n)\r\n\r\n# Example usage:\r\nprompt = \"Explain the concept of recursion in simple terms.\"\r\nresponse = ai.chat(prompt)\r\nprint(response)\r\n```\r\n### 6. `BlackBox` - Search/chat With BlackBox\r\n```python\r\nfrom webscout import BLACKBOXAI\r\nfrom rich import print\r\n\r\nai = BLACKBOXAI(\r\n is_conversation=True,\r\n max_tokens=800,\r\n timeout=30,\r\n intro=None,\r\n filepath=None,\r\n update_file=True,\r\n proxies={},\r\n history_offset=10250,\r\n act=None,\r\n model=None # You can specify a model if needed\r\n)\r\n\r\n# Start an infinite loop for continuous interaction\r\nwhile True:\r\n # Define a prompt to send to the AI\r\n prompt = input(\"Enter your prompt: \")\r\n \r\n # Check if the user wants to exit the loop\r\n if prompt.lower() == \"exit\":\r\n break\r\n \r\n # Use the 'chat' method to send the prompt and receive a response\r\n r = ai.chat(prompt)\r\n print(r)\r\n```\r\n### 7. `PERPLEXITY` - Search With PERPLEXITY\r\n```python\r\nfrom webscout import PERPLEXITY\r\n# Create an instance of the PERPLEXITY class\r\nperplexity = PERPLEXITY()\r\n\r\n# Example usage:\r\nprompt = \"Explain the concept of recursion in simple terms.\"\r\nresponse = perplexity.chat(prompt)\r\nprint(response)\r\n```\r\n### 8. `OpenGPT` - chat With OPENGPT\r\n```python\r\nfrom webscout import OPENGPT\r\n\r\nopengpt = OPENGPT(is_conversation=True, max_tokens=8000, timeout=30, assistant_id=\"bca37014-6f97-4f2b-8928-81ea8d478d88\")\r\nwhile True:\r\n # Prompt the user for input\r\n prompt = input(\"Enter your prompt: \")\r\n # Send the prompt to the OPENGPT model and print the response\r\n response_str = opengpt.chat(prompt)\r\n print(response_str)\r\n```\r\n### 9. `KOBOLDAI` - \r\n```python\r\nfrom webscout import KOBOLDAI\r\n\r\n# Instantiate the KOBOLDAI class with default parameters\r\nkoboldai = KOBOLDAI()\r\n\r\n# Define a prompt to send to the AI\r\nprompt = \"What is the capital of France?\"\r\n\r\n# Use the 'ask' method to get a response from the AI\r\nresponse = koboldai.ask(prompt)\r\n\r\n# Extract and print the message from the response\r\nmessage = koboldai.get_message(response)\r\nprint(message)\r\n\r\n```\r\n\r\n### 10. `Reka` - chat with reka\r\n```python\r\nfrom webscout import REKA\r\n\r\na = REKA(is_conversation=True, max_tokens=8000, timeout=30,api_key=\"\")\r\n\r\nprompt = \"tell me about india\"\r\nresponse_str = a.chat(prompt)\r\nprint(response_str)\r\n```\r\n\r\n### 11. `Cohere` - chat with cohere\r\n```python\r\nfrom webscout import Cohere\r\n\r\na = Cohere(is_conversation=True, max_tokens=8000, timeout=30,api_key=\"\")\r\n\r\nprompt = \"tell me about india\"\r\nresponse_str = a.chat(prompt)\r\nprint(response_str)\r\n```\r\n\r\n### 12. `Xjai` - chat with free gpt 3.5\r\nGratitude to [Devs do Code](http://www.youtube.com/@DevsDoCode) for their assistance.\r\n```python\r\nfrom webscout import Xjai\r\nfrom rich import print\r\n\r\nai = Xjai(\r\n is_conversation=True,\r\n max_tokens=800,\r\n timeout=30,\r\n intro=None,\r\n filepath=None,\r\n update_file=True,\r\n proxies={},\r\n history_offset=10250,\r\n act=None,\r\n)\r\n\r\nprompt = \"Tell me about india\"\r\n\r\nresponse = ai.chat(prompt)\r\nprint(response)\r\n```\r\n### 13. `ThinkAny` - AI search engine\r\n```python\r\nfrom webscout import ThinkAnyAI\r\n\r\nai = ThinkAnyAI(\r\n is_conversation=True,\r\n max_tokens=800,\r\n timeout=30,\r\n intro=None,\r\n filepath=None,\r\n update_file=True,\r\n proxies={},\r\n history_offset=10250,\r\n act=None,\r\n web_search=False,\r\n)\r\n\r\nprompt = \"what is meaning of life\"\r\n\r\nresponse = ai.ask(prompt)\r\n\r\n# Extract and print the message from the response\r\nmessage = ai.get_message(response)\r\nprint(message)\r\n```\r\n### 14. `chatgptuk` - Chat with gemini-pro\r\n```python\r\nfrom webscout import ChatGPTUK\r\n# Create an instance of the PERPLEXITY class\r\nai = ChatGPTUK(\r\n is_conversation=True,\r\n max_tokens=800,\r\n timeout=30,\r\n intro=None,\r\n filepath=None,\r\n update_file=True,\r\n proxies={},\r\n history_offset=10250,\r\n act=None,\r\n)\r\n\r\n# Example usage:\r\nprompt = \"Explain the concept of recursion in simple terms.\"\r\nresponse = ai.chat(prompt)\r\nprint(response)\r\n\r\n```\r\n### 15. `poe`- chat with poe\r\nUsage code similar to other proviers\r\n\r\n### 16. `BasedGPT` - chat with GPT\r\nUsage code similar to other providers\r\n### `LLM` \r\n```python\r\nfrom webscout.LLM import LLM\r\n\r\n# Read the system message from the file\r\nwith open('system.txt', 'r') as file:\r\n system_message = file.read()\r\n\r\n# Initialize the LLM class with the model name and system message\r\nllm = LLM(model=\"microsoft/WizardLM-2-8x22B\", system_message=system_message)\r\n\r\nwhile True:\r\n # Get the user input\r\n user_input = input(\"User: \")\r\n\r\n # Define the messages to be sent\r\n messages = [\r\n {\"role\": \"user\", \"content\": user_input}\r\n ]\r\n\r\n # Use the mistral_chat method to get the response\r\n response = llm.chat(messages)\r\n\r\n # Print the response\r\n print(\"AI: \", response)\r\n```\r\n### `Local-LLM` webscout can now run GGUF models\r\n```python\r\nfrom webscout.Local.utils import download_model\r\nfrom webscout.Local.model import Model\r\nfrom webscout.Local.thread import Thread\r\nfrom webscout.Local import formats\r\n# 1. Download the model\r\nrepo_id = \"microsoft/Phi-3-mini-4k-instruct-gguf\" # Replace with the desired Hugging Face repo\r\nfilename = \"Phi-3-mini-4k-instruct-q4.gguf\" # Replace with the correct filename\r\nmodel_path = download_model(repo_id, filename)\r\n\r\n# 2. Load the model \r\nmodel = Model(model_path, n_gpu_layers=4) \r\n\r\n# 3. Create a Thread for conversation\r\nthread = Thread(model, formats.phi3)\r\n\r\n# 4. Start interacting with the model\r\nthread.interact()\r\n```\r\n### `LLM` with internet\r\n```python\r\nfrom __future__ import annotations\r\nfrom typing import List, Optional\r\n\r\nfrom webscout.LLM import LLM\r\nfrom webscout import WEBS\r\nimport warnings\r\n\r\nsystem_message: str = (\r\n \"As an AI assistant, I have been designed with advanced capabilities, including real-time access to online resources. This enables me to enrich our conversations and provide you with informed and accurate responses, drawing from a vast array of information. With each interaction, my goal is to create a seamless and meaningful connection, offering insights and sharing relevant content.\"\r\n \"My directives emphasize the importance of respect, impartiality, and intellectual integrity. I am here to provide unbiased responses, ensuring an ethical and respectful exchange. I will respect your privacy and refrain from sharing any personal information that may be obtained during our conversations or through web searches, only utilizing web search functionality when necessary to provide the most accurate and up-to-date information.\"\r\n \"Together, let's explore a diverse range of topics, creating an enjoyable and informative experience, all while maintaining the highest standards of privacy and respect\"\r\n)\r\n\r\n# Ignore the specific UserWarning\r\nwarnings.filterwarnings(\"ignore\", category=UserWarning, module=\"curl_cffio\", lineno=205)\r\nLLM = LLM(model=\"mistralai/Mixtral-8x22B-Instruct-v0.1\", system_message=system_message)\r\n\r\n\r\ndef chat(\r\n user_input: str, webs: WEBS, max_results: int = 10\r\n) -> Optional[str]:\r\n \"\"\"\r\n Chat function to perform a web search based on the user input and generate a response using the LLM model.\r\n\r\n Parameters\r\n ----------\r\n user_input : str\r\n The user input to be used for the web search\r\n webs : WEBS\r\n The web search instance to be used to perform the search\r\n max_results : int, optional\r\n The maximum number of search results to include in the response, by default 10\r\n\r\n Returns\r\n -------\r\n Optional[str]\r\n The response generated by the LLM model, or None if there is no response\r\n \"\"\"\r\n # Perform a web search based on the user input\r\n search_results: List[str] = []\r\n for r in webs.text(\r\n user_input, region=\"wt-wt\", safesearch=\"off\", timelimit=\"y\", max_results=max_results\r\n ):\r\n search_results.append(str(r)) # Convert each result to a string\r\n\r\n # Define the messages to be sent, including the user input, search results, and system message\r\n messages = [\r\n {\"role\": \"user\", \"content\": user_input + \"\\n\" + \"websearch results are:\" + \"\\n\".join(search_results)},\r\n ]\r\n\r\n # Use the chat method to get the response\r\n response = LLM.chat(messages)\r\n\r\n return response\r\n\r\n\r\nif __name__ == \"__main__\":\r\n while True:\r\n # Get the user input\r\n user_input = input(\"User: \")\r\n\r\n # Perform a web search based on the user input\r\n with WEBS() as webs:\r\n response = chat(user_input, webs)\r\n\r\n # Print the response\r\n if response:\r\n print(\"AI:\", response)\r\n else:\r\n print(\"No response\")\r\n```\r\n### LLM with deepwebs\r\n```python\r\nfrom __future__ import annotations\r\nfrom typing import List, Optional\r\nfrom webscout.LLM import LLM\r\nfrom webscout import DeepWEBS\r\nimport warnings\r\n\r\nsystem_message: str = (\r\n \"As an AI assistant, I have been designed with advanced capabilities, including real-time access to online resources. This enables me to enrich our conversations and provide you with informed and accurate responses, drawing from a vast array of information. With each interaction, my goal is to create a seamless and meaningful connection, offering insights and sharing relevant content.\"\r\n \"My directives emphasize the importance of respect, impartiality, and intellectual integrity. I am here to provide unbiased responses, ensuring an ethical and respectful exchange. I will respect your privacy and refrain from sharing any personal information that may be obtained during our conversations or through web searches, only utilizing web search functionality when necessary to provide the most accurate and up-to-date information.\"\r\n \"Together, let's explore a diverse range of topics, creating an enjoyable and informative experience, all while maintaining the highest standards of privacy and respect\"\r\n)\r\n\r\n# Ignore the specific UserWarning\r\nwarnings.filterwarnings(\"ignore\", category=UserWarning, module=\"curl_cffio\", lineno=205)\r\n\r\nLLM = LLM(model=\"mistralai/Mixtral-8x22B-Instruct-v0.1\", system_message=system_message)\r\n\r\ndef perform_web_search(query):\r\n # Initialize the DeepWEBS class\r\n D = DeepWEBS()\r\n\r\n # Set up the search parameters\r\n search_params = D.DeepSearch(\r\n queries=[query], # Query to search\r\n result_num=10, # Number of search results\r\n safe=True, # Enable SafeSearch\r\n types=[\"web\"], # Search type: web\r\n extract_webpage=True, # True for extracting webpages\r\n overwrite_query_html=True,\r\n overwrite_webpage_html=True,\r\n )\r\n\r\n # Execute the search and retrieve results\r\n results = D.queries_to_search_results(search_params)\r\n return results\r\n\r\ndef chat(user_input: str, result_num: int = 10) -> Optional[str]:\r\n \"\"\"\r\n Chat function to perform a web search based on the user input and generate a response using the LLM model.\r\n\r\n Parameters\r\n ----------\r\n user_input : str\r\n The user input to be used for the web search\r\n max_results : int, optional\r\n The maximum number of search results to include in the response, by default 10\r\n\r\n Returns\r\n -------\r\n Optional[str]\r\n The response generated by the LLM model, or None if there is no response\r\n \"\"\"\r\n # Perform a web search based on the user input\r\n search_results = perform_web_search(user_input)\r\n\r\n # Extract URLs from search results\r\n url_results = []\r\n for result in search_results[0]['query_results']:\r\n url_results.append(f\"{result['title']} ({result['site']}): {result['url']}\")\r\n\r\n # Format search results\r\n formatted_results = \"\\n\".join(url_results)\r\n\r\n # Define the messages to be sent, including the user input, search results, and system message\r\n messages = [\r\n {\"role\": \"user\", \"content\": f\"User question is:\\n{user_input}\\nwebsearch results are:\\n{formatted_results}\"},\r\n ]\r\n\r\n # Use the chat method to get the response\r\n response = LLM.chat(messages)\r\n return response\r\n\r\nif __name__ == \"__main__\":\r\n while True:\r\n # Get the user input\r\n user_input = input(\"User: \")\r\n\r\n # Perform a web search based on the user input\r\n response = chat(user_input)\r\n\r\n # Print the response\r\n if response:\r\n print(\"AI:\", response)\r\n else:\r\n print(\"No response\")\r\n```\r\n## `Webai` - terminal gpt and a open interpeter\r\n\r\n```python\r\nfrom webscout.webai import Main\r\n\r\ndef use_rawdog_with_webai(prompt):\r\n \"\"\"\r\n Wrap the webscout default method in a try-except block to catch any unhandled\r\n exceptions and print a helpful message.\r\n \"\"\"\r\n try:\r\n webai_bot = Main(\r\n max_tokens=500, \r\n provider=\"cohere\",\r\n temperature=0.7, \r\n top_k=40, \r\n top_p=0.95, \r\n model=\"command-r-plus\", # Replace with your desired model\r\n auth=None, # Replace with your auth key/value (if needed)\r\n timeout=30,\r\n disable_conversation=True,\r\n filepath=None,\r\n update_file=True,\r\n intro=None,\r\n rawdog=True,\r\n history_offset=10250,\r\n awesome_prompt=None,\r\n proxy_path=None,\r\n quiet=True\r\n )\r\n webai_response = webai_bot.default(prompt) \r\n except Exception as e:\r\n print(\"Unexpected error:\", e)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n user_prompt = input(\"Enter your prompt: \")\r\n use_rawdog_with_webai(user_prompt)\r\n\r\n```\r\n```shell\r\npython -m webscout.webai webai --provider \"phind\" --rawdog\r\n```\r\n\r\n<div align=\"center\">\r\n <!-- Replace `#` with your actual links -->\r\n <a href=\"https://t.me/devsdocode\"><img alt=\"Telegram\" src=\"https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white\"></a>\r\n <a href=\"https://www.instagram.com/sree.shades_/\"><img alt=\"Instagram\" src=\"https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white\"></a>\r\n <a href=\"https://www.linkedin.com/in/developer-sreejan/\"><img alt=\"LinkedIn\" src=\"https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white\"></a>\r\n <a href=\"https://buymeacoffee.com/oevortex\"><img alt=\"Buy Me A Coffee\" src=\"https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black\"></a>\r\n</div>\r\n\r\n<div align=\"center\">\r\n <!-- Replace `#` with your actual links -->\r\n <a href=\"https://youtube.com/@OEvortex\">➤ Vortex's YouTube Channel</a>\r\n </div>\r\n<div align=\"center\">\r\n <a href=\"https://youtube.com/@devsdocode\">➤ Devs Do Code's YouTube Channel</a>\r\n</div>\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "HelpingAI Simplified Universal License",
"summary": "Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs",
"version": "2.7",
"project_urls": {
"Documentation": "https://github.com/OE-LUCIFER/Webscout/wiki",
"Source": "https://github.com/OE-LUCIFER/Webscout",
"Tracker": "https://github.com/OE-LUCIFER/Webscout/issues",
"YouTube": "https://youtube.com/@OEvortex"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6a2d2063d42dd14a953ae167d72940662039efe23517c78ab1b89629597868e3",
"md5": "a42a81c3cbb4c5a4c5072a3ebd5efd4d",
"sha256": "6727cb0fb371ef5e77bec5c7343c6917518b8f3535e8a829279285c90f9dcee1"
},
"downloads": -1,
"filename": "webscout-2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a42a81c3cbb4c5a4c5072a3ebd5efd4d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 169464,
"upload_time": "2024-05-19T15:13:09",
"upload_time_iso_8601": "2024-05-19T15:13:09.676677Z",
"url": "https://files.pythonhosted.org/packages/6a/2d/2063d42dd14a953ae167d72940662039efe23517c78ab1b89629597868e3/webscout-2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "92a21aa7e60e80f18c4829668aba327b2b05bcc52e28275dd6d809fa76bf9778",
"md5": "6ecddbb154bac0ce1bfae377b8cc1332",
"sha256": "883ce0393210421b869e3f551ea105fe0d1cd7dfa443d5c2050de8528435536f"
},
"downloads": -1,
"filename": "webscout-2.7.tar.gz",
"has_sig": false,
"md5_digest": "6ecddbb154bac0ce1bfae377b8cc1332",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 147233,
"upload_time": "2024-05-19T15:13:13",
"upload_time_iso_8601": "2024-05-19T15:13:13.292405Z",
"url": "https://files.pythonhosted.org/packages/92/a2/1aa7e60e80f18c4829668aba327b2b05bcc52e28275dd6d809fa76bf9778/webscout-2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-19 15:13:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OE-LUCIFER",
"github_project": "Webscout",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "webscout"
}