Skip to content

feat: Google Drive downloads and JSON-embedded media scanning#17

Merged
xAlcahest merged 1 commit into
masterfrom
feat/json-embedded-media
Jun 20, 2026
Merged

feat: Google Drive downloads and JSON-embedded media scanning#17
xAlcahest merged 1 commit into
masterfrom
feat/json-embedded-media

Conversation

@xAlcahest

Copy link
Copy Markdown
Contributor

Summary

flux <google-drive-link> now downloads public Drive files directly: the bare link is rewritten to the drive.usercontent.google.com/download endpoint, which serves the file with HTTP range support, so flux's multi-connection accelerator applies (it bypasses Drive's per-connection throttle, ~190x with -n 16) and names the file from Content-Disposition. The page scanner also recognises Drive open?id=/file/d/ links and, when a page lists several, emits a list config that resolves each to its download URL. Separately, sites that embed episode media as escaped JSON in an HTML attribute (AnimeUnity-style: &quot; quotes, \/ slashes) now scan correctly: extractor_resolve_url un-escapes \/, the media-URL capture stops at &quot; in the path, and a media-list series emits a list over the embedded URLs.

This also fixes a series-ordering regression (the episode sort no longer reads digits out of opaque episode ids, so AnimeWorld keeps page order while kissanime /episode-N/ sorts 1..N), stops a no-media skeleton from being stashed as an unparseable --save-config, and updates configure.ac for gettext >= 0.20 so the project builds on current systems.

Changes

  • src/scan.c: recognise Google Drive media links and emit a GDrive list config matching the page's open?id= or file/d/ form; detect a media-list series from direct candidates; un-escape JSON in captured URLs; stop the catch-all media capture at &quot; in the path while keeping multi-param query strings; skip and cap the size-probe so scans stay fast.
  • src/extractor.c: extractor_resolve_url un-escapes JSON \/ so escaped absolute URLs resolve.
  • src/text.c: gdrive_normalize() rewrites a bare Drive link to its direct-download URL on the download paths; send a browser User-Agent for Drive unless -U was given; episode_number() recognises only episode/ep tokens and numeric segments (opaque ids ignored); a pure no-media skeleton is no longer stashed for --save-config.
  • src/scan.h, src/conf.h: media-list series fields; ua_explicit flag.
  • src/test_scan.c, src/test_extractor.c: AnimeUnity, GDrive (open?id= and file/d/), signed-URL, episode-order, and gdrive_normalize cases.
  • configure.ac: AM_GNU_GETTEXT_VERSION -> AM_GNU_GETTEXT_REQUIRE_VERSION([0.21]).

@xAlcahest xAlcahest merged commit 084a15e into master Jun 20, 2026
5 checks passed
@xAlcahest xAlcahest deleted the feat/json-embedded-media branch June 20, 2026 09:24
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