Skip to content

Use TorBox permalinks instead of expiring CDN download URLs#183

Open
akhanalcs wants to merge 1 commit into
sirrobot01:mainfrom
akhanalcs:fix/torbox-permalink-download-links
Open

Use TorBox permalinks instead of expiring CDN download URLs#183
akhanalcs wants to merge 1 commit into
sirrobot01:mainfrom
akhanalcs:fix/torbox-permalink-download-links

Conversation

@akhanalcs
Copy link
Copy Markdown

TorBox download links currently use the CDN URL. Those URLs are short-lived and eventually start returning Invalid Presigned Token, which breaks streams (e.g. Plex) after a few hours.

This PR switches the TorBox provider to store TorBox "permalinks" instead of the short-lived CDN URLs, as recommended in the TorBox API docs.

https://www.postman.com/torbox/torbox/request/c6hu0dr/request-download-link

Changes

  • In pkg/debrid/providers/torbox/torbox.go, GetDownloadLink now:

    • Still calls requestdl to validate that TorBox will serve the file and to surface API errors.

    • Verifies that the API response contains a non-empty download URL (for sanity checking only).

    • Builds and stores a permalink of the form:

      {{api_base}}/{{api_version}}/api/torrents/requestdl?token={{api_key}}&torrent_id={{torrent_id}}&file_id={{file_id}}&redirect=true

    • Caches this permalink in types.DownloadLink.DownloadLink.

  • Added a debug log to show the generated permalink for testing / troubleshooting.

Fixes

Issue: #179

@rennanguisard
Copy link
Copy Markdown

Thanks, man. Just started using your fork for the time being and seems to be fixed.

@masesisaac
Copy link
Copy Markdown

masesisaac commented Jan 19, 2026

@sirrobot01 kindly bringing this to your attention, it's a much needed fix

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