1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Updated code to added referer header for web proxies

This commit is contained in:
echel0n 2014-12-19 22:17:29 -08:00
parent 730cd0f80f
commit 4e0a4c3f99
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ class RSSFeeds:
finally: finally:
self.rssDB.close() self.rssDB.close()
def getFeed(self, url, post_data=None, request_headers=None, referrer=None, items=[]): def getFeed(self, url, post_data=None, request_headers=None, items=[]):
parsed = list(urlparse.urlparse(url)) parsed = list(urlparse.urlparse(url))
parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one
@ -45,7 +45,7 @@ class RSSFeeds:
try: try:
fc = Cache(self.rssDB) fc = Cache(self.rssDB)
resp = fc.fetch(url, False, False, request_headers=request_headers, referrer=referrer) resp = fc.fetch(url, False, False, request_headers=request_headers)
for item in items: for item in items:
try: try:

View File

@ -139,8 +139,8 @@ class TVCache():
logger.log(traceback.format_exc(), logger.DEBUG) logger.log(traceback.format_exc(), logger.DEBUG)
def getRSSFeed(self, url, post_data=None, items=[]): def getRSSFeed(self, url, post_data=None, items=[]):
referrer = self.provider.proxy.getProxyURL() self.provider.headers.update({'Referer': self.provider.proxy.getProxyURL()})
return RSSFeeds(self.providerID).getFeed(self.provider.proxy._buildURL(url), post_data, self.provider.headers, referrer, items) return RSSFeeds(self.providerID).getFeed(self.provider.proxy._buildURL(url), post_data, self.provider.headers, items)
def _translateTitle(self, title): def _translateTitle(self, title):
return u'' + title.replace(' ', '.') return u'' + title.replace(' ', '.')