import requests from bs4 import BeautifulSoup import time MXDROP_PREFIX = "https://mxdrop.to/e/" def build_session(): s = requests.Session() s.headers.update({ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.9", "Connection": "keep-alive", }) return s def fetch_video_links(session, page_url, base_domain="https://striphub.cam"): """Collect /play/ links from one paginated list page.""" try: r = session.get(page_url, timeout=10) r.raise_for_status() except requests.RequestException as e: print(f"āŒ {page_url} failed: {e}") return [] soup = BeautifulSoup(r.text, "html.parser") links = [] for a in soup.find_all("a", href=True): if a["href"].startswith("/play/"): links.append(base_domain + a["href"]) print(f"āœ… {page_url}: {len(links)} /play/ links") return links def extract_iframe_links(session, play_url): """Open a /play/ page and collect all