All Ullu — Web Series Name ((better))

| Step | Action | |------|--------| | 1 | Load the public Ullu catalogue page(s) (the site lists series in a paginated grid). | | 2 | Parse the HTML to extract the title of each series. | | 3 | Follow the “next‑page” link automatically until no more pages exist. | | 4 | Return a unique, alphabetically‑sorted list of every series name. | | 5 | (Optional) Cache the result locally for ⚡ fast subsequent runs. | Why this is useful – You can use the list for: • Building a personal watch‑list UI. • Feeding a recommendation‑engine. • Simple analytics (e.g., count of series per genre). • Exporting to CSV/JSON for downstream processing. 2️⃣ Implementation – Python 3.x (≈ 40 LOC) Dependencies – requests , beautifulsoup4 , lxml (for speed). Install with:

HEADERS = "User-Agent": ( "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " "AppleWebKit/537.36 (KHTML, like Gecko) " "Chrome/124.0 Safari/537.36" ) all ullu web series name

# -------------------------------------------------------------- # CORE LOGIC # -------------------------------------------------------------- def _load_cache() -> List[str] | None: """Return cached titles if file exists and is fresh, else None.""" if not CACHE_FILE.is_file(): return None mtime = CACHE_FILE.stat().st_mtime if time.time() - mtime > CACHE_TTL_SECONDS: return None try: return json.loads(CACHE_FILE.read_text(encoding="utf-8")) except Exception: return None | Step | Action | |------|--------| | 1

import json import os import time from pathlib import Path from typing import List, Set | | 4 | Return a unique, alphabetically‑sorted

# Each card looks like <div class="show-card"> … <h3 class="title">XYZ</h3> … for h3 in soup.select("h3.title"): title = h3.get_text(strip=True) if title: titles.add(title)

# -------------------------------------------------------------- # CONFIGURATION # -------------------------------------------------------------- BASE_URL = "https://www.ullu.com" # The catalogue page that shows the series grid. (as of 2024‑06) CATALOGUE_PATH = "/tv-shows" # Where to store a simple JSON cache (optional but recommended) CACHE_FILE = Path(__file__).with_name("ullu_series_cache.json") CACHE_TTL_SECONDS = 24 * 3600 # 1 day

def _next_page_url(html: str) -> str | None: """ Detect the URL of the “next” pagination link. Returns None when we’re on the last page. """ soup = BeautifulSoup(html, "lxml") nxt = soup.select_one("a[rel='next'], li.next > a") if nxt and nxt.get("href"): # Some links are relative – turn them into absolute URLs. return requests.compat.urljoin(BASE_URL, nxt["href"]) return None