mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-24 08:48:50 -05:00
Merge pull request #1281 from SickrageDK/develop
Provider hounddawgs: Changes to fit new site layout
This commit is contained in:
commit
a863797295
@ -56,9 +56,9 @@ class HoundDawgsProvider(generic.TorrentProvider):
|
|||||||
|
|
||||||
self.cache = HoundDawgsCache(self)
|
self.cache = HoundDawgsCache(self)
|
||||||
|
|
||||||
self.urls = {'base_url': 'http://192.99.10.104/',
|
self.urls = {'base_url': 'https://hounddawgs.org/',
|
||||||
'search': 'http://192.99.10.104/torrents.php?type=&userid=&searchstr=%s&searchimdb=&searchtags=&order_by=s3&order_way=desc&%s',
|
'search': 'https://hounddawgs.org/torrents.php?type=&userid=&searchstr=%s&searchimdb=&searchtags=&order_by=s3&order_way=desc&%s',
|
||||||
'login': 'http://192.99.10.104/login.php',
|
'login': 'https://hounddawgs.org/login.php',
|
||||||
}
|
}
|
||||||
|
|
||||||
self.url = self.urls['base_url']
|
self.url = self.urls['base_url']
|
||||||
@ -154,9 +154,10 @@ class HoundDawgsProvider(generic.TorrentProvider):
|
|||||||
items = {'Season': [], 'Episode': [], 'RSS': []}
|
items = {'Season': [], 'Episode': [], 'RSS': []}
|
||||||
|
|
||||||
if not self._doLogin():
|
if not self._doLogin():
|
||||||
return []
|
return results
|
||||||
|
|
||||||
for mode in search_params.keys():
|
for mode in search_params.keys():
|
||||||
|
|
||||||
for search_string in search_params[mode]:
|
for search_string in search_params[mode]:
|
||||||
|
|
||||||
if isinstance(search_string, unicode):
|
if isinstance(search_string, unicode):
|
||||||
@ -214,20 +215,14 @@ class HoundDawgsProvider(generic.TorrentProvider):
|
|||||||
|
|
||||||
download_url = self.urls['base_url']+allAs[0].attrs['href']
|
download_url = self.urls['base_url']+allAs[0].attrs['href']
|
||||||
id = link.replace(self.urls['base_url']+'torrents.php?id=','')
|
id = link.replace(self.urls['base_url']+'torrents.php?id=','')
|
||||||
seeders = int(torrent[7].string)
|
|
||||||
leechers = int(torrent[8].string)
|
|
||||||
|
|
||||||
except (AttributeError, TypeError):
|
except (AttributeError, TypeError):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
#Filter unseeded torrent
|
|
||||||
if mode != 'RSS' and (seeders < self.minseed or leechers < self.minleech):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if not title or not download_url:
|
if not title or not download_url:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
item = title, download_url, id, seeders, leechers
|
item = title, download_url
|
||||||
logger.log(u"Found result: " + title + "(" + download_url + ")", logger.DEBUG)
|
logger.log(u"Found result: " + title + "(" + download_url + ")", logger.DEBUG)
|
||||||
|
|
||||||
items[mode].append(item)
|
items[mode].append(item)
|
||||||
@ -235,16 +230,13 @@ class HoundDawgsProvider(generic.TorrentProvider):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.log(u"Failed parsing " + self.name + " Traceback: " + traceback.format_exc(), logger.ERROR)
|
logger.log(u"Failed parsing " + self.name + " Traceback: " + traceback.format_exc(), logger.ERROR)
|
||||||
|
|
||||||
#For each search mode sort all the items by seeders
|
|
||||||
items[mode].sort(key=lambda tup: tup[3], reverse=True)
|
|
||||||
|
|
||||||
results += items[mode]
|
results += items[mode]
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def _get_title_and_url(self, item):
|
def _get_title_and_url(self, item):
|
||||||
|
|
||||||
title, url, id, seeders, leechers = item
|
title, url = item
|
||||||
|
|
||||||
if title:
|
if title:
|
||||||
title = u'' + title
|
title = u'' + title
|
||||||
|
Loading…
Reference in New Issue
Block a user