diff --git a/chaineTV.py b/chaineTV.py index f0092d8..f5b2e05 100644 --- a/chaineTV.py +++ b/chaineTV.py @@ -67,8 +67,13 @@ class Interface: def load_jsonfile(file): - with open(file, 'r', encoding='utf-8') as f: - return json.load(f) + try: + with open(file, 'r', encoding='utf-8') as f: + return json.load(f) + except FileNotFoundError: + parsechaine(file) + with open(file, 'r', encoding='utf-8') as f: + return json.load(f) def RepresentsInt(s): try: