Private GIT

Skip to content
Snippets Groups Projects
Commit 8bb27472 authored by Kfir Hadas's avatar Kfir Hadas Committed by miigotu
Browse files

Updates to SkyTorrents and Nyaa (#3889)

* Use TVCache in SkyTorrents

Instead of calling feedparser.parse directly.
Untested.

* Remove missing 'continue' in nyaa provider
parent 50ecda12
Branches
No related tags found
No related merge requests found
......@@ -71,6 +71,7 @@ class NyaaProvider(TorrentProvider): # pylint: disable=too-many-instance-attrib
data = self.cache.get_rss_feed(self.url, params=search_params)['entries']
if not data:
logger.log('Data returned from provider does not contain any torrents', logger.DEBUG)
continue
for curItem in data:
try:
......
......@@ -21,7 +21,6 @@ from __future__ import unicode_literals
import re
import feedparser
import validators
from requests.compat import urljoin
from sickbeard import logger, tvcache
......@@ -79,17 +78,12 @@ class SkyTorrents(TorrentProvider): # pylint: disable=too-many-instance-attribu
return results
search_url = urljoin(self.custom_url, search_url.split(self.url)[1])
data = self.get_url(search_url, returns="text")
data = self.cache.get_rss_feed(search_url)['entries']
if not data:
logger.log("URL did not return results/data, if the results are on the site maybe try a custom url, or a different one", logger.DEBUG)
logger.log('Data returned from provider does not contain any torrents', logger.DEBUG)
continue
if not data.startswith("<rss"):
logger.log("Expected rss but got something else, is your mirror failing?", logger.INFO)
continue
feed = feedparser.parse(data)
for item in feed.entries:
for item in data:
try:
title = item.title
download_url = item.link
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment