From e80155f744cf401526379b5d10c9afaab8886280 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 6 Sep 2017 21:13:00 +0200 Subject: [PATCH] add check for missing local database file --- pirate/pirate.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pirate/pirate.py b/pirate/pirate.py index c159996..1e20007 100755 --- a/pirate/pirate.py +++ b/pirate/pirate.py @@ -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)