yoonwaiyan / stackskills-dl

Simple Ruby script to download all StackSkills tutorials.
https://yoonwaiyan.github.io/stackskills-dl/
MIT License
59 stars 19 forks source link

Error with download of zip-file #32

Closed tobias-p closed 6 years ago

tobias-p commented 6 years ago

Hi, at first: thanks for this awesome skript.

I get an error at one of my course. The lecture has a video and a zip file.

This is the error message:

C:/Dev/stackskills-dl/lib/lecture.rb:70:in ``': No such file or directory - wget https://d2vvqscadf4c1f.cloudfront.net/FiBez5MlSLysyVqYYhJf_Project-Files.zip -c -O Project-Files.zip (Errno::ENOENT)
        from C:/Dev/stackskills-dl/lib/lecture.rb:70:in `download_zip'
        from C:/Dev/stackskills-dl/lib/lecture.rb:39:in `block in download'
        from C:/Dev/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from C:/Dev/stackskills-dl/lib/lecture.rb:36:in `download'
        from C:/Dev/stackskills-dl/lib/course.rb:24:in `block (2 levels) in download'
        from C:/Dev/stackskills-dl/lib/course.rb:23:in `each'
        from C:/Dev/stackskills-dl/lib/course.rb:23:in `block in download'
        from C:/Dev/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from C:/Dev/stackskills-dl/lib/course.rb:22:in `download'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:13:in `block (2 levels) in run'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:41:in `block in execute'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:36:in `each'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:36:in `execute'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:12:in `block in run'
        from C:/Dev/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:11:in `run'
        from ./stackskills_dl.rb:11:in `<main>'

Hope you can help me, will provide more information if needed.

EDIT: Now also had a problem with a video... seems like I have problems with wget.

C:/Dev/stackskills-dl/lib/lecture.rb:55:in ``': No such file or directory - wget https://d2vvqscadf4c1f.cloudfront.net/51ZRMiRFyCgP2BrGXJ6g_1001%20Course%20Conclusion.mp4 -c -O Course_Conclusion.mp4 (Errno::ENOENT)
        from C:/Dev/stackskills-dl/lib/lecture.rb:55:in `download_video'
        from C:/Dev/stackskills-dl/lib/lecture.rb:37:in `block in download'
        from C:/Dev/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from C:/Dev/stackskills-dl/lib/lecture.rb:36:in `download'
        from C:/Dev/stackskills-dl/lib/course.rb:24:in `block (2 levels) in download'
        from C:/Dev/stackskills-dl/lib/course.rb:23:in `each'
        from C:/Dev/stackskills-dl/lib/course.rb:23:in `block in download'
        from C:/Dev/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from C:/Dev/stackskills-dl/lib/course.rb:22:in `download'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:13:in `block (2 levels) in run'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:41:in `block in execute'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:36:in `each'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:36:in `execute'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:12:in `block in run'
        from C:/Dev/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from C:/Dev/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from C:/Dev/stackskills-dl/lib/course_finder.rb:11:in `run'
        from ./stackskills_dl.rb:11:in `<main>'
yoonwaiyan commented 6 years ago

Do you have wget installed in your system? Seems to be related to issue #26 . Do check out the issue and try out the workarounds, otherwise the output of the puts is appreciated to debug the problem. Thanks in advance.

tobias-p commented 6 years ago

already installed wget on my machine, will test the workaround of issue #26 later.

just as a thought: is it possible on ruby to check for the os? if yes, maybe you could add an os check and add the workaround for windows users ;)

yoonwaiyan commented 6 years ago

There are many similar issues being reported but still couldn't find out what's the problem as I didn't get a lot of response from issues :( . If we managed to find out the problem then I can do OS check with the fix.

tobias-p commented 6 years ago

OK, I will provide as much information as I can, to help solving this problem ;)... just have to do some things for now, can check in about 3 hours your workaround and will have a look at the wget problem

tobias-p commented 6 years ago

well... had a lot more to do than I thought, so here's my current status:

I still have problems downloading the zip file. Have tried the workaround which you recommended. Maybe I installed wget wrong? (installed it as ruby gem I think)

EDIT: Remembered that I also had installed it normally... Checked if wget was registered as system variable.. added it to path now... will check later if now everything runs fine.

tobias-p commented 6 years ago

hello again. here's my update:

seems like adding wget to path helped to - more or less - be able to download the files...

now have following problem: " [download] 100% of 20.03MiB SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc --2017-09-12 19:05:21-- https://d2vvqscadf4c1f.cloudfront.net/FiBez5MlSLysyVqYYhJf_Project-Files.zip Auflösen des Hostnamen »d2vvqscadf4c1f.cloudfront.net«.... 13.32.218.165, 13.32.218.42, 13.32.218.240, ... Verbindungsaufbau zu d2vvqscadf4c1f.cloudfront.net|13.32.218.165|:443... verbunden. FEHLER: Kann das Zertifikat von »d2vvqscadf4c1f.cloudfront.net« nicht prüfen, ausgestellt von »/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4«:. Die Authorität des Ausstellers des Zertifikates kann lokal nicht geprüft werden. Verwenden Sie »--no-check-certificate«, um zu dem Server »d2vvqscadf4c1f.cloudfront.net« eine nicht gesicherte Verbindung aufzubauen. Es ist nicht möglich, eine SSL-Verbindung herzustellen. "

The translation of the german part is: " ERROR: Cannot verify the certificate "d2vvqscadf4c1c1f. cloudfront. net" issued by "/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4":. The authority of the certificate issuer cannot be verified locally. Use "--no-check-certificate" to connect to the server "d2vvqscadf4c1c1f. cloudfront. net". It is not possible to establish an SSL connection. "

Should I add the "--no-check-certificate" to the command you used within the script?

EDIT: Added the "--no-check-cetificate" to the command... now everything seems to run fine

yoonwaiyan commented 6 years ago

Sorry for the late reply and thanks so much for all the updates! Apparently wget is the most common problem among Windows users. May I know where did you add the no-check-certificate, so that I can update the codebase for other Windows users?

Pull request is welcomed too if you don't mind ;)

yoonwaiyan commented 6 years ago

Just made a commit 4ac9ed73b1df9d7df91b8e5a44ee035ae94cd1a7 to add the flag in wget commands. Closing this issue now.