Refresh a stale dl link instead of retrying it forever - #5
Open
nickwolf wants to merge 1 commit into
Open
Conversation
When a dl hash goes stale the site answers with something that isn't a torrent, so the grab fails on parsing and the error says "malformed bencode", which doesn't point at the cause. The selection stays put, so every downloader run asks for it again and never succeeds. Refresh the dl link once from the search API, which already returns dl, and retry with it. If it can't be refreshed, drop the selection so we stop asking the site for it every pass. It stays on the errors page with a clearer message, and restoring it from the selected page retries.
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.
A dl hash goes stale after a while and the site then answers with something that isn't a torrent. The grab fails on parsing with "malformed bencode: A dictionary is not properly sorted", which doesn't hint at the real cause, and the selection stays put, so every downloader run asks for it again and never gets anywhere.
This refreshes the dl link once from the search API, which already returns
dl, and retries with the fresh one. If the item is still bookmarked that just fixes it. If the link can't be refreshed, the selection gets dropped so we stop asking the site for it on every pass. It stays on the errors page with a clearer message, and restoring it from the selected page retries.I ran into it on a torrent I'd unbookmarked after it had been selected. It had been retried on every run for two days.