From fad028cfa2d88b50ed5273fc344fdbee19f47e98 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 10 Apr 2011 08:30:23 +0000 Subject: [PATCH] Fix to kickasstorrents search plugin --- src/searchengine/nova/engines/kickasstorrents.py | 8 ++++++-- src/searchengine/nova/engines/versions.txt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/searchengine/nova/engines/kickasstorrents.py b/src/searchengine/nova/engines/kickasstorrents.py index 16290f1e0..634113cb4 100755 --- a/src/searchengine/nova/engines/kickasstorrents.py +++ b/src/searchengine/nova/engines/kickasstorrents.py @@ -1,4 +1,4 @@ -#VERSION: 1.1 +#VERSION: 1.2 #AUTHORS: Christophe Dumez (chris@qbittorrent.org) # Redistribution and use in source and binary forms, with or without @@ -47,7 +47,11 @@ class kickasstorrents(object): while True and i<11: results = [] json_data = retrieve_url(self.url+'/search/%s/%d/?categories[]=%s&field=seeders&sorder=desc&json=1'%(what, i, self.supported_categories[cat])) - json_dict = json.loads(json_data) + try: + json_dict = json.loads(json_data) + except: + i += 1 + continue if json_dict['total_results'] <= 0: return results = json_dict['list'] for r in results: diff --git a/src/searchengine/nova/engines/versions.txt b/src/searchengine/nova/engines/versions.txt index 38baba8e3..eebb1a6d5 100644 --- a/src/searchengine/nova/engines/versions.txt +++ b/src/searchengine/nova/engines/versions.txt @@ -6,4 +6,4 @@ piratebay: 1.40 vertor: 1.3 torrentdownloads: 1.1 extratorrent: 1.1 -kickasstorrents: 1.1 +kickasstorrents: 1.2