feat(wps-pdf): add convert command (WPS PDF / pdf.wps.cn document format conversion)#2029
Open
hzgfly-ai wants to merge 1 commit into
Open
feat(wps-pdf): add convert command (WPS PDF / pdf.wps.cn document format conversion)#2029hzgfly-ai wants to merge 1 commit into
hzgfly-ai wants to merge 1 commit into
Conversation
WPS PDF online document format conversion (pdf.wps.cn) — PDF <-> Word/ Excel/PPT, image <-> document, plus PDF operations (split/encrypt/ watermark/...), reusing the browser's existing WPS membership session. - Strategy.COOKIE + browser:true: the wps_sid auth cookie is HTTP-Only, so only the browser page context can attach it; the conversion flow runs inside page.evaluate against pdf.wps.cn's same-origin APIs. - Does NOT crack signing: request signatures are computed by WPS's own /api/v1/sign endpoint; the adapter only reproduces the exact request fields. Stable across signing-algorithm changes. - 36 conversion directions, end-to-end verified. Full reverse-engineering notes / self-repair map: https://github.com/hzgfly-ai/wps-convert
dc2e22a to
0c1ff64
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new site adapter:
wps-pdf convert— WPS PDF online document format conversion (thepdf.wps.cnsubsite, not the WPS main site). Despite the "pdf" in the domain, this service handles PDF ↔ Word/Excel/PPT, image ↔ document, plus PDF operations (split / encrypt / watermark / ...). It reuses the user's existing logged-in WPS membership session.36 conversion directions, end-to-end verified.
How
Strategy.COOKIE+browser: true. Thewps_sidauth cookie is HTTP-Only, so only the browser page context can attach it. The whole flow (upload → sign → commit → poll → download) runs insidepage.evaluateagainstpdf.wps.cn's same-origin APIs./api/v1/signendpoint; the adapter only reproduces the exact request fields. This stays stable even if WPS changes its signing algorithm — and keeps the approach session-reuse, not a bypass of access control.@jackwener/opencli/registry+@jackwener/opencli/errorsonly. Known failures throw typed errors (ArgumentError/AuthRequiredError/CommandExecutionError).Checks
npm run build→ manifest regenerated (wps-pdf convertregistered)npx tsc --noEmit→ passopencli validate→ PASS, 0 errors / 0 warnings forwps-pdfReference
Full reverse-engineering notes & self-repair map (what to re-reverse when WPS changes its frontend): https://github.com/hzgfly-ai/wps-convert