Skip to content

fix(zilean): percent-encode DMM query titles#570

Open
slawrensen wants to merge 1 commit into
g0ldyy:mainfrom
slawrensen:fix/zilean-query-encoding
Open

fix(zilean): percent-encode DMM query titles#570
slawrensen wants to merge 1 commit into
g0ldyy:mainfrom
slawrensen:fix/zilean-query-encoding

Conversation

@slawrensen

@slawrensen slawrensen commented Apr 5, 2026

Copy link
Copy Markdown

Summary

  • percent-encode the Zilean query parameter so titles with spaces, parentheses, &, +, and non-ASCII characters are sent safely
  • keep the change surgical by only wrapping request.title with urllib.parse.quote(..., safe='')
  • preserve the existing season / episode query parameters by leaving the show suffix untouched

Why

  • comet/scrapers/zilean.py currently interpolates request.title directly into the URL query string
  • raw interpolation can produce malformed or truncated lookups when titles contain URL-sensitive characters
  • percent-encoding the title makes /dmm/filtered?query=... requests deterministic without changing behavior for simple titles

Notes

  • this change is intentionally scoped to zilean.py
  • a similar raw query-string interpolation pattern exists in comet/scrapers/prowlarr.py; that can be handled separately

Copilot AI review requested due to automatic review settings April 5, 2026 15:26
@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown

Walkthrough

Added URL encoding to the query parameter in the Zilean scraper's /dmm/filtered request. The quote function is imported and applied to request.title with safe='' to ensure proper URL encoding of the title parameter.

Changes

Cohort / File(s) Summary
URL Parameter Encoding
comet/scrapers/zilean.py
Added quote import from urllib.parse and updated query parameter construction to URL-encode request.title using quote(request.title, safe='') for the /dmm/filtered request.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding percent-encoding to DMM query titles in the Zilean scraper, which aligns with the core modification shown in the raw summary.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes malformed Zilean DMM lookups by percent-encoding the query title value in the /dmm/filtered request URL so titles containing spaces, punctuation, or non-ASCII characters are transmitted safely.

Changes:

  • Add urllib.parse.quote usage to percent-encode request.title in the Zilean DMM filtered query URL.
  • Preserve existing season/episode query behavior for series requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants