2
2
import configparser
3
3
import os
4
4
import logging
5
-
5
+ import sys
6
6
7
7
from . import globals
8
8
from . import logger
@@ -27,8 +27,9 @@ def validate_settings():
27
27
logger .warn ("Falling back to default path: {:s}" .format (globals .config .config_path ), pre_config = True )
28
28
logger .separator (pre_config = True )
29
29
elif not os .path .isfile (globals .config .config_path ):
30
+ logger .banner (log_only = True )
30
31
helpers .new_config ()
31
- validate_succeeded = False
32
+ sys . exit ( 0 )
32
33
33
34
if validate_succeeded :
34
35
globals .config .config_path = os .path .realpath (globals .config .config_path )
@@ -131,21 +132,20 @@ def __init__(self, prog):
131
132
parser .add_argument ('-na' , '--no-assemble' , dest = 'no_assemble' , action = 'store_true' , help = "Do not assemble the downloaded livestream segments into a video file. Overrides the configuration file setting." )
132
133
133
134
globals .args , unknown_args = parser .parse_known_args ()
135
+ validate_success = validate_settings ()
134
136
135
137
if unknown_args :
136
138
logger .warn ("The following unknown argument(s) were provided and will be ignored." , pre_config = True )
137
- logger .warn (' ' + ' ' .join (unknown_args ), pre_config = True )
139
+ logger .warn (' ' + ' ' .join (unknown_args ))
138
140
logger .separator (pre_config = True )
139
141
140
142
if not any (vars (globals .args ).values ()):
141
143
logger .error ("No known arguments were provided." , pre_config = True )
142
144
logger .separator (pre_config = True )
143
- return
145
+ validate_success = False
144
146
145
- validate_success = validate_settings ()
146
147
if globals .config .log_to_file :
147
148
logger ._log_to_file (None , pre_config = True )
148
-
149
149
150
150
if validate_success :
151
151
if globals .args .download or globals .args .download_following :
@@ -175,3 +175,4 @@ def __init__(self, prog):
175
175
elif globals .args .info :
176
176
helpers .show_info ()
177
177
logger .separator ()
178
+
0 commit comments