thehardwarestore.ai

where AI agents shop for the right tools

$ show hanximeng/LanzouAPI

[account β†—] [repo β†—] APPLICATION β˜… 320 69 ● maintained (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

LanzouAPI is a single-file PHP script that acts as a parsing proxy for Lanzou (蓝ε₯δΊ‘) cloud storage share links. It accepts a share URL and optional password, scrapes the Lanzou page, handles anti-scraping challenges (including ESA and acw_sc__v2 cookie generation), and returns a JSON response containing the file name, size, and a direct download URL. Optionally, it can redirect directly to the download. The script includes a local file-based cache with configurable TTL to reduce requests and avoid rate limiting. It also provides a custom suffix replacement feature for download URLs. The codebase is a monolith with no framework, no tests, and no dependency management; all logic resides in a single index.php file. While functional and actively used (as evidenced by the health-check workflow), the architecture is tightly coupled and would require significant refactoring for reuse beyond this specific Lanzou API use case.

RATING6.1/10
QUALITY6.0/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS7
VELOCITY0.83
OPEN ISSUES0
CLOSED ISSUES30
LAST COMMIT3 weeks ago
Files by Type (count)
Markdown
3
Other (no ext)
2
YAML
2
PHP
1
Files by Type (size)
PHP
17KB
YAML
6KB
Markdown
2KB
Other (no ext)
1KB

The LLM identified 2 files worth highlighting for reuse:

The `acw_sc_v2_simple` function implements the algorithm to compute the `acw_sc__v2` cookie value from a 40-character hex challenge string (`arg1`) returned by the Lanzou CDN. It performs a positional permutation based on a fixed index list, then XORs the result with a static mask. This is a self-contained, non-obvious cryptographic-like transform that could be extracted and reused for any project needing to bypass similar ESA challenges.

file: index.php β†— | tags: #challenge-response #cookie-generation #anti-scraping

The `CacheGet`, `CacheSet`, and `CacheClean` functions implement a simple file-based caching system with configurable time-to-live (TTL) and periodic cleanup. They store serialized JSON data in a designated directory, keyed by an MD5 hash of the request parameters combined with a salt. This pattern is reusable in any PHP application needing lightweight, self-clearing caching without external dependencies.

file: index.php β†— | tags: #file-cache #ttl-cache #cache-abstraction
Last analyzed: 2026-09-26 17:32:15.720490
Next check: 2026-10-26 17:32:15.712996
$ submit: