def nondbshow(search_string, count, ignore): """Download anything, ignoring the database. This just does a simple search and passes you choise to the bittorrent client. The download is not recorded in the database. """ if not search_string: raise click.UsageError('Empty "search_string" not allowed.') if not ignore and (Config.email or Config.ip): L = Location() if Config.email: if not L.getipintel(): warning = click.style('Warning:', bg='red', fg='white', bold=True) msg = '{warning} not connected to a VPN' click.echo(msg.format(warning=warning)) sys.exit(1) if Config.ip: if not L.ips_match(Config.ip, parts_to_match=Config.parts_to_match): L.message() sys.exit(1) nons = Show(show_type='nondb') nons.non_db(search_string, count)
def download(show_name, today, ignore, count): """Download available episodes. If SHOW_NAME is used, it will download any shows that match that title """ if not ignore and (Config.email or Config.ip): L = Location() if Config.email: if not L.getipintel(): warning = click.style('Warning:', bg='red', fg='white', bold=True) msg = '{warning} not connected to a VPN' click.echo(msg.format(warning=warning)) sys.exit(1) if Config.ip: if not L.ips_match(Config.ip, parts_to_match=Config.parts_to_match): L.message() sys.exit(1) shows = Shows(name_filter=show_name) for show in shows: show.download_missing(count, today)