fix(site/hdsky): enhance torrent download link retrieval in firefox#1105
Merged
Rhilip merged 2 commits intopt-plugins:masterfrom Mar 16, 2026
Merged
fix(site/hdsky): enhance torrent download link retrieval in firefox#1105Rhilip merged 2 commits intopt-plugins:masterfrom
Rhilip merged 2 commits intopt-plugins:masterfrom
Conversation
…y handling for link formats
…y handling for link formats
Reviewer's guide (collapsed on small PRs)Reviewer's GuideHdsky.getTorrentDownloadLink is updated to preferentially return permanent torrent download links containing a passkey, falling back to time-limited links only when no passkey is present, improving reliability in browsers like Firefox. Class diagram for Hdsky torrent download link retrievalclassDiagram
class NexusPHP {
}
class ITorrent {
+string link
}
class Hdsky {
+getTorrentDownloadLink(torrent ITorrent) Promise~string~
}
Hdsky --|> NexusPHP
Hdsky ..> ITorrent : uses
Flow diagram for Hdsky.getTorrentDownloadLink decision logicflowchart TD
A[getTorrentDownloadLink called with torrent] --> B{torrent.link exists?}
B -- No --> C[Call super.getTorrentDownloadLink or other logic]
B -- Yes --> D[Evaluate hasPasskey using regex &passkey=]
D --> E{hasPasskey?}
E -- Yes --> F[Return torrent.link as permanent download link]
E -- No --> G[Extract t query parameter via runQueryFilters]
G --> H[Compute linkCreatedTime and currentTimestamp]
H --> I[Validate time-limited link and return or refresh as needed]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes HDSky torrent download link retrieval in Firefox by handling the passkey-based download URL format. In Firefox's sidebar, the download link was missing passkey/sign parameters, causing download failures.
Changes:
- Added early return when the torrent link already contains a
passkeyparameter, skipping unnecessary timestamp-based expiration checks. - Added documentation comment explaining the two HDSky download link formats.
You can also share your feedback on Copilot code review. Take the survey.
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.
在原先的 link 获取过程中,由于 HDSKY 在 Firefox 环境中返回的链接格式为
/download.php?id=<tid>&passkey=<passkey>&sign=<sign>导致 站点实例在执行 getTorrentDownloadLink 方法时,无法获取到&t=参数,进而导致导致可以下载的正确链接被错误的移除,随后回落到 NexusPHP 模板的 getTorrentDownloadLink 方法,导致错误的下载链接/download.php?id=<tid>被拼出。至此, HDSKY 站点在符合: ①使用 Firefox 浏览器; ②在种子详情页使用助手推送 的情况下,无法获取到正确的下载链接。
closed: #1098
Summary by Sourcery
Bug Fixes: