fix: .env file not being loaded before argument parser

This commit is contained in:
Puyodead1 2021-09-25 16:09:06 -04:00
parent 5915b28054
commit 6f85fdaaa1

View File

@ -978,6 +978,10 @@ def try_load_keys():
def UdemyDownloader(): def UdemyDownloader():
global udemy, course, resource global udemy, course, resource
# loads the .env file
load_dotenv()
check_dirs() check_dirs()
# Creates a new parser and sets up the arguments # Creates a new parser and sets up the arguments
@ -1000,9 +1004,6 @@ def UdemyDownloader():
# ensure 3rd party binaries are installed # ensure 3rd party binaries are installed
ensure_dependencies_installed() ensure_dependencies_installed()
# loads the .env file
load_dotenv()
udemy = Udemy(access_token=bearer_token) udemy = Udemy(access_token=bearer_token)
print("> Fetching course information, this may take a minute...") print("> Fetching course information, this may take a minute...")