HLCode Miniprogram PDF Download
Paste the following prompt into your AI chat to install this skill:
Please install @user_f8d71ee8/miniprogram-pdf-download according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem Context
Some WeChat miniprograms only allow PDF preview and do not expose a direct download button, such as file preview pages from HLCode / hlcode.cn. Engineers may have only a #miniprogram://... protocol link or a long preview.hlcode.cn URL. In a browser, the page can render the document but not reliably return the original file, while manual packet capture can miss key parameters.
How It Works
The skill turns “preview page to downloadable file” into explicit steps: identify the link type, extract parameters such as id, name, type, and time, call the backend API to obtain the real download URL, then download and validate the file.
- Preferred input: an H5 preview URL like https://preview.hlcode.cn/?....
- Miniprogram link: #miniprogram://HLCode/xxx must be converted to an H5 link or captured from the preview request.
- Key call: use id to request POST /qruser/file/get_url_byid, then read data.url.
- Validation: check file size, Content-Type as application/pdf, and the %PDF- magic bytes.
- Scope: the same flow can be used when type is word, excel, or ppt.
Boundaries
This flow targets HLCode miniprogram file downloads and is not a general miniprogram decompiler. The time parameter may expire, but the API call usually depends on a valid id. If the response is HTML, code: 1, or code: 500, re-check the link, file status, or parameter extraction. URL-encoded Chinese file names must be decoded before display.
Use Cases
- A QR-code preview page in a browser has no download button, and the original PDF must be retrieved.
- Only a WeChat miniprogram link is available, so the H5 preview URL must be obtained before extraction.
- A preview.hlcode.cn link is shared, requiring id, time, and name parsing plus API-based download.
- A previewed Word, Excel, or PPT file must be downloaded and validated by file type.
Best For
- Customer-support engineers handling WeChat file shares who need preview-only PDFs saved locally.
- QA engineers collecting reference documents who need stable downloads from HLCode preview links.
- Automation engineers maintaining download scripts who need the preview-link-to-real-URL API flow.
- SREs troubleshooting document retrieval who need to verify API codes, Content-Type, and PDF magic bytes.
Related Skills
Fetches Baidu Hot Search Top 10 titles using web_fetch first, validates same-day data, and falls back to browser automation when stale.
Generates an evening A-share policy and trading opportunity daily report by collecting same-day index, policy, and capital data, then applying a fixed template to highlight beneficiary sectors, drivers, and price directions.
Maps natural-language TikTok requests to KeyAPI REST scenarios, validates endpoints against docs, and executes data queries and analysis.
Extract city-specified AI jobs from BOSS Zhipin, save CSV/table data, mark new postings, and summarize salary trends, application advice, and HTML reports.