Browse Source

Magic indentations baby!

pull/51/head
bwq 14 years ago
parent
commit
0655b30a3d
  1. 38
      couchpotato/core/downloaders/blackhole/main.py

38
couchpotato/core/downloaders/blackhole/main.py

@ -19,29 +19,29 @@ class Blackhole(Downloader):
log.error('No directory set for blackhole %s download.' % data.get('type'))
else:
try:
file = data.get('download')(url = data.get('url'), nzb_id = data.get('id'))
file = data.get('download')(url = data.get('url'), nzb_id = data.get('id'))
if "no nzb" in file:
log.error('No nzb available!')
return False
if "no nzb" in file:
log.error('No nzb available!')
return False
fullPath = os.path.join(directory, self.createFileName(data, file, movie))
fullPath = os.path.join(directory, self.createFileName(data, file, movie))
try:
if not os.path.isfile(fullPath):
log.info('Downloading %s to %s.' % (data.get('type'), fullPath))
with open(fullPath, 'wb') as f:
f.write(file)
return True
else:
log.info('File %s already exists.' % fullPath)
return True
try:
if not os.path.isfile(fullPath):
log.info('Downloading %s to %s.' % (data.get('type'), fullPath))
with open(fullPath, 'wb') as f:
f.write(file)
return True
else:
log.info('File %s already exists.' % fullPath)
return True
except:
log.error('Failed to download to blackhole %s' % traceback.format_exc())
pass
except:
log.error('Failed to download to blackhole %s' % traceback.format_exc())
pass
except:
log.debug('Failed to download file: %s' % data.get('name'))
return False
log.debug('Failed to download file: %s' % data.get('name'))
return False
return False

Loading…
Cancel
Save