Skip to content

fix: solve the s.to captcha modal when a mirror answers the redirect - #32

Merged
Domekologe merged 1 commit into
PD-Codes:mainfrom
mzmonkey:fix/sto-redirect-mirror-host
Oct 2, 2026
Merged

Domekologe merged 1 commit into
PD-Codes:mainfrom
mzmonkey:fix/sto-redirect-mirror-host

Conversation

@mzmonkey

Copy link
Copy Markdown
Contributor

🏷️ Title Format

  • My PR title starts with one of the prefixes above.
  • Everything I wrote here is in English.

📝 Description

  • SerienstreamEpisode.provider_url decides whether the provider redirect needs the captcha modal by comparing the response host with the redirect URL's host: a different host is taken as "the redirect left s.to".
  • The mirror failover (mirrors.request_with_failover) can answer from another s.to mirror than the one the redirect was built on:
    • s.to currently doesn't resolve (NXDOMAIN), so every primary retry fails over to serienstream.to;
    • after a hiccup on serienstream.to the failover moves to the bare-IP mirror 186.2.175.5 and stays there for _PRIMARY_RETRY_AFTER.
  • In both cases the host differs, so the s.to page itself (captcha modal included) is handed to the provider extractor. solve_sto_modal is never called, and every episode fails within about a second with Keine VOE-Videoquelle auf der Seite gefunden. until the failover switches back.
  • The check now uses mirrors.site_for_url(resp.url) != "sto": only a response outside every s.to mirror counts as having reached the provider. Everything else goes through solve_sto_modal as intended.

Impact seen on a 1.6.0 install: roughly 300 failed episodes per hour across several S.TO series for a full day. AniWorld, filmo and megakino were unaffected. With this change applied, the next episodes all downloaded and none failed.

🔗 Related Issue(s)

  • None filed; found while debugging the failures above.

🔄 Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)

🧪 How Has This Been Tested?

  • I have run the application locally (via Python or Docker). (1.6.0 with the same change applied)
  • I have verified that media downloading still works as intended (if applicable).
  • I have verified that the WebUI renders correctly without errors (if applicable). (no UI change)

New tests/test_sto_provider_redirect.py: a redirect that reached the provider is taken as is; the bare-IP mirror, a dead s.to failing over to serienstream.to, and the same mirror all still get the modal solved. Without the fix, the two mirror cases fail. tests/test_providers.py and tests/test_infra_mirrors.py still pass.

✅ Checklist

  • I have performed a self-review of my own code.
  • My code does not introduce new warnings or errors (e.g., Python syntax).
  • Code comments are written in English.

Diagnosed and written with the help of Claude Code; reviewed and tested on my own 1.6.0 install.

@TheMRX13

TheMRX13 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Will be checked today

@Domekologe
Domekologe merged commit 28852fe into PD-Codes:main Oct 2, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants