Use TorBox permalinks instead of expiring CDN download URLs#183
Open
akhanalcs wants to merge 1 commit into
Open
Use TorBox permalinks instead of expiring CDN download URLs#183akhanalcs wants to merge 1 commit into
akhanalcs wants to merge 1 commit into
Conversation
|
Thanks, man. Just started using your fork for the time being and seems to be fixed. |
|
@sirrobot01 kindly bringing this to your attention, it's a much needed fix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,GetDownloadLinknow:Still calls
requestdlto 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=trueCaches this permalink in
types.DownloadLink.DownloadLink.Added a debug log to show the generated permalink for testing / troubleshooting.
Fixes
Issue: #179