From a432ad4f5a71690ba423fb58dc647e375e04c5a9 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 22 Oct 2012 21:42:42 +0200 Subject: [PATCH] Use new kat.ph url. fix #959 Also use https while we're at it. --- .../core/providers/torrent/kickasstorrents/main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/couchpotato/core/providers/torrent/kickasstorrents/main.py b/couchpotato/core/providers/torrent/kickasstorrents/main.py index 6c157a6b..f59d8df5 100644 --- a/couchpotato/core/providers/torrent/kickasstorrents/main.py +++ b/couchpotato/core/providers/torrent/kickasstorrents/main.py @@ -1,6 +1,7 @@ from bs4 import BeautifulSoup from couchpotato.core.event import fireEvent -from couchpotato.core.helpers.variable import tryInt +from couchpotato.core.helpers.encoding import simplifyString +from couchpotato.core.helpers.variable import tryInt, getTitle from couchpotato.core.logger import CPLog from couchpotato.core.providers.torrent.base import TorrentProvider import re @@ -12,9 +13,9 @@ log = CPLog(__name__) class KickAssTorrents(TorrentProvider): urls = { - 'test': 'http://kat.ph/', - 'detail': 'http://kat.ph/%s', - 'search': 'http://kat.ph/i%s/', + 'test': 'https://kat.ph/', + 'detail': 'https://kat.ph/%s', + 'search': 'https://kat.ph/%s-i%s/', } cat_ids = [ @@ -35,8 +36,10 @@ class KickAssTorrents(TorrentProvider): if self.isDisabled(): return results + title = simplifyString(getTitle(movie['library'])).replace(' ', '-') + cache_key = 'kickasstorrents.%s.%s' % (movie['library']['identifier'], quality.get('identifier')) - data = self.getCache(cache_key, self.urls['search'] % (movie['library']['identifier'].replace('tt', ''))) + data = self.getCache(cache_key, self.urls['search'] % (title, movie['library']['identifier'].replace('tt', ''))) if data: cat_ids = self.getCatId(quality['identifier'])