1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-18 07:15:13 -05:00

Added 16x16 logo

Fix some code for quality recognition
This commit is contained in:
Giovanni 2015-02-17 12:20:09 +01:00
parent b47d3baa35
commit 7e3b62fee1
2 changed files with 32 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -84,6 +84,17 @@ class TNTVillageProvider(generic.TorrentProvider):
self.minseed = None
self.minleech = None
self.hdtext = {
' Versione 720p',
' V 720p',
' V HEVC',
' V HEVC',
' Versione 1080p',
' 720p HEVC',
' Ver 720',
' 720p HEVC',
}
self.category_dict = {
'Serie TV' : 29,
'Cartoni' : 8,
@ -249,6 +260,7 @@ class TNTVillageProvider(generic.TorrentProvider):
img_all = (torrent_rows.find_all('td'))[1].find_all('img')
if len(img_all) > 0:
for type in img_all:
try:
@ -257,21 +269,26 @@ class TNTVillageProvider(generic.TorrentProvider):
except Exception, e:
logger.log(u"Failed parsing " + self.name + " Traceback: " + traceback.format_exc(), logger.ERROR)
else:
file_quality = (torrent_rows.find_all('td'))[1].get_text()
logger.log(u"file_quality: " + str(file_quality), logger.DEBUG)
checkName = lambda list, func: func([re.search(x, file_quality, re.I) for x in list])
dvdOptions = checkName(["dvd", "dvdrip", "dvdmux"], any)
dvdOptions = checkName(["dvd", "dvdrip", "dvdmux", "DVD9", "DVD5"], any)
blueRayOptions = checkName(["BD","BDmux", "BDrip", "Bluray"], any)
sdOptions = checkName(["h264", "divx", "XviD", "tv"], any)
sdOptions = checkName(["h264", "divx", "XviD", "tv", "SATRip"], any)
hdOptions = checkName(["720p"], any)
fullHD = checkName(["1080p", "fullHD"], any)
if len(img_all) > 0:
file_quality = (torrent_rows.find_all('td'))[1].get_text()
webdl = checkName(["webdl", "webmux", "webrip", "dl-webmux", "web-dlmux", "webdl-mux", "web-dl", "webdlmux", "dlmux"], any)
logger.log(u"dvdOptions: " + str(dvdOptions) + ", blueRayOptions: " + str(blueRayOptions) + ", sdOptions: " + str(sdOptions) + ", hdOptions: " + str(hdOptions) + ", fullHD: " + str(fullHD) + ", webdl: " + str(webdl), logger.DEBUG)
if sdOptions and not blueRayOptions and not dvdOptions and not fullHD and not hdOptions:
if sdOptions and not dvdOptions and not fullHD and not hdOptions:
return Quality.SDTV
elif dvdOptions:
return Quality.SDDVD
@ -390,7 +407,10 @@ class TNTVillageProvider(generic.TorrentProvider):
logger.log(u"name: " + title + "", logger.DEBUG)
filename_qt = self._reverseQuality(self._episodeQuality(result))
title = title.replace(" Versione 720p",filename_qt).replace(" V 720p",filename_qt).replace(" V HEVC",filename_qt).replace(" Versione 1080p",filename_qt).replace(" 720p HEVC",filename_qt)
for text in self.hdtext:
title = title.replace(text,filename_qt)
#title = title.replace(" Versione 720p",filename_qt).replace(" V 720p",filename_qt).replace(" V HEVC",filename_qt).replace(" Versione 1080p",filename_qt).replace(" 720p HEVC",filename_qt).replace(" Ver 720",filename_qt)
if Quality.nameQuality(title) == Quality.UNKNOWN:
title += filename_qt