import requests from bs4 import BeautifulSoup import sys sys.stdout.reconfigure(encoding="utf-8") BASE_URL = "https://fitgirl-repacks.site/all-my-repacks-a-z/" TOTAL_PAGES = 71 headers = { "User-Agent": "Mozilla/5.0" } def get_game_list(page): url = f"{BASE_URL}?lcp_page0={page}#lcp_instance_0" try: res = requests.get(url, headers=headers) res.raise_for_status() except: return [] soup = BeautifulSoup(res.text, "html.parser") ul = soup.find("ul", class_="lcp_catlist", id="lcp_instance_0") if not ul: return [] games = [] for li in ul.find_all("li"): a = li.find("a") if a: games.append({"title": a.text.strip(), "link": a["href"]}) return games def extract_magnet_link(link): try: res = requests.get(link, headers=headers) res.raise_for_status() except: return None soup = BeautifulSoup(res.text, "html.parser") magnet = soup.find("a", href=lambda href: href and href.startswith("magnet:")) return magnet["href"] if magnet else None def search_game(query): for page in range(1, TOTAL_PAGES + 1): games = get_game_list(page) for game in games: if query.lower() in game["title"].lower(): print(f"\nTitle : {game['title']}") print(f"Link : {game['link']}") magnet = extract_magnet_link(game["link"]) if magnet: print(f"Magnet: {magnet}") else: print("Magnet not found.") return print("Game not found.") if __name__ == "__main__": name = input("Enter game name: ").strip() search_game(name)