Skip to content

NBL api update#1274

Merged
Audionut merged 4 commits intomasterfrom
nbl-api-update
Mar 3, 2026
Merged

NBL api update#1274
Audionut merged 4 commits intomasterfrom
nbl-api-update

Conversation

@Audionut
Copy link
Owner

@Audionut Audionut commented Mar 3, 2026

Summary by CodeRabbit

  • New Features

    • Multi-page search with broader query construction (season/series-based terms) and guaranteed resolution tagging for more complete results.
    • Upload flow enhancements that capture returned torrent IDs and include an explicit action parameter.
  • Bug Fixes

    • Increased network timeouts and improved handling of non-200 and non-JSON responses.
    • More robust error messages and fallback behavior, including debug-mode bypass for uploads and safer pagination termination.

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Thanks for taking the time to contribute to this project. Upload Assistant is currently in a complete rewrite, and no new development is being conducted on this python source at this time.

If you have come this far, please feel free to leave open, any pull requests regarding new sites being added to the source, as these can serve as the baseline for later conversion.

If your pull request relates to a critical bug, this will be addressed in this code base, and a new release published as needed.

If your pull request only addresses a quite minor bug, it is not likely to be addressed in this code base.

Details for the new code base will follow at a later date.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b61e319 and b1d50d5.

📒 Files selected for processing (1)
  • src/trackers/NBL.py

📝 Walkthrough

Walkthrough

NBL tracker updated: upload now targets api.php with an action parameter, captures torrent_id from response, increases timeouts and adds debug bypass; search_existing now supports paginated, multi-criteria searches (tvmaze/imdb/series) with per-page fetching, resilient JSON/error handling, and improved parsing of results.

Changes

Cohort / File(s) Summary
NBL Tracker — core logic
src/trackers/NBL.py
Switch upload endpoint from upload.phpapi.php; add action and torrent_url handling, extract torrent_id via regex, increase HTTP timeout to 30s, return structured status on non-200/JSON errors, and add debug-mode bypass. Rework search_existing to use paginated GET requests (per_page=100, configurable max_pages), construct multi-criteria queries (tvmaze/imdb/series + resolution + season), handle 400 "out of range", non-JSON and KeyError cases, parse items from either top-level or result field, and improve logging and early-termination across pages.

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • NBL api update #1274 — Modifies the same NBL.py upload and search flows (endpoint change to api.php, action/torrent_id handling, timeout increases, pagination and resilient search).

Poem

🐰 I hopped to a new API gate,

regex crumbs led to torrent fate,
pages rolled by, queries in tow,
seasons and tags in tidy row,
errors tamed — the tracker’s set to go. 🎋

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'NBL api update' directly and specifically describes the main change - updating the NBL tracker API implementation, including endpoint changes and search functionality enhancements.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nbl-api-update

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/trackers/NBL.py`:
- Around line 145-150: The params dict used for duplicate-search is always
setting "season": season which forces season=0; modify the code that builds
params (the dict named params in the duplicate/search routine in NBL.py, likely
inside the search/duplicate lookup function) to only add the "season" key when
season is a positive integer (e.g., season is not None and int(season) > 0) so
missing/unknown seasons are omitted from the request and won't over-constrain
results.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c51bf3 and b61e319.

📒 Files selected for processing (1)
  • src/trackers/NBL.py

@Audionut Audionut merged commit d2e31b4 into master Mar 3, 2026
3 of 4 checks passed
@Audionut Audionut deleted the nbl-api-update branch March 3, 2026 10:10
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.

1 participant