cineru-scrapper
v0.1.0
Published
Cineru.lk scrapper — lightweight Sinhala subtitle & movie download-link scraper (search, details, subtitle zips, quality tiers, host links, token → real URL resolution). Built by Dew Coders.
Maintainers
Readme
cineru-scrapper
Cineru.lk movie scrapper — search Sinhala subtitle movies, pull full details,
subtitle zips, every quality tier's host links, and resolve dl.cineru.lk
token URLs into the real file links (Google Drive, Mega, Pixeldrain, …).
Zero browser dependencies.
🔍 Built for cineru.lk's actual stack: the site exposes a clean JSON search endpoint (
admin-ajax.php?action=cineru_search) and plain WordPress HTML for detail pages. No puppeteer, no stealth plugins, no headless Chrome needed.🏗️ Built by Hansa Dewmina — Dew Coders
Install
npm install cineru-scrapper
# or clone & link locally:
npm install
npm linkRequires Node >= 18 (uses built-in fetch).
Usage (API)
const { cineru } = require('cineru-scrapper');
// 1) Search (site's own JSON search engine — fast, paginated)
const res = await cineru.search('avatar', { page: 1, limit: 12 });
console.log(res);
// { query, page, totalPages, results: [{ id, title, source, link }] }
// 2) Legacy HTML search (richer: includes image + date + categories)
const res2 = await cineru.searchLegacy('avatar', { page: 2 });
// 3) Full movie details
const details = await cineru.getDetails('https://cineru.lk/?p=81540');
// { title, image, date, categories, description,
// links: { trailer, imdb, wikipedia }, download: { tokenUrl, postId }, url }
// 4) Subtitle download link (resolves filename via HEAD on dl.cineru.lk)
const dl = await cineru.getDownloadLink(81540);
// { tokenUrl, postId, filename, contentType, size }
// 5) Full download panel — every quality tier + host links + stream URLs
const downloads = await cineru.getDownloads(81540);
// {
// postId: 81540,
// videoCopy: [{ quality: "WEBRip|1080p|X264|3.8 GB", links: [{ host, type, url }] }],
// hcVideoCopy: [{ quality: "WEBRip|480p|X264|400 MB", links: [...] }],
// watchOnline: { '720p': "https://bot.cinerustreams.com/..." }
// }
// 6) Resolve token URLs into the REAL file links (Google Drive, Mega, …)
// Each `dl.cineru.lk/dl.php?token=...` answers with a 302 → Location.
// Tokens are single-use — resolve right after fetching.
const resolved = await cineru.getDownloads(81540, { resolve: true });
// links now also carry `resolvedUrl` (e.g. https://drive.google.com/file/...)
// and `resolvedHost` (e.g. "drive.google.com", "mega.nz", "pixeldrain.com").
// …or resolve a single token directly:
const file = await cineru.resolveDownloadUrl('https://dl.cineru.lk/dl.php?token=...');
// { url: "https://drive.google.com/file/d/.../view?usp=sharing", host: "drive.google.com" }Search options
| Option | Default | Description |
| -------- | ---------- | --------------------------------------------- |
| page | 1 | Page number |
| limit | 12 | Results per page (AJAX search only) |
| source | 'cineru' | 'cineru', 'sub', or '' for both sites |
Usage (CLI)
The CLI is fully interactive in a terminal — search results render as
colored tables, then let you pick a movie, browse its details, copy or resolve
links, and even stream a file straight to disk with a live progress bar.
Every command also accepts --json for scripting.
# Interactive (default): table → movie picker → details/downloads menu
cineru-scrapper search "avatar"
# Non-interactive / scriptable
cineru-scrapper search "avatar" --json
cineru-scrapper search "avatar" --limit 6 --page 2
cineru-scrapper search-legacy "avatar" --page 2
cineru-scrapper details https://cineru.lk/?p=81540
cineru-scrapper downloads 81540 --resolve
cineru-scrapper get 81540 --quality "1080p" --host mega # download to disk
cineru-scrapper get 81540 # interactive picker
cineru-scrapper resolve "https://dl.cineru.lk/dl.php?token=..."
cineru-scrapper config --set downloadDir ~/Movies # persist defaultsCommands
| Command | What it does |
| ---------------- | ------------------------------------------------------------------- |
| search | Search; interactive table + movie picker, or --json for scripts |
| search-legacy | Classic WordPress search page (richer fields) |
| details | Full movie info (image, date, categories, description, links) |
| downloads | Every quality tier + host link, optional --resolve |
| get | Download the movie file to disk (interactive picker / flags) |
| resolve | Turn one dl.cineru.lk token URL into the real file link |
| config | Show / persist settings (--set key value)
Config
Settings are persisted to ~/.cineru-scrapper.json:
cineru-scrapper config # show current settings
cineru-scrapper config --set downloadDir ~/Movies
cineru-scrapper config --set concurrency 8| Key | Default | Used by |
| ------------- | ------------ | ----------------------------------------- |
| downloadDir | downloads | get command output folder |
| concurrency | 5 | token resolution in downloads --resolve |
| source | cineru | search |
| limit | 12 | search |
Example output
$ cineru-scrapper search "joker"
Search results — "joker" (page 1/1)
┌────┬──────────────────────────────────────────┬───────┬────────┐
│ # │ Title │ ID │ Source │
├────┼──────────────────────────────────────────┼───────┼────────┤
│ 1 │ Joker (2019) Sinhala Subtitles | … │ 4605 │ cineru │
│ 2 │ Joker: Folie à Deux (2025) … │ 75879 │ cineru │
└────┴──────────────────────────────────────────┴───────┴────────┘
2 result(s) · use --json for raw output
$ cineru-scrapper search "joker" --json
{
"query": "joker",
"page": 1,
"totalPages": 1,
"results": [ { "id": 4605, "title": "Joker (2019) …", "source": "cineru", "link": "https://cineru.lk/?p=4605" } ]
}How it works
- Search hits
https://cineru.lk/wp-admin/admin-ajax.php?action=cineru_searchwithq,page,limit,sourceparams → clean JSON, paginated. - Legacy search parses the classic
/?s=WordPress page (article.item-list). - Details fetches the post page and extracts the OpenGraph image, metadata,
categories, description, trailer/IMDb/Wikipedia links, and the subtitle
download token (
data-linkon#btn-download). - Download does a HEAD request on the
dl.cineru.lktoken URL to discover the real filename / content type / size. - Downloads calls the site's own
cs_download_dataAJAX endpoint (which the page normally loads into#down_mount) and parses every quality tier (videoCopy/hcVideoCopy) with per-host links (UserDrive, GDrive, Mega, Telegram, Pixeldrain, …) plus the watch-online stream URLs. - Resolve follows each
dl.cineru.lktoken's 302 redirect (withredirect: 'manual'so tokens aren't wasted following to a 403 page) and returns the real file URL — Google Drive, Mega, Pixeldrain, UsersDrive, Filespayouts, Telegram, etc. Pass{ resolve: true }togetDownloads()to enrich every link withresolvedUrl/resolvedHost.
Notes & limitations
- The site's WP REST API (
/wp-json/...) is Cloudflare-blocked — this module deliberately avoids it. dl.cineru.lktokens are single-use: a token can only be resolved once, and the panel regenerates fresh tokens on every page/endpoint call. Always resolve tokens from the samegetDownloads()result you intend to use.- Movie detail content (the subtitle download button) is behind a login wall
on some posts; the download
tokenUrlis still embedded in the page HTML for most public posts. - Respect the site's ToS and robots.txt. Scrape responsibly and rate-limit your own usage.
Roadmap
- [x] cineru.lk search + details + download links
- [x] cineru.lk full download panel (qualities, hosts, watch-online)
- [x] token → real file URL resolution (Google Drive, Mega, …)
- [x] interactive CLI UI (tables, pickers, download progress)
- [ ] sub.lk (cross-site source already returned by the search engine)
- [ ] More Sinhala subtitle sites
- [ ] Optional caching layer
Credits
Created by Hansa Dewmina for Dew Coders.
License
MIT
