This pull request introduces several improvements to the indexer search logic, especially for MyAnonamouse, focusing on more robust query handling, targeted search payloads, and better link detection in search results. The changes enhance both the reliability and accuracy of searches and result parsing.
Indexer query handling improvements:
- Added a
SanitizeIndexerQuerymethod to clean search queries by removing illegal characters, control symbols, and collapsing whitespace before sending to indexers. This helps prevent errors and improves compatibility with indexer APIs. [1] [2]
MyAnonamouse search enhancements:
- Refactored the MyAnonamouse search payload to use a more targeted form-encoded structure, including logic to parse title and author from the query for more precise searches. The payload now mirrors the site's expected parameters and supports audiobook filtering.
- Added a
ParseTitleAuthorFromQueryhelper to heuristically split user queries into title and author components, supporting common patterns like "Title by Author", "Title - Author", and "Author, Title".
Search result parsing improvements:
- Improved link detection in MyAnonamouse results by robustly identifying magnet links, torrent URLs, and NZB links using multiple possible field names and formats. This ensures accurate format assignment and better usability of search results.Refactored MyAnonamouse search to use a more targeted form payload and added robust parsing for title/author from queries. Enhanced link detection logic to better distinguish between torrent, magnet, and NZB links. Added query sanitization to remove illegal characters for indexer searches.
Automated canary build