Private GIT

Skip to content
Snippets Groups Projects
Commit 93d4553e authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Clean fix for SiCKRAGETV/sickrage-issues/issues/2793 ?? Sets referer on all...

Clean fix for SiCKRAGETV/sickrage-issues/issues/2793 ?? Sets referer on all .nzb and .torrent download to the site the file is on
parent cacb4a54
No related tags found
No related merge requests found
...@@ -208,6 +208,10 @@ class GenericProvider: ...@@ -208,6 +208,10 @@ class GenericProvider:
if 'NO_DOWNLOAD_NAME' in url: if 'NO_DOWNLOAD_NAME' in url:
continue continue
if not self.proxy.isEnabled() and url.startswith('http'):
# Let's just set a referer for every .torrent/.nzb, should work as a cover-all without side-effects
self.headers.update({'Referer': '/'.join(url.split('/')[:3]) + '/'})
logger.log(u"Downloading a result from " + self.name + " at " + url) logger.log(u"Downloading a result from " + self.name + " at " + url)
if helpers.download_file(self.proxy._buildURL(url), filename, session=self.session, headers=self.headers): if helpers.download_file(self.proxy._buildURL(url), filename, session=self.session, headers=self.headers):
if self._verify_download(filename): if self._verify_download(filename):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment