fix(audioteka): search returns no results after markup change - #28
Open
PawelHaracz wants to merge 1 commit into
Open
fix(audioteka): search returns no results after markup change#28PawelHaracz wants to merge 1 commit into
PawelHaracz wants to merge 1 commit into
Conversation
Owner
|
Thanks! Please alter/remove the AI noise comments before a review. These are comments made by AI agents, but such comment should never be in the code, but in a PR. In the future it is irrelevant that this tag changed and how it was before. This can be checked in the git history |
Audioteka removed the `adtk-item` class from result list items. The search selector required it alongside the CSS-module class, so it matched nothing and every search returned an empty result set. Match on the CSS-module class prefix instead of the full hashed name, for the result item and the fields inside it. A frontend rebuild that only changes the hash suffix no longer breaks the parser. Verified against live HTML from https://audioteka.com/pl/szukaj/?phrase=wiedzmin: 28 results parsed, and the detail page still yields cover, narrator, duration, publisher, description, genres and series.
PawelHaracz
force-pushed
the
fix/audioteka-search-selector
branch
from
August 10, 2026 11:11
46e46ec to
360714e
Compare
Author
|
@Vito0912 removed, thx for reviewing |
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.
Problem
Every Audioteka search returns
{"matches":[]}, HTTP 200, no error in the logs:Cause is in
parseSearchResults:Audioteka dropped the
adtk-itemclass from the result list items. The selector requires both classes, so it matches nothing. In the live HTML the item is now just:adtk-itemdoes not appear anywhere on the page. All the inner CSS-module hashes still match.Fix
Match on the CSS-module class prefix rather than the full hashed name, for the result item and for the fields inside it. A frontend rebuild that only changes the hash suffix no longer breaks the parser.
Verification
Against live HTML from
https://audioteka.com/pl/szukaj/?phrase=wiedzmin:{ "title": "Krew elfów. Tom 1", "authors": ["Andrzej Sapkowski"], "url": "https://audioteka.com/pl/audiobook/krew-elfow-tom-1/", "cover": "https://atkcdn.audioteka.com/cc/c8/krew-elfow-tom-1/947.jpg", "narrator": "zespół lektorów", "duration": 388, "publisher": "SuperNOWA", "genres": ["Fantasy", "Fantastyka"], "series": ["Bestsellery", "Wiedźmin"], "language": "polish" }prettier --checkandtsc --noEmitboth pass. Only theplmarket was checked against live HTML; the selectors are shared across all markets, so the other locales should benefit the same way.Note, not fixed here
On the search page the cover
<img>sits inside<noscript>, which parse5 treats as raw text with scripting enabled, somatch.coverstays empty. It is harmless today becauseparseBookDetailsreads the cover from the detail page. Happy to address it separately if you want covers available without the detail fetch.🤖 Generated with Claude Code