Private GIT

Skip to content
Snippets Groups Projects
Commit 850f495c authored by sarakha63's avatar sarakha63
Browse files

Merge pull request #276 from raver2046/development

Ajout d'un filtre sur le title du torrent pour éviter les mauvais downlo...
parents 7ad7e6b9 3a81268e
No related branches found
No related tags found
No related merge requests found
...@@ -54,15 +54,15 @@ class THINKGEEKProvider(generic.TorrentProvider): ...@@ -54,15 +54,15 @@ class THINKGEEKProvider(generic.TorrentProvider):
if audio_lang == "en" and french==None: if audio_lang == "en" and french==None:
results.append( urllib.urlencode( { results.append( urllib.urlencode( {
'keywords': searchString , 'keywords': searchString ,
} ) + "&cid=34,62" ) } ) + "&cid=34,62&[PARAMSTR]=" + searchString )
elif audio_lang == "fr" or french: elif audio_lang == "fr" or french:
results.append( urllib.urlencode( { results.append( urllib.urlencode( {
'keywords': searchString 'keywords': searchString
} ) + "&cid=33,61") } ) + "&cid=33,61&[PARAMSTR]=" + searchString)
else: else:
results.append( urllib.urlencode( { results.append( urllib.urlencode( {
'keywords': searchString 'keywords': searchString
} ) + "&cid=34,62,33,61") } ) + "&cid=34,62,33,61&[PARAMSTR]=" + searchString)
return results return results
def _get_season_search_strings(self, show, season): def _get_season_search_strings(self, show, season):
...@@ -153,7 +153,11 @@ class THINKGEEKProvider(generic.TorrentProvider): ...@@ -153,7 +153,11 @@ class THINKGEEKProvider(generic.TorrentProvider):
if link: if link:
title = link.text title = link.text
recherched=searchUrl.split("&[PARAMSTR]=")[1]
recherched=recherched.replace(" ","(.*)")
logger.log(u"THINKGEEK TITLE : " + title, logger.DEBUG) logger.log(u"THINKGEEK TITLE : " + title, logger.DEBUG)
logger.log(u"THINKGEEK CHECK MATCH : " + recherched, logger.DEBUG)
if re.match(recherched,title , re.IGNORECASE):
downloadURL = row.find("a",href=re.compile("action=download"))['href'] downloadURL = row.find("a",href=re.compile("action=download"))['href']
logger.log(u"THINKGEEK DOWNLOAD URL : " + title, logger.DEBUG) logger.log(u"THINKGEEK DOWNLOAD URL : " + title, logger.DEBUG)
quality = Quality.nameQuality( title ) quality = Quality.nameQuality( title )
...@@ -166,7 +170,6 @@ class THINKGEEKProvider(generic.TorrentProvider): ...@@ -166,7 +170,6 @@ class THINKGEEKProvider(generic.TorrentProvider):
results.append( THINKGEEKSearchResult( self.opener, title, downloadURL, quality, 'fr' ) ) results.append( THINKGEEKSearchResult( self.opener, title, downloadURL, quality, 'fr' ) )
else: else:
results.append( THINKGEEKSearchResult( self.opener, title, downloadURL, quality ) ) results.append( THINKGEEKSearchResult( self.opener, title, downloadURL, quality ) )
return results return results
def getResult(self, episodes): def getResult(self, episodes):
......
...@@ -54,19 +54,20 @@ class XTHORProvider(generic.TorrentProvider): ...@@ -54,19 +54,20 @@ class XTHORProvider(generic.TorrentProvider):
if audio_lang == "en" and french==None: if audio_lang == "en" and french==None:
results.append( urllib.urlencode( { results.append( urllib.urlencode( {
'keywords': searchString , 'keywords': searchString ,
} ) + "&cid=43,69" ) } ) + "&cid=43,69&[PARAMSTR]=" + searchString )
elif audio_lang == "fr" or french: elif audio_lang == "fr" or french:
results.append( urllib.urlencode( { results.append( urllib.urlencode( {
'keywords': searchString 'keywords': searchString
} ) + "&cid=42,41") } ) + "&cid=42,41&[PARAMSTR]=" + searchString)
else: else:
results.append( urllib.urlencode( { results.append( urllib.urlencode( {
'keywords': searchString 'keywords': searchString
} ) + "&cid=42,43,41,69") } ) + "&cid=42,43,41,69&[PARAMSTR]=" + searchString)
if fullSeason: #Désactivé car on ne peut pas savoir la langue
results.append( urllib.urlencode( { #if fullSeason:
'keywords': searchString # results.append( urllib.urlencode( {
} ) + "&cid=70") # 'keywords': searchString
# } ) + "&cid=70&[PARAMSTR]=" + searchString)
return results return results
def _get_season_search_strings(self, show, season): def _get_season_search_strings(self, show, season):
...@@ -157,9 +158,13 @@ class XTHORProvider(generic.TorrentProvider): ...@@ -157,9 +158,13 @@ class XTHORProvider(generic.TorrentProvider):
if link: if link:
title = link.text title = link.text
recherched=searchUrl.split("&[PARAMSTR]=")[1]
recherched=recherched.replace(" ","(.*)")
logger.log(u"XTHOR TITLE : " + title, logger.DEBUG) logger.log(u"XTHOR TITLE : " + title, logger.DEBUG)
logger.log(u"XTHOR CHECK MATCH : " + recherched, logger.DEBUG)
if re.match(recherched,title , re.IGNORECASE):
downloadURL = row.find("a",href=re.compile("action=download"))['href'] downloadURL = row.find("a",href=re.compile("action=download"))['href']
logger.log(u"XTHOR DOWNLOAD URL : " + title, logger.DEBUG) logger.log(u"XTHOR DOWNLOAD URL : " + downloadURL, logger.DEBUG)
quality = Quality.nameQuality( title ) quality = Quality.nameQuality( title )
if quality==Quality.UNKNOWN and title: if quality==Quality.UNKNOWN and title:
if '720p' not in title.lower() and '1080p' not in title.lower(): if '720p' not in title.lower() and '1080p' not in title.lower():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment