Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
fixed #451 ..
Browse files Browse the repository at this point in the history
  • Loading branch information
r0oth3x49 committed Nov 18, 2019
1 parent 0f8d01f commit a553b52
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions udemy-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,18 @@ def main():
f_in = open(options.cookies)
cookies = '\n'.join([line for line in (l.strip() for l in f_in) if line])
f_in.close()
if options.cache:
cache_credentials(username="", password="", quality=options.quality, output=options.output)
udemy = Udemy(url=options.course, cookies=cookies)
if not options.cache:
config = use_cached_credentials()
if config and isinstance(config, dict):
sys.stdout.write (fc + sd + "[" + fm + sb + "*" + fc + sd + "] : " + fg + sd + "Loading configs..")
options.quality = config.get('quality')
options.output = config.get('output')
time.sleep(1)
sys.stdout.write ("\r" + fc + sd + "[" + fm + sb + "*" + fc + sd + "] : " + fg + sd + "Loading configs.. (" + fc + sb + "done" + fg + sd + ")\n")
sys.stdout.flush()
if options.list and not options.save:
try:
udemy.course_list_down(chapter_number=options.chapter, lecture_number=options.lecture, unsafe=options.unsafe)
Expand Down

0 comments on commit a553b52

Please sign in to comment.