Commit f39ab1c2 authored by echel0n's avatar echel0n
Browse files

Refactored Zooqle torrent provider to handling paging results

parent 31a9c171
# Changelog
- * 7023501 - 2018-09-16: Pre-Release v9.3.79.dev4
- * 8999272 - 2018-09-16: Refactored Zooqle torrent provider to handling paging results
- * 31a9c17 - 2018-09-16: Pre-Release v9.3.79.dev4
- * 69668c7 - 2018-09-16: Hardcoded Zooqle torrent provider to search for english torrents
- * 2868350 - 2018-09-16: Pre-Release v9.3.79.dev3
- * f40c471 - 2018-09-16: Refactored Zooqle torrent provider to use RSS Fixed Attribute error for name parser
......
......@@ -127,13 +127,23 @@ class ZooqleProvider(TorrentProvider):
search_params['q'] = '{} {}'.format(search_params['q'], '+lang:en')
search_params['fmt'] = 'rss'
search_params['pg'] = 1
data = self.cache.get_rss_feed(self.urls['search'], params=search_params)
if not data :
sickrage.app.log.debug('No data returned from provider')
continue
while search_params['pg'] < 11:
data = self.cache.get_rss_feed(self.urls['search'], params=search_params)
if not data:
sickrage.app.log.debug('No data returned from provider')
break
total_results = try_int(data['feed']['opensearch_totalresults'])
start_index = try_int(data['feed']['opensearch_startindex'])
items_per_page = try_int(data['feed']['opensearch_itemsperpage'])
if int(start_index) + int(items_per_page) > int(total_results):
break
results += self.parse(data, mode)
results += self.parse(data, mode)
search_params['pg'] += 1
return results
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment