How iseshu/movierulz works
Project type and purpose
• This is a lightweight, single-endpoint, serverless “Movierulz Unofficial API” written in Python.
• Purpose: Expose a REST-style HTTP interface that, upon request, scrapes movierulz website pages and returns structured JSON (search results, magnet links, quality info).
File structure
• Top-level files only:
• app.py – the entire HTTP handler and scraping code.
• requirements.txt – lists Python dependencies (e.g., Flask or FastAPI, requests, BeautifulSoup).
• vercel.json – deployment config for Vercel’s serverless platform.
• README.md – project overview and usage.
• Architectural hint: single serverless function running on Vercel; no internal database; relies on external website as data source; minimal “service” boundaries.
README for additional insights
• Confirms it’s open-sourced, lightweight, supports search, returns magnet/dood links.
• No built-in cache or persistence.
• Deployed on Vercel with zero-config serverless.
a. Client / Consumer
• Origin: browser, mobile app, other servers.
• Initiates HTTP requests (e.g., GET /search?query=…).
b. API Gateway / Edge (Vercel)
• Receives incoming HTTP request.
• Invokes the serverless function defined in app.py.
c. Serverless Function (app.py)
• HTTP framework layer (Flask, FastAPI) – parses path/params, handles routing.
• Business logic layer – constructs target movierulz URL, issues HTTP requests.
• Scraper module – uses requests + BeautifulSoup (or similar) to fetch & parse HTML.
• Response builder – extracts title, magnet links, quality, dood URLs, serializes to JSON.
d. External Data Source (movierulz.com)
• Unstable HTML pages.
• No formal API; scraper must handle layout changes.
e. (Optional) CDN / Cache – if added later for rate-limiting or performance.
Architectural patterns & design principles
• Serverless microservice: single responsibility, auto-scaling, pay-per-use.
• Layered design within app.py:
• Presentation (HTTP interface)
• Application (routing & orchestration)
• Integration (HTTP client to external site)
• Parsing (HTML → JSON transformation)
• Stateless: each function invocation stands alone.