Magic indentations baby!
This commit is contained in:
1 parent
936e216f11
commit
0655b30a3d
1 file changed
+19
-19
@@ -19,29 +19,29 @@ class Blackhole(Downloader):
|
|||||||
log.error('No directory set for blackhole %s download.' % data.get('type'))
|
log.error('No directory set for blackhole %s download.' % data.get('type'))
|
||||||
else:
|
else:
|
||||||
try:
|
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:
|
if "no nzb" in file:
|
||||||
log.error('No nzb available!')
|
log.error('No nzb available!')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
fullPath = os.path.join(directory, self.createFileName(data, file, movie))
|
fullPath = os.path.join(directory, self.createFileName(data, file, movie))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.isfile(fullPath):
|
if not os.path.isfile(fullPath):
|
||||||
log.info('Downloading %s to %s.' % (data.get('type'), fullPath))
|
log.info('Downloading %s to %s.' % (data.get('type'), fullPath))
|
||||||
with open(fullPath, 'wb') as f:
|
with open(fullPath, 'wb') as f:
|
||||||
f.write(file)
|
f.write(file)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
log.info('File %s already exists.' % fullPath)
|
log.info('File %s already exists.' % fullPath)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log.error('Failed to download to blackhole %s' % traceback.format_exc())
|
log.error('Failed to download to blackhole %s' % traceback.format_exc())
|
||||||
pass
|
pass
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log.debug('Failed to download file: %s' % data.get('name'))
|
log.debug('Failed to download file: %s' % data.get('name'))
|
||||||
return False
|
return False
|
||||||
return False
|
return False
|
||||||
Reference in new issue
Block a user