diff --git a/gen_conf_downloader.py b/gen_conf_downloader.py index 97cb6fe..a739f11 100644 --- a/gen_conf_downloader.py +++ b/gen_conf_downloader.py @@ -13,14 +13,16 @@ import re import shutil import sys -import threading import colorama -from collections import defaultdict from collections import namedtuple import html as html_tools from html.parser import HTMLParser -import PySimpleGUI as sg +CLI_ONLY = False +try: + import PySimpleGUI as sg +except ImportError: + CLI_ONLY = True from tqdm import tqdm from urllib.parse import unquote_plus from urllib.parse import quote_plus @@ -638,7 +640,7 @@ def write_mp3_to_disk(data, filename): default=3) parser.add_argument('-start', type=int, help='First year to download. Note: not all historic sessions are available in all languages', - default=max_year - 5) + default=min_year) parser.add_argument('-end', type=int, help='Last year to download (defaults to present year).', default=max_year) @@ -667,7 +669,7 @@ def write_mp3_to_disk(data, filename): args.cache_home = cache_home validate_args(args) - if len(sys.argv) > 1 and args.nogui: + if CLI_ONLY or (len(sys.argv) > 1 and args.nogui): # Initialize colorama colorama.init()