mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Updated code to added referer header for web proxies
This commit is contained in:
parent
730cd0f80f
commit
4e0a4c3f99
@ -34,7 +34,7 @@ class RSSFeeds:
|
||||
finally:
|
||||
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[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / with one
|
||||
|
||||
@ -45,7 +45,7 @@ class RSSFeeds:
|
||||
|
||||
try:
|
||||
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:
|
||||
try:
|
||||
|
@ -139,8 +139,8 @@ class TVCache():
|
||||
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||
|
||||
def getRSSFeed(self, url, post_data=None, items=[]):
|
||||
referrer = self.provider.proxy.getProxyURL()
|
||||
return RSSFeeds(self.providerID).getFeed(self.provider.proxy._buildURL(url), post_data, self.provider.headers, referrer, items)
|
||||
self.provider.headers.update({'Referer': self.provider.proxy.getProxyURL()})
|
||||
return RSSFeeds(self.providerID).getFeed(self.provider.proxy._buildURL(url), post_data, self.provider.headers, items)
|
||||
|
||||
def _translateTitle(self, title):
|
||||
return u'' + title.replace(' ', '.')
|
||||
|
Loading…
Reference in New Issue
Block a user