log format
This commit is contained in:
parent
d70bd8797a
commit
35c0c02d16
2 changed files with 3 additions and 2 deletions
|
@ -138,6 +138,7 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
||||||
data = b'404 - Not Found'
|
data = b'404 - Not Found'
|
||||||
self.send_header('Content-Length', str(len(data)))
|
self.send_header('Content-Length', str(len(data)))
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
# FIXME: also check for limit here
|
||||||
self.wfile.write(data)
|
self.wfile.write(data)
|
||||||
return
|
return
|
||||||
path = i.get_path()
|
path = i.get_path()
|
||||||
|
|
|
@ -350,15 +350,15 @@ class Node(Thread):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def download_preview(self, item_id):
|
def download_preview(self, item_id):
|
||||||
logger.debug('trying to download preview from %s for %s', self.url, item_id)
|
|
||||||
from item.icons import icons
|
from item.icons import icons
|
||||||
self.resolve()
|
self.resolve()
|
||||||
|
logger.debug('download preview for %s from %s', item_id, self.url)
|
||||||
url = '%s/preview/%s' % (self.url, item_id)
|
url = '%s/preview/%s' % (self.url, item_id)
|
||||||
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
|
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
|
||||||
try:
|
try:
|
||||||
r = self._opener.open(url, timeout=self.TIMEOUT*2)
|
r = self._opener.open(url, timeout=self.TIMEOUT*2)
|
||||||
except:
|
except:
|
||||||
logger.debug('openurl failed %s', url, exc_info=True)
|
logger.debug('download failed %s', url, exc_info=True)
|
||||||
return False
|
return False
|
||||||
code = r.getcode()
|
code = r.getcode()
|
||||||
if code == 200:
|
if code == 200:
|
||||||
|
|
Loading…
Reference in a new issue