Skip to content

fix(arabic): repair dilartube search via golden.rest quick_search endpoint - #2690

Draft
RibatTRW wants to merge 1 commit into
lnreader:masterfrom
RibatTRW:fm/lnreader-dilartube-search
Draft

RibatTRW wants to merge 1 commit into
lnreader:masterfrom
RibatTRW:fm/lnreader-dilartube-search

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Fix the broken dilartube source so a reader can search it again, and include screenshots of the working fix in the PR.

plugins/arabic/dilartube.ts browses and reads fine, but its own live check fails searchNovels with Unexpected token '<', "<!DOCTYPE "... is not valid JSON, while the site itself answers normally. So the search endpoint the plugin calls now returns an HTML page instead of JSON - the plugin's search path has drifted from the site. This is one of the plugins this fleet's plugin health sweep confirmed as genuinely broken today (not a site-side block).

Make sure the fix's pull request shows a photo of the plugin working correctly inside the plugin playground, and run that screenshot process headless if possible.

What Changed

  • plugins/arabic/dilartube.ts: searchNovels now POSTs JSON to ${this.site}api/quick_search on golden.rest, the site's own search endpoint as used by its client code. The previous https://dilar.tube/api/quick_search now returns a 404 HTML page, which caused the Unexpected token '<' JSON parse error.
  • A non-array response throws the site's error message (or Unexpected search response). An empty result returns [].
  • Plugin version bumped from 1.0.2 to 1.0.3.

Risk Assessment

Medium. Search is not verified against a successful live response. golden.rest answered every POST with HTTP 503 "read-only mode" when tested (2026-10-15, about 22:00 UTC). The request body and the response shape (an array whose first element has data and releases) come from the site's client code and the plugin's previous assumptions, not from an observed successful search.

Testing

Live check, npm run check:plugin -- plugins/arabic/dilartube.ts, run on 2026-10-15 (UTC) against this commit:

Step Result
popularNovels PASS (1 novel)
searchNovels FAIL: site returned الموقع في وضع القراءة فقط. لا يمكن إجراء أي تغييرات حالياً. (HTTP 503 on POST)
parseNovel PASS (42 chapters)
parseChapter PASS (15,699 characters)

Search could not be confirmed live. golden.rest returned HTTP 503 read-only for every POST tested (quick_search and mangas/search, JSON and multipart, with browser-like headers and the CSRF token). A GET to /api/quick_search returns 500. The plugin now surfaces the site's error message instead of an HTML parse error.

To re-verify once golden.rest accepts POSTs again: run npm run check:plugin -- plugins/arabic/dilartube.ts and expect searchNovels to PASS.

Local checks on this branch: npm ci, npm run build:full (exit 0), and prettier and eslint on plugins/arabic/dilartube.ts all pass. The pipeline's Test and Lint notes below report missing dependencies and ESLint not running. Those notes do not match this branch's local runs.

Screenshots

These come from the repository's plugin playground (npm run dev:start), run headless, showing the dilar tube source. They are not screenshots of the LNReader app, because the Android toolchain is not installed here.

To reach the playground on a non-default port, its hardcoded localhost:3000 requests were rerouted in the test browser, and that browser ran with web security disabled. These are test-harness settings only, not repository changes.

  1. Popular listing, showing Silent Witch: Plugin playground: dilar tube popular listing
  2. Novel detail from Parse Novel, 42 chapters: Plugin playground: dilar tube novel detail
  3. Chapter list: Plugin playground: dilar tube chapter list
  4. Chapter text from Parse Chapter, 15,699 characters: Plugin playground: dilar tube chapter text

No search-results screenshot is included. In the playground, search returns "No results found" because golden.rest refuses the POST. The playground console shows the site's read-only error.

AI Authorship

This change was written with AI assistance (Claude). It has not been reviewed by a human maintainer.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • ⚠️ plugins/arabic/dilartube.ts:156 - The fix (POST JSON to golden.rest/api/quick_search) could not be confirmed against the live site. When I replayed it, JSON and multipart POSTs both returned HTTP 503 with {"error":"الموقع في وضع القراءة فقط..."}, which means the site is in read-only mode. A plain GET returned a 500. The plugin now throws this error message instead of an HTML parse error, which is better. But the intent requires a reader to be able to search again, and the playground screenshots must show search returning results. If POSTs are still rejected when the PR is made, the fix doesn't meet that requirement. The author should confirm the endpoint accepts this request with npm run check:plugin and in the playground. If the 503 persists, they should look for a non-POST search route or report the check as inconclusive. The JSON body shape (includes as an array) is also unverified against a successful response.
⚠️ **Test** - 2 warnings
  • ⚠️ plugins/arabic/dilartube.ts:156 - The live search endpoint golden.rest/api/quick_search currently rejects the plugin's POST with HTTP 503 (site in read-only mode), so working search results and playground screenshots could not be produced. The 503 error text is now surfaced by the plugin instead of an HTML parse error. This matches the previously declined review-1 concern; no further action requested.
  • ⚠️ live validation verdict: inconclusive (0 of 3 scenarios were driven live against the product); untested: Reader searches dilartube and gets novel results, Playground screenshot of working search, Search failure surfaces a readable error instead of an HTML/JSON parse error
  • Live validation: ⚠️ inconclusive - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Reader searches dilartube and gets novel results ⏸️ untested no The live site is in read-only mode and rejects the search POST with 503 (GET gives 500). The plugin itself was not run, and no non-POST search route was found. Retry once the site accepts POSTs again.
Playground screenshot of working search ⏸️ untested no Search cannot return results while the site returns 503, so there is nothing to show. Also node_modules is not installed in the worktree.
Search failure surfaces a readable error instead of an HTML/JSON parse error ⏸️ untested no The prior payload established this only by reading the code and the curl response, not by running the plugin, so no live result was established.
  • curl -X POST https://golden.rest/api/quick_search with the plugin's JSON body → 503 read-only error
  • curl GET https://golden.rest/api/quick_search?query=a → 500
  • curl https://golden.rest/ → 200
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 info
  • ℹ️ plugins/arabic/dilartube.ts - ESLint could not run because dependencies are not installed (Cannot find package '@eslint/js'). Prettier passed on the changed file.
✅ **Push** - passed

✅ No issues found.

The search call pointed at dilar.tube/api/quick_search, which now answers
404 with an HTML page, so JSON parsing failed. The site's own client posts
JSON to golden.rest/api/quick_search; use that same endpoint and report
non-array responses as errors instead of indexing into them.

Bump version to 1.0.3.

Live check: popularNovels, parseNovel and parseChapter pass. searchNovels
currently fails because golden.rest answers every POST with HTTP 503 and
the site's read-only message, so search is not yet verified live.
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The code changes appear safe to merge; no new actionable defect was established.

Summary

Updates dilartube search to use the plugin's existing golden.rest host.

  • Dilartube search now uses the site's JSON endpoint.

No new actionable issues were established. RibatTRW explicitly acknowledged that live search remains unconfirmed because the site rejects POST requests in read-only mode, and that working playground screenshots were not produced. RibatTRW also acknowledged the unverified request shape and missing live plugin checks.

Reviews (1) · Last reviewed commit: "fix(arabic/dilartube): search via golden..." · Reviewed by Greptile

@RibatTRW
RibatTRW marked this pull request as draft October 16, 2026 12:54
@RibatTRW

Copy link
Copy Markdown
Contributor Author

Converting to draft for now: dilartube's golden.rest backend is currently in read-only mode and rejects the search request with "الموقع في وضع القراءة فقط" (site is read-only), so the Plugin Live Check fails on searchNovels and the new search path cannot be verified live. Browse and read are unaffected. I'll re-run the live check and mark this ready once the site leaves read-only mode.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant