copy headers
This commit is contained in:
parent
5109243163
commit
a72eea3f44
2 changed files with 7 additions and 2 deletions
|
@ -6,7 +6,8 @@ from oxlib.text import findRe
|
||||||
import auth
|
import auth
|
||||||
|
|
||||||
|
|
||||||
def _getUrl(url, data=None, headers=cache.DEFAULT_HEADERS.copy(), timeout=cache.cache_timeout, valid=None):
|
def _getUrl(url, data=None, headers=cache.DEFAULT_HEADERS, timeout=cache.cache_timeout, valid=None):
|
||||||
|
headers = headers.copy()
|
||||||
headers["Cookie"] = auth.get("karagarga.cookie")
|
headers["Cookie"] = auth.get("karagarga.cookie")
|
||||||
return cache.getUrl(url, data, headers, timeout)
|
return cache.getUrl(url, data, headers, timeout)
|
||||||
|
|
||||||
|
@ -85,6 +86,9 @@ def getData(id):
|
||||||
def getId(url):
|
def getId(url):
|
||||||
return url.split("=")[-1]
|
return url.split("=")[-1]
|
||||||
|
|
||||||
|
def getTorrent(id):
|
||||||
|
return _getUrl(getData(id)['torrent'])
|
||||||
|
|
||||||
def getIds(lastId = 20):
|
def getIds(lastId = 20):
|
||||||
lastId = '%s' % lastId
|
lastId = '%s' % lastId
|
||||||
ids = []
|
ids = []
|
||||||
|
|
|
@ -18,7 +18,8 @@ cache_timeout = 24*60*60 # cache search only for 24 hours
|
||||||
season_episode = re.compile("S..E..", re.IGNORECASE)
|
season_episode = re.compile("S..E..", re.IGNORECASE)
|
||||||
|
|
||||||
|
|
||||||
def _getUrl(url, data=None, headers=cache.DEFAULT_HEADERS.copy(), timeout=cache.cache_timeout, valid=None):
|
def _getUrl(url, data=None, headers=cache.DEFAULT_HEADERS, timeout=cache.cache_timeout, valid=None):
|
||||||
|
headers = headers.copy()
|
||||||
headers['Cookie'] = 'language=en_EN'
|
headers['Cookie'] = 'language=en_EN'
|
||||||
return cache.getUrl(url, data, headers, timeout)
|
return cache.getUrl(url, data, headers, timeout)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue