print('Problem inserting data into database: {}'.format(e)) sys.exit(0) print('Copying movie data into db...') with open('db/initial/movies.json', encoding='utf-8', errors='ignore') as f: data = json.load(f) chunks = [data[x:x + 500] for x in range(0, len(data), 500)] try: for chunk in chunks: engine.execute(Movie.__table__.insert(), chunk) except Exception as e: print('Problem inserting data into database: {}'.format(e)) sys.exit(0) print('Copying large pre data into db...') try: nzedb_pre_import.largeNzedbPre() except Exception as e: print('Problem inserting data into database: {}'.format(e)) sys.exit(0) print('Copying small pre data into db...') try: nzedb_pre_import.nzedbPre() except Exception as e: print('Problem inserting data into database: {}'.format(e)) sys.exit(0) if config.postprocess.get('regex_url'): print('Updating regex...') pynab.util.update_regex() else: print('Could not update regex - no update url/key in config.py.') print(
def test_update_pres(self): from scripts.nzedb_pre_import import largeNzedbPre, nzedbPre largeNzedbPre() nzedbPre()
print('Problem inserting data into database: {}'.format(e)) sys.exit(0) if config.postprocess.get('regex_url'): print('Updating regex...') pynab.util.update_regex() else: print('Could not update regex - no update url/key in config.py.') print('If you don\'t have one, buy a Newznab+ license or find your own regexes.') print('You won\'t be able to build releases without appropriate regexes.') if config.postprocess.get('blacklist_url'): print('Updating binary blacklist...') pynab.util.update_blacklist() else: print( 'Could not update blacklist. Try the URL in config.py manually - if it doesn\'t work, post an issue on Github.') print('Copying pre data into db...') try: nzedb_pre_import.largeNzedbPre() nzedb_pre_import.nzedbPre() except Exception as e: print('Problem inserting data into database: {}'.format(e)) sys.exit(0) end = time.time() print('Install complete in {:.2f}s'.format(end - start)) print('Now: activate some groups, activate desired blacklists, and run pynab.py with python3.')