copy headers

This commit is contained in:
j 2009-09-07 21:25:48 +02:00
parent 5109243163
commit a72eea3f44
2 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,8 @@ from oxlib.text import findRe
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")
return cache.getUrl(url, data, headers, timeout)
@ -85,6 +86,9 @@ def getData(id):
def getId(url):
return url.split("=")[-1]
def getTorrent(id):
return _getUrl(getData(id)['torrent'])
def getIds(lastId = 20):
lastId = '%s' % lastId
ids = []

View File

@ -18,7 +18,8 @@ cache_timeout = 24*60*60 # cache search only for 24 hours
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'
return cache.getUrl(url, data, headers, timeout)