Anon-Exploiter / ine-dl

Python script to download INE courses including labs, exercises, quizzes, slides, and, videos!
MIT License
17 stars 8 forks source link

Error while downloading course (local variable referenced before assignment) #5

Closed dreamxps closed 2 years ago

dreamxps commented 2 years ago
`2022-08-30 11:28:58 | ERROR     | An error has been caught in function '<module>', process 'MainProcess' (1597), thread 'MainThread' (140601955780416):
Traceback (most recent call last):

> File "ine.py", line 1021, in <module>
    main()
    └ <function main at 0x7fe06fddd670>

  File "ine.py", line 1002, in main
    download_course(course_dl)
    │               └ {'id': '80a726f2-6cbc-44fd-9a9f-70210f42ac65', 'tags': ['Network Security', 'Offensive Security'], 'images': {'main_image_url...
    └ <function download_course at 0x7fe06fddd5e0>

  File "ine.py", line 873, in download_course
    download_video(name, content_uuid, complete_path, index)
    │              │     │             │              └ '01'
    │              │     │             └ 'OSCP Security Technology Prep Course/01 - Course/13 - Capstone'
    │              │     └ '0b065ff8-569c-4bc7-aa4f-9b819b1258ff'
    │              └ 'OSCP Security Technology Prep Course'
    └ <function download_video at 0x7fe06fddd280>

  File "ine.py", line 403, in download_video
    if not os.path.isfile(f"{complete_path}/{video_name}") or os.path.isfile(f"{complete_path}/{video_name}.aria2"):
           │  │    │                                          │  │    └ <function isfile at 0x7fe0715e9d30>
           │  │    │                                          │  └ <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'>
           │  │    │                                          └ <module 'os' from '/usr/lib/python3.8/os.py'>
           │  │    └ <function isfile at 0x7fe0715e9d30>
           │  └ <module 'posixpath' from '/usr/lib/python3.8/posixpath.py'>
           └ <module 'os' from '/usr/lib/python3.8/os.py'>

UnboundLocalError: local variable 'video_name' referenced before assignment`
Anon-Exploiter commented 2 years ago

Can reproduce the issue. Will probably push a fix soon, thanks for reporting!

image

For any future issues can you also please include the arguments you launched the script with? Thanks!

Anon-Exploiter commented 2 years ago

https://github.com/Anon-Exploiter/ine-dl/commit/6276eba21032f2d558581700a46481eb272b49d4 fixes the issue. Please pull the latest source and try again.

image