mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-04-30 17:14:24 +02:00
Limit the max characters for course and lecture names to 255 due to windows having a max of 260
This commit is contained in:
parent
4ac49ec30d
commit
d9a72c8878
7
main.py
7
main.py
@ -1111,7 +1111,7 @@ def parse_new(_udemy, quality, skip_lectures, dl_assets, dl_captions,
|
|||||||
print(f"Lecture(s) ({total_lectures})")
|
print(f"Lecture(s) ({total_lectures})")
|
||||||
|
|
||||||
course_name = _udemy.get("course_title")
|
course_name = _udemy.get("course_title")
|
||||||
course_dir = os.path.join(download_dir, course_name)
|
course_dir = os.path.join(download_dir, course_name[:255])
|
||||||
if not os.path.exists(course_dir):
|
if not os.path.exists(course_dir):
|
||||||
os.mkdir(course_dir)
|
os.mkdir(course_dir)
|
||||||
|
|
||||||
@ -1137,7 +1137,7 @@ def parse_new(_udemy, quality, skip_lectures, dl_assets, dl_captions,
|
|||||||
html_content = lecture.get("html_content").encode(
|
html_content = lecture.get("html_content").encode(
|
||||||
"ascii", "ignore").decode("utf8")
|
"ascii", "ignore").decode("utf8")
|
||||||
lecture_path = os.path.join(
|
lecture_path = os.path.join(
|
||||||
chapter_dir, "{}.html".format(sanitize(lecture_title)))
|
chapter_dir, "{}.html".format(sanitize(lecture_title)[:255]))
|
||||||
try:
|
try:
|
||||||
with open(lecture_path, 'w') as f:
|
with open(lecture_path, 'w') as f:
|
||||||
f.write(html_content)
|
f.write(html_content)
|
||||||
@ -1327,8 +1327,7 @@ if __name__ == "__main__":
|
|||||||
"--concurrent-downloads",
|
"--concurrent-downloads",
|
||||||
dest="concurrent_downloads",
|
dest="concurrent_downloads",
|
||||||
type=int,
|
type=int,
|
||||||
help=
|
help="The number of maximum concurrent downloads for segments (HLS and DASH, must be a number 1-30)",
|
||||||
"The number of maximum concurrent downloads for segments (HLS and DASH, must be a number 1-30)",
|
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--skip-lectures",
|
"--skip-lectures",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user