import webbrowser
import os
import time
import random
import pyautogui
import urllib.parse
ALLOWED_SITES = {
"google": "https://google.com",
"youtube": "https://youtube.com",
"facebook": "https://facebook.com",
"instagram": "https://instagram.com",
"chatgpt": "https://chatgpt.com",
"x": "https://x.com",
"reddit": "https://reddit.com",
"whatsapp": "https://whatsapp.com",
"wikipedia": "https://wikipedia.org",
"bing": "https://bing.com",
"tiktok": "https://tiktok.com",
"amazon": "https://amazon.com",
"yahoo japan": "https://yahoo.co.jp",
"yandex": "https://yandex.ru",
"yahoo": "https://yahoo.com",
"netflix": "https://netflix.com",
"gemini": "https://gemini.google.com",
"linkedin": "https://linkedin.com",
"naver": "https://naver.com",
"pinterest": "https://pinterest.com",
"live": "https://live.com",
"temu": "https://temu.com",
"bilibili": "https://bilibili.com",
"office": "https://office.com",
"microsoft": "https://microsoft.com",
"twitch": "https://twitch.tv",
"vk": "https://vk.com",
"canva": "https://canva.com",
"weather": "https://weather.com",
"telegram": "https://t.me",
"samsung": "https://samsung.com",
"duckduckgo": "https://duckduckgo.com",
"ebay": "https://ebay.com",
"roblox": "https://roblox.com",
"walmart": "https://walmart.com",
# ✅ CUSTOM WEBSITES
"fitgirl": "https://fitgirl-repacks.site",
"1tamilmv": "https://1tamilmv.haus",
"moviesmod": "https://moviesmod.net"
}
def open_website(site: str):
site = site.lower()
if site not in ALLOWED_SITES:
return {"status": "error", "message": "Website not allowed"}
webbrowser.open(ALLOWED_SITES[site])
return {"status": "success", "message": f"Opened {site}"}
def play_youtube(query: str):
url = f"https://www.youtube.com/results?search_query={query.replace(' ', '+')}"
webbrowser.open(url)
# wait for page to load
time.sleep(5)
# click first video
pyautogui.press("tab")
time.sleep(0.5)
pyautogui.press("enter")
return {"status": "success", "message": "Playing youtube video"}
def list_wallpapers(folder: str):
wallpapers = []
for file in os.listdir(folder):
if file.lower().endswith((".png", ".jpg", ".jpeg")):
wallpapers.append(file)
return {"status": "success", "wallpapers": wallpapers}
def set_wallpaper(path: str):
# Windows only
import ctypes
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, path, 3)
return {"status": "success", "message": "Wallpaper set successfully"}
# =========================
# SEARCH FUNCTIONS START
# =========================
def search_fitgirl(query: str):
base_url = "https://fitgirl-repacks.site/?s="
search_url = base_url + urllib.parse.quote(query)
webbrowser.open(search_url)
return {"status": "success", "url": search_url}
def search_google(query: str):
url = "https://www.google.com/search?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_youtube(query: str):
url = "https://www.youtube.com/results?search_query=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_facebook(query: str):
url = "https://www.facebook.com/search/top?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_instagram(query: str):
url = "https://www.instagram.com/explore/tags/" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_chatgpt(query: str):
url = "https://chat.openai.com/?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_x(query: str):
url = "https://x.com/search?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_reddit(query: str):
url = "https://www.reddit.com/search/?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_whatsapp(query: str):
url = "https://web.whatsapp.com/search/" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_amazon(query: str):
url = "https://www.amazon.com/s?k=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_yahoo(query: str):
url = "https://search.yahoo.com/search?p=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_yandex(query: str):
url = "https://yandex.com/search/?text=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_netflix(query: str):
url = "https://www.netflix.com/search?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_linkedin(query: str):
url = "https://www.linkedin.com/search/results/all/?keywords=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
def search_pinterest(query: str):
url = "https://www.pinterest.com/search/pins/?q=" + urllib.parse.quote(query)
webbrowser.open(url)
return {"status": "success", "url": url}
# =========================
# OPEN FUNCTIONS START
# =========================
def open_google():
url = "https://google.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_youtube():
url = "https://youtube.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_facebook():
url = "https://facebook.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_instagram():
url = "https://instagram.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_chatgpt():
url = "https://chatgpt.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_x():
url = "https://x.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_reddit():
url = "https://reddit.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_whatsapp():
url = "https://whatsapp.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_amazon():
url = "https://amazon.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_yahoo_japan():
url = "https://yahoo.co.jp"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_yandex():
url = "https://yandex.ru"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_yahoo():
url = "https://yahoo.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_netflix():
url = "https://netflix.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_gemini():
url = "https://gemini.google.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_linkedin():
url = "https://linkedin.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_naver():
url = "https://naver.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def open_pinterest():
url = "https://pinterest.com"
webbrowser.open(url)
return {"status": "success", "url": url}
def search_1tamilmv(query: str):
base_url = "https://1tamilmv.haus/?s="
search_url = base_url + urllib.parse.quote(query)
webbrowser.open(search_url)
return {"status": "success", "url": search_url}