Repository navigation
fix(english/ao3): scope byline, stats and summary, classify failures #2958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # AO3 fixtures | ||
|
|
||
| Real pages saved from `archiveofourown.org` on 2026-12-02, used by | ||
| `scripts/test-ao3.js`. They are captured **as a guest** (no AO3 session) with | ||
| the same request shape the plugin sends, so the parsers are tested against the | ||
| page a normal install actually receives. | ||
|
|
||
| `<style>` and `<script>` blocks are removed after capture: they are ~80% of the | ||
| bytes (mostly workskin CSS) and no parser selector reads them. Everything the | ||
| plugin queries — byline, `dl.stats`, `.summary`, `#chapters`, `ol.index`, the | ||
| login page and the adult interstitial — is untouched. | ||
|
|
||
| | File | Request | Covers | | ||
| |---|---|---| | ||
| | `chapter-10057010.html` | `/works/10057010/chapters/22409387?view_adult=true` | 58 `a[rel="author"]` links (byline + translations), stats, summary plus a note blockquote | | ||
| | `navigate-10057010.html` | `/works/10057010/navigate?view_adult=true` | 188 chapter rows | | ||
| | `work-97039671.html` | `/works/97039671/chapters/259407686?view_adult=true` | co-written, two creators | | ||
| | `work-97088591.html` | `/works/97088591/chapters/259545856?view_adult=true` | anonymous (`Anonymous`, zero author links) | | ||
| | `work-97099316.html` | `/works/97099316?view_adult=true` | one-shot: no `dt.status`, no chapter index | | ||
| | `restricted-29870862.html` | `/works/29870862?view_adult=true` | guest login page, `restricted=true`, no `#chapters` | | ||
| | `adult-gate-10057010.html` | `/works/10057010` | adult interstitial, `HTTP 200`, no `#chapters` | | ||
|
|
||
| The chapter pages are used where a work page would be: AO3 redirects | ||
| `/works/{id}?view_adult=true` to `/works/{id}/chapters/{first}` **without the | ||
| query string**, which drops the gate bypass and serves the interstitial. The | ||
| plugin only avoids this because it also sends `Cookie: view_adult=true`. | ||
| Capturing the chapter URL keeps the fixture on the content page. | ||
|
|
||
| Regenerate with a guest browser: `fetch(url, { credentials: 'omit' })`, then | ||
| save the response body as the file name above. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classifyPageaccepts HTTP failures such as 500 and 502 asokwhen their bodies lack the listed markers.fetchApidoes not reject HTTP errors, so a plain “Bad Gateway” page reaches the parsers.parseChapterreturns an empty string, while a failed chapter index makesparseNovelreplace the chapter list with one fallback entry.The previous
checkResponserejected these responses. Keep the specific classifications, then reject any remaining response whereres.okis false.