1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

add check for missing local database file

This commit is contained in:
Michele Guerini Rocco 2017-09-06 21:13:00 +02:00
parent 127bf8bdfb
commit e80155f744
Signed by: rnhmjoj
GPG Key ID: 91BE884FBA4B591A

View File

@ -322,7 +322,12 @@ def pirate_main(args):
# fetch torrents
if args.source == 'local_tpb':
results = pirate.local.search(args.database, args.search)
if os.path.isfile(args.database):
results = pirate.local.search(args.database, args.search)
else:
printer.print("Local pirate bay database doesn't exist.",
'(%s)' % args.database, color='ERROR')
sys.exit(1)
elif args.source == 'tpb':
try:
results, site = search_mirrors(printer, args)