Closed bharathgrk closed 7 years ago
@bharathgrk thanks for trying this out. first of all can you please make sure you have an updated repo of udemy-dl and then try again the same course and post the Screenshot here. currently i don't have macOS Sierra i 'm using macOS Mavericks on which i have already tested and it works fine. BTW sorry for the late response. i will soon update the repo.
Running into similar issue on macOS Sierra 10.13 in python:2.7.14 docker container. Was trying to download ethereum-dapp course at 720p.
[*] : Saving external links to file : links-to-visit.txt
Traceback (most recent call last):
File "udemy-dl.py", line 646, in <module>
main()
File "udemy-dl.py", line 614, in main
udemy.ExtractAndDownload(path=outto, quality=res)
File "udemy-dl.py", line 356, in ExtractAndDownload
f.write("[+] -- name {}\n[+] -- Visit {}\n".format(lecture_name, _url))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 35-36: ordinal not in range(128)
Cloned the repo using the git clone command in your readme file and tried the download again with the same result. Attaching the screenshot below. Thanks for responding.
diff --git a/udemy-dl.py b/udemy-dl.py
index cd9af9a..4ce9258 100644
--- a/udemy-dl.py
+++ b/udemy-dl.py
@@ -353,7 +353,7 @@ class UdemyDownload:
_external_links = "links-to-visit.txt"
print (fc + sd + "\n[" + fm + sb + "*" + fc + sd + "] : " + fg + sd + "Saving external links to file : {}".format(_external_links))
f = open(_external_links, "a")
- f.write("[+] -- name {}\n[+] -- Visit {}\n".format(lecture_name, _url))
+ f.write("[+] -- name {}\n[+] -- Visit {}\n".format(lecture_name, _url.encode("utf-8").strip()))
f.close()
print (fc + sd + "[" + fm + sb + "*" + fc + sd + "] : " + fg + sd + "Saved successfully..")
elif _url:
@@ -173,7 +173,7 @@ class UdemyDownload:
if _url:
with open("%s.txt" % (course), "a") as f:
- f.write("[+] -- name : %s\n[+] -- link : %s\n" % (lecture_name, _url))
+ f.write("[+] -- name : %s\n[+] -- link : %s\n" % (lecture_name, _url.encode("utf-8").strip()))
f.close()
print (fc + sd + "[" + fm + sb + "+" + fc + sd + "] : " + fg + sd + "Saved successfully.")
here is the solution of the problem. note : I tested this and works well it can be merged
@bharathgrk as i said i 'm working on new release which has the patch for this error as well. sorry for the late response.
sorry @r0oth3x49 can we speak in another place? like skype or telegram or yahoo. thanks
@bharathgrk issue is fixed now in new version.
@r0oth3x49 new version worked like a charm, thanks for the fix.
I'm having an issue while downloading the course iOS 11 & Swift 4 - The Complete iOS App Development Bootcamp. The download stopped with the following error message:
Running on python version 2.7.14 and macOS Sierra 10.12.6
Can you please look into it?