mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 08:53:37 +00:00
Filter out possible torrent links that would return a 404 http error
This commit is contained in:
parent
f3073174ed
commit
11150efab0
1 changed files with 17 additions and 6 deletions
|
@ -130,12 +130,6 @@ def snatchEpisode(result, endStatus=SNATCHED):
|
||||||
dlResult = _downloadResult(result)
|
dlResult = _downloadResult(result)
|
||||||
else:
|
else:
|
||||||
# Snatches torrent with client
|
# Snatches torrent with client
|
||||||
result.content = None
|
|
||||||
if not result.url.startswith('magnet'):
|
|
||||||
result.content = result.provider.getURL(result.url)
|
|
||||||
if not result.content:
|
|
||||||
return False
|
|
||||||
|
|
||||||
client = clients.getClientIstance(sickbeard.TORRENT_METHOD)()
|
client = clients.getClientIstance(sickbeard.TORRENT_METHOD)()
|
||||||
dlResult = client.sendTORRENT(result)
|
dlResult = client.sendTORRENT(result)
|
||||||
else:
|
else:
|
||||||
|
@ -206,6 +200,7 @@ def pickBestResult(results, show, quality_list=None):
|
||||||
# find the best result for the current episode
|
# find the best result for the current episode
|
||||||
bestResult = None
|
bestResult = None
|
||||||
for cur_result in results:
|
for cur_result in results:
|
||||||
|
|
||||||
logger.log("Quality of " + cur_result.name + " is " + Quality.qualityStrings[cur_result.quality])
|
logger.log("Quality of " + cur_result.name + " is " + Quality.qualityStrings[cur_result.quality])
|
||||||
|
|
||||||
if bwl:
|
if bwl:
|
||||||
|
@ -382,6 +377,14 @@ def searchForNeededEpisodes(show, episodes):
|
||||||
if curEp in foundResults and bestResult.quality <= foundResults[curEp].quality:
|
if curEp in foundResults and bestResult.quality <= foundResults[curEp].quality:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# filter out possible bad torrents from providers such as ezrss
|
||||||
|
if bestResult.resultType == "torrent" and sickbeard.TORRENT_METHOD != "blackhole":
|
||||||
|
bestResult.content = None
|
||||||
|
if not bestResult.url.startswith('magnet'):
|
||||||
|
bestResult.content = bestResult.provider.getURL(bestResult.url)
|
||||||
|
if not bestResult.content:
|
||||||
|
continue
|
||||||
|
|
||||||
foundResults[curEp] = bestResult
|
foundResults[curEp] = bestResult
|
||||||
|
|
||||||
if not didSearch:
|
if not didSearch:
|
||||||
|
@ -644,6 +647,14 @@ def searchProviders(show, season, episodes, manualSearch=False):
|
||||||
if not bestResult:
|
if not bestResult:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# filter out possible bad torrents from providers such as ezrss
|
||||||
|
if bestResult.resultType == "torrent" and sickbeard.TORRENT_METHOD != "blackhole":
|
||||||
|
bestResult.content = None
|
||||||
|
if not bestResult.url.startswith('magnet'):
|
||||||
|
bestResult.content = bestResult.provider.getURL(bestResult.url)
|
||||||
|
if not bestResult.content:
|
||||||
|
continue
|
||||||
|
|
||||||
# add result if its not a duplicate and
|
# add result if its not a duplicate and
|
||||||
found = False
|
found = False
|
||||||
for i, result in enumerate(finalResults):
|
for i, result in enumerate(finalResults):
|
||||||
|
|
Loading…
Reference in a new issue