From 728a78d53bb13eda601022fabcefb7a242926e6d Mon Sep 17 00:00:00 2001 From: "Don C. Bigler" Date: Mon, 15 Aug 2022 12:18:35 -0400 Subject: [PATCH 1/3] Remove unused import statements. --- gen_conf_downloader.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gen_conf_downloader.py b/gen_conf_downloader.py index 97cb6fe..a5a2c99 100644 --- a/gen_conf_downloader.py +++ b/gen_conf_downloader.py @@ -13,10 +13,8 @@ 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 From 92682256000e6ea4c375897c23953e6d37535896 Mon Sep 17 00:00:00 2001 From: "Don C. Bigler" Date: Mon, 15 Aug 2022 12:42:28 -0400 Subject: [PATCH 2/3] BUGFIX: Force CLI only when GUI is not available. --- gen_conf_downloader.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gen_conf_downloader.py b/gen_conf_downloader.py index a5a2c99..354a845 100644 --- a/gen_conf_downloader.py +++ b/gen_conf_downloader.py @@ -18,7 +18,11 @@ 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 @@ -665,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() From a5e4505ac24e80d2d5f057fb1a464f37505b3e99 Mon Sep 17 00:00:00 2001 From: "Don C. Bigler" Date: Mon, 15 Aug 2022 18:03:45 -0400 Subject: [PATCH 3/3] FIX: Set start default to min_year. --- gen_conf_downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen_conf_downloader.py b/gen_conf_downloader.py index 354a845..a739f11 100644 --- a/gen_conf_downloader.py +++ b/gen_conf_downloader.py @@ -640,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)