96 Commits
Author SHA1 Message Date
tiennm99 4107167b03 docs: index merged crawlers and point their module paths at mttools 2026-10-03 11:16:25 +07:00
tiennm99 c1db9e937f Revert "Merge branch 'feature/circular-dependency-checker-go' into main"
Keeps the branch in history only; main's content is unchanged.
2026-09-30 20:04:14 +07:00
tiennm99 8706e89d75 Merge branch 'feature/circular-dependency-checker-go' into main 2026-09-30 20:04:14 +07:00
tiennm99 fbc08a2435 Revert "Merge branch 'feature/export-chrome-cookies-go' into main"
Keeps the branch in history only; main's content is unchanged.
2026-09-30 20:04:13 +07:00
tiennm99 0693cb3724 Merge branch 'feature/export-chrome-cookies-go' into main 2026-09-30 20:04:13 +07:00
tiennm99 52ee8efa9e Revert "Merge branch 'feature/bulk-telegram-sticker-go' into main"
Keeps the branch in history only; main's content is unchanged.
2026-09-30 20:04:13 +07:00
tiennm99 e53b60772c Merge branch 'feature/bulk-telegram-sticker-go' into main 2026-09-30 20:04:13 +07:00
tiennm99 72d58b61ec docs: index merged tools and point their module paths and links at mttools 2026-09-30 17:10:08 +07:00
tiennm99 428e7c2ab6 chore: use mttools module paths and in-repo links for merged tools 2026-09-30 16:55:07 +07:00
tiennm99 a912c7e084 docs: require Go 1.25 to match go.mod 2026-08-31 15:25:31 +07:00
tiennm99 d17a79445f feat(pdf): export a novel as a phone-readable PDF
Add a pdfout package that renders the fetched chapters to a single PDF
and an export package holding the whole pipeline, so the CLI and an
embedding program share one code path and reject the same inputs.

The default page is 90x160mm rather than A4 with large type: a viewer
scales a whole page to fit the screen, so on a phone the page shape
decides legibility and a wide page just gets shrunk.

Embed DejaVu Sans in the binary. Vietnamese needs the Latin Extended
Additional block, and a headless host often has no fonts installed at
all, so rendering must not depend on finding one. An explicitly named
font is never silently substituted. Font data is passed as bytes because
fpdf resolves a font path against its own font directory.

Keep the original per-chapter text output available behind -txt.
2026-08-24 20:40:01 +07:00
tiennm99 ad8d2649c1 refactor!: generalise single-novel script into a hako library
The crawler took one hardcoded novel URL, wrote per-chapter text files
into ./data, and fetched serially until the site answered 429.

Rename the module to hako-crawler and split fetching, page parsing and
crawl orchestration into a hako package that takes any novel URL.

The chapter body is no longer served as markup: #chapter-content now
carries a shuffled, XOR-obfuscated payload that the site's own script
expands in the browser, so the previous p[id=<digits>] extractor
returned nothing at all. Decode it, keeping the plain-markup path as a
fallback. The scheme is read from the page and an unrecognised one is a
hard error, because the alternative is exporting a book of mojibake.

Space requests globally instead of per-goroutine, so concurrency no
longer raises the request rate, and retry only what a retry can fix.
Cache raw pages so re-runs cost no requests.

BREAKING CHANGE: module path is now github.com/tiennm99/hako-crawler,
and the novel URL is a required argument rather than a constant.
2026-08-24 20:39:50 +07:00
tiennm99 c5a0487cf3 docs: index image-resizer and webp-converter in the root README 2026-08-18 10:57:29 +07:00
tiennm99 c4668491fa chore: stop tracking the installed dependency tree
Nodejs/node_modules was committed (4,275 files), which is also how three
upstream yarn.lock files ended up in the repository. package-lock.json already
pins everything, and all five dependencies still resolve from the registry, so
the tree is reproducible with npm ci and does not need to be stored here.

Add a .gitignore; the repository had none.
2026-08-17 16:58:56 +07:00
tiennm99 f4d5cb66be docs: index the merged tools in the root README 2026-08-13 11:36:49 +07:00
tiennm99 8bca548fcd Initial commit 2026-08-11 14:06:57 +07:00
tiennm99 c1ea1876bb feat: parse novel tags and add a single-request metadata fetch
Novel gains Tags, read from the anchors carrying schema.org itemprop="genre".
Matching that microdata rather than the /the-loai/ href shape is what keeps the
site-wide genre navigation out: a sampled page links 69 categories against the
novel's own 6.

NovelInfo fetches just the landing page and parses it, so a caller that only
wants metadata pays one request instead of the two Novel needs for its chapter
list cross-check.
2026-07-30 00:45:20 +07:00
tiennm99 79cf77a471 feat: lower the default body font size to 10pt
On the default 90x160mm phone page, 12pt fits about 36 characters per line;
10pt fits about 43 across 26 lines, which reads denser without becoming small
on a phone at 100% zoom. -font-size still overrides it.
2026-07-30 00:10:20 +07:00
tiennm99 177c4b9a33 fix: embed font data instead of a path, and bundle a fallback font
PDF rendering failed on Linux with "stat usr/share/fonts/...: no such file or
directory": fpdf joins the font path onto its own font directory, which it
defaults to ".", so path.Join turns an absolute path into a
working-directory-relative one. It only resolved when the process happened to
run from the filesystem root, which is why Windows was unaffected. Font data is
now read by pdfout and handed over as bytes.

LoadFont also falls back to a bundled DejaVu Sans, so a host with no fonts
installed still renders. An explicitly requested font remains a hard error when
unreadable rather than being silently substituted. Tests verify the bundled font
parses and covers Vietnamese, which is the reason it exists.
2026-07-29 23:41:30 +07:00
tiennm99 3633e96cf5 refactor: make crawler importable and add export pipeline
Move monkeyd and pdfout out of internal/ so other modules can import them,
and add export.Export, which holds the crawl-to-PDF sequence the CLI used to
inline. The CLI now parses flags and delegates, so an embedding program gets
the same defaults and validation.
2026-07-29 22:49:30 +07:00
tiennm99 2855ce5e53 fix: drop sponsor, watermark and navigation blocks from chapter text
Three blocks the site injects inside the chapter body were being extracted
as prose: the sponsor block, a source watermark planted mid-chapter, and
the prev/next chapter links.

Anchors and images are now skipped, since inside a chapter body they are
always site chrome, and the sponsor wrapper and watermark are skipped by
class. Inline emphasis tags are left alone so italics in the prose survive.

The sponsor wrapper has a sibling that must NOT be skipped: on most
chapters the real text sits in a container hidden with display:none,
because the body is gated behind a click on the sponsor link and revealed
with JavaScript. Skipping hidden elements, or treating the two sibling
classes as one family, discards the entire chapter. A test pins the gated
body as kept while its sibling is dropped.

Removes 662 words of injected text across the sample novel and lets the
repeated chapter-number paragraph be recognised again, which the sponsor
block had been masking by displacing it from the top of the body.
2026-07-29 22:36:15 +07:00
tiennm99 6bcdd742d6 feat: add monkeydd novel crawler with phone-sized PDF export
Fetches every chapter of a monkeydd.com novel and renders it as a single
PDF laid out for reading on a phone.

Two site behaviours drive the extractor design:

- Roughly a fifth of each chapter's words are not in the markup. The page
  emits empty spans and supplies the word from the stylesheet via
  ":before { content: ... }" rules, so reading DOM text alone drops them
  with no error. The extractor resolves those rules and substitutes the
  words back; a test asserts they disappear when the rule is removed.
- Chapter URLs cannot be generated. Numbering has gaps and slugs are not
  uniform across novels, so chapter links are always parsed from the page.

The chapter list is read from the landing page and cross-checked against
the dropdown embedded in each chapter page, so a truncated list cannot
silently shorten the export.

PDF defaults to a 90x160mm page rather than A4 with large type: viewers
scale a whole page to fit the screen, so a phone-shaped page fills it at
100% zoom where 12pt stays comfortable. A5 and A4 remain available.

Requests are spaced globally, so raising worker count does not raise the
request rate. Raw pages cache to disk so re-exporting at different font
or page settings needs no network.
2026-07-29 22:26:25 +07:00
tiennm99 9a1b3a43b0 Initial commit 2026-07-29 21:50:24 +07:00
tiennm99 fb0964bb6e feat: replace Python and JS downloaders with a Go crawler
Port both scripts into one Go program with a command per behavior:
gallery walks the numbered ghibli.jp film galleries, scrape downloads
every image referenced by a page.

Downloads now run through a bounded worker pool, and non-200 responses
are no longer written to disk as image files. Drop the orphaned
package-lock.json, which pinned the deprecated request dependency and
was the source of the repository's Dependabot alerts.
2026-07-25 19:41:43 +07:00
tiennm99 07b6b84151 docs(readme): rename project to ghibli-gallery-crawler 2026-07-25 19:28:02 +07:00
tiennm99 3b233d6948 chore: remove dependabot version-update config 2026-07-25 14:14:52 +07:00
tiennm99 9e8f8f5d40 chore: remove dependabot version-update config 2026-07-25 14:13:41 +07:00
tiennm99 2af7523d6d fix(deps): bump golang.org/x/net to patch security advisories 2026-07-17 17:42:06 +07:00
tiennm99 a7d0af64e4 fix(deps): bump golang.org/x/net to patch HTML parser DoS advisory 2026-07-17 17:20:38 +07:00
tiennm99 6fd81dba0f fix(deps): bump golang.org/x/image to patch tiff DoS advisory 2026-07-17 17:19:33 +07:00
tiennm99 1942082c63 fix(deps): bump golang.org/x/image to patch tiff DoS advisory 2026-07-17 17:19:25 +07:00
tiennm99 5b319327b8 chore: drop inapplicable dependabot ecosystems (#2) 2026-05-23 11:09:24 +07:00
tiennm99 82c9c67f7c chore: drop inapplicable dependabot ecosystems (#8) 2026-05-23 11:09:21 +07:00
tiennm99 ed1cdcc790 chore: add dependabot config (#6) 2026-05-23 10:48:33 +07:00
tiennm99 a3827c9e9e chore: add dependabot config (#1) 2026-05-23 10:48:19 +07:00
tiennm99 2e90e684e8 docs(readme): correct to HTTP microservice, add usage, output formats, related link 2026-05-11 21:47:35 +07:00
tiennm99 8b3f2fb145 docs(readme): add scripts index table at top 2026-05-11 21:47:26 +07:00
tiennm99 61f79ddbe3 docs(readme): add sample output and Godot bad-address-index context 2026-05-11 21:45:55 +07:00
tiennm99 8e22bfcbcf docs(readme): add formats table, aspect-ratio note, example, related link 2026-05-11 21:42:52 +07:00
tiennm99 0f2468a467 docs(readme): add output format, Chrome v10+ encryption details 2026-05-11 21:42:43 +07:00
tiennm99 9bcb92fad1 docs(readme): add input format, output behavior, and variant notes 2026-05-11 21:42:38 +07:00
tiennm99 beb4e2f916 docs: expand README — config schema, output format, error handling 2026-05-11 20:44:47 +07:00
tiennm99 17870aa1e6 docs: flesh out README 2026-05-11 20:15:37 +07:00
tiennm99 c09329a0a7 docs: flesh out README 2026-05-11 20:15:17 +07:00
tiennm99 936ec7929e docs: flesh out README 2026-05-11 20:14:50 +07:00
tiennm99 bf010e0f01 docs: flesh out README 2026-05-11 20:14:43 +07:00
tiennm99 cca8081e56 chore: relicense from MIT to Apache-2.0 (sole-author repo) 2026-05-11 17:15:43 +07:00
tiennm99 9e30ba7c64 docs: add README 2026-05-11 17:04:20 +07:00
tiennm99 36a35bcc79 docs: add README 2026-05-11 17:04:19 +07:00
tiennm99 29e254f1bc chore: add Apache-2.0 license 2026-04-29 21:33:48 +07:00
tiennm99 0be94abc75 refactor: rename to gitea-delete-orgs and delete orgs instead of leaving
Use DELETE /api/v1/orgs/{org} to fully delete organizations
rather than just removing the user as a member.
2026-04-13 09:41:06 +07:00
tiennm99 2d4f257a23 feat: auto-load .env via shared internal/env package
Add godotenv dependency and internal/env init loader so all cmd/
scripts get .env vars loaded automatically via blank import.
2026-04-13 09:13:24 +07:00
tiennm99 b7ac3e2074 add Claude Code settings with gopls LSP plugin 2026-04-13 09:04:58 +07:00
tiennm99 e0640ca840 feat: add gitea-leave-orgs script and init Go module
Add cmd/ structure for multiple standalone scripts. First script
leaves all joined Gitea orgs except a configurable keep-list.
2026-04-13 08:54:20 +07:00
tiennm99 de8339b5b7 Initial commit 2026-04-13 08:46:31 +07:00
tiennm99 e410b3bde8 feat: convert to go 2026-01-30 10:40:19 +07:00
tiennm99 f171050906 Update .gitignore 2026-01-30 10:31:24 +07:00
tiennm99 af02abceeb feat: init 2026-01-30 10:30:21 +07:00
tiennm99 f6174317fd chore: migrate 2025-12-21 10:16:18 +07:00
tiennm99 8f70921fcb Update README.md 2025-12-21 08:59:46 +07:00
tiennm99 0cc7463f3c feat: init 2025-12-05 15:11:45 +07:00
tiennm99 aa26dd0cb9 feat(go): update desc 2025-11-30 21:36:32 +07:00
tiennm99 bdb8909f01 feat(go): update deps 2025-11-30 20:57:33 +07:00
tiennm99 33e58f2511 feat(go): rewrite in go 2025-11-30 20:52:54 +07:00
tiennm99 f2b2cb33c5 feat(go): rewrite in Go 2025-11-30 20:22:58 +07:00
tiennm99 7f4205a3ba Update README.md 2025-11-29 13:19:06 +07:00
tiennm99 637bdb1fcf feat: add note 2025-11-29 13:11:13 +07:00
tiennm99 1f97934131 feat(go): convert to Go 2025-11-29 13:00:05 +07:00
tiennm99 62d3dc60b9 Update .gitignore 2025-11-28 22:20:47 +07:00
tiennm99 293dd7a731 Update main.go 2025-11-28 22:05:06 +07:00
tiennm99 abde6a380f feat(go): rewrite in Go 2025-11-28 21:52:05 +07:00
tiennm99 b38a3cc531 Update README.md 2025-11-28 21:50:47 +07:00
tiennm99 e004d7237d feat(go): rewrite in Go 2025-11-28 20:59:16 +07:00
tiennm99 6f854c6cd7 feat: only save content 2025-08-26 19:51:30 +07:00
tiennm99 ae05d5548e feat: simple version 2025-08-25 21:24:27 +07:00
tiennm99 2fe9268287 feat: init 2025-08-25 20:29:06 +07:00
tiennm99 04c6182984 Update main.py 2025-07-20 18:59:06 +07:00
tiennm99 871a31f564 feat: init 2025-03-28 20:35:09 +07:00
tiennm99 113f5d7ff3 feat: join.bat 2025-03-25 19:01:31 +07:00
tiennm99 29feea38c8 [Init] 2024-10-11 21:03:49 +07:00
tiennm99 befceed53e Update main.sh 2024-05-22 21:04:10 +07:00
tiennm99 a25de1de5b Update main.sh 2024-05-22 21:00:16 +07:00
tiennm99 2426badf69 Update main.sh 2024-05-22 20:46:10 +07:00
tiennm99 d84260a30b Update main.sh 2024-05-22 20:41:51 +07:00
tiennm99 f06ceb9c5d Update main.sh 2024-05-22 20:25:33 +07:00
tiennm99 f5f2cafba7 [Add] init 2024-05-22 20:19:26 +07:00
tiennm99 14128aa4b4 Update main.py 2024-04-04 14:00:40 +07:00
tiennm99 c8866b6d5c Create requirements.txt 2024-04-04 13:40:07 +07:00
tiennm99 ffdba21976 Update main.py 2024-04-04 13:39:28 +07:00
tiennm99 97213b87fc [Temp] stash 2024-04-04 13:35:33 +07:00
tiennm99 3706327204 [Temp] stash 2024-04-03 18:53:17 +07:00
tiennm99 29115d698d Initial commit 2024-04-03 18:07:53 +07:00
tiennm99 ad745efcb6 [Init] 2023-09-27 23:06:47 +07:00
tiennm99 b0dfc8162c Create circular_dependency_checker.py 2023-07-28 18:21:29 +07:00
tiennm99 7c45c1f87c Initial commit 2023-07-28 18:20:28 +07:00
tiennm99 6ba2247509 Init 2020-03-02 14:53:23 +07:00