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

Problem after starting script. #26

Closed Glitchingreality closed 7 years ago

Glitchingreality commented 7 years ago

So i fire up the script - and after successfully downloading a few videos, It gets stuck with the following:

[download] 100% of 24.17MiB C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/lecture.rb:62:i n `': No such file or directory - wget https://d2vvqscadf4c1f.cloudfront.net/bS 60NpY9QUKuZZ18Tb32_871bc3d8-7e2a-4dca-b5fb-1b85583f3b45.zip -c -O 871bc3d8-7e2a- 4dca-b5fb-1b85583f3b45.zip (Errno::ENOENT) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:62:indownload_zip' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:35:in block in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:11:inblock in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:inmkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:32:in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:19:inblock (2 levels) in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:18:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:18:inblock in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:11:in block in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:inchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:17:indownload' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:12:in block (2 levels) in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:36:inblock in execute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:31:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:31:inexecute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:11:in block in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:11:inblock in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:inmkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:10:in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/stacks kills_dl.rb:8:in

'

-=-=What am i missing here?

yoonwaiyan commented 7 years ago

Are you using Command Prompt to run this? Is there any video associated with the zip file being downloaded? If yes, is that directory already exists in your downloads?

Glitchingreality commented 7 years ago

Yes, i am using Command Prompt to run this, and yes, I am trying to download a video file (zip.) from stackskills.

The 'downloads' folder in stackskills-dl-master where everything is being saved shows only folders with names that have already been downloaded successfully, with the exception of an empty folder named "-p" . I will include the entire body of my current cmd.exe output for your consideration, below: ===v======v======v======v======v======v======v======v===

C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems>cd C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems \stackskills-dl-master

C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\stackskills-dl-master>ruby stackskills_dl .rb Login Email: **@*.com Login password: ** A subdirectory or file downloads already exists. Error occurred while processing: downloads. Login Successfully. Downloading Course: Learn_GoogleGo-_Golang_Programming_for_Beginners A subdirectory or file Learn_GoogleGo-_Golang_Programming_for_Beginners alread y exists. Error occurred while processing: Learn_GoogleGo-_Golang_Programming_for_Beginn ers. Downloading Course_Introduction A subdirectory or file 01. Course_Introduction already exists. Error occurred while processing: 01. Course_Introduction. [Wistia] 1sa3d9tf1k: Downloading JSON metadata [download] WebHD_720p.mp4-1sa3d9tf1k.mp4 has already been downloaded

[download] 100% of 39.79MiB Downloading Installing_Go A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 02. Installing_Go already exists. Error occurred while processing: 02. Installing_Go. [Wistia] qbhgemv1kq: Downloading JSON metadata [download] WebHD_720p.mp4-qbhgemv1kq.mp4 has already been downloaded

[download] 100% of 32.67MiB Downloading Verifying_the_Install_with_hello.go A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 03. Verifying_the_Install_with_hello.go already exists. Error occurred while processing: 03. Verifying_the_Install_with_hello.go. [Wistia] wk7mrao7a7: Downloading JSON metadata [download] WebHD_720p.mp4-wk7mrao7a7.mp4 has already been downloaded

[download] 100% of 26.23MiB Downloading Getting_Package_Documentation A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 04. Getting_Package_Documentation already exists. Error occurred while processing: 04. Getting_Package_Documentation. [Wistia] hcime8tidn: Downloading JSON metadata [download] WebHD_720p.mp4-hcime8tidn.mp4 has already been downloaded

[download] 100% of 59.23MiB Downloading Data_Types_and_Declaration A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 05. Data_Types_and_Declaration already exists. Error occurred while processing: 05. Data_Types_and_Declaration. [Wistia] eb2ohcmqxg: Downloading JSON metadata [download] WebHD_720p.mp4-eb2ohcmqxg.mp4 has already been downloaded

[download] 100% of 27.53MiB Downloading Program_Structure_with_Global_Var_Declaration A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 06. Program_Structure_with_Global_Var_Declaration already exists. Error occurred while processing: 06. Program_Structure_with_Global_Var_Declarati on. [Wistia] fn4xh1d77r: Downloading JSON metadata [download] WebHD_720p.mp4-fn4xh1d77r.mp4 has already been downloaded

[download] 100% of 32.13MiB Downloading Declaring_Multiple_Variables_on_Single_Line A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 07. Declaring_Multiple_Variables_on_Single_Line already e xists. Error occurred while processing: 07. Declaring_Multiple_Variables_on_Single_Line . [Wistia] kg94igtlac: Downloading JSON metadata [download] WebHD_720p.mp4-kg94igtlac.mp4 has already been downloaded

[download] 100% of 16.34MiB Downloading Introduction_to_Functions A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 08. Introduction_to_Functions already exists. Error occurred while processing: 08. Introduction_to_Functions. [Wistia] bswmeel7sr: Downloading JSON metadata [download] WebHD_720p.mp4-bswmeel7sr.mp4 has already been downloaded

[download] 100% of 19.54MiB Downloading Returning_Multiple_Values_from_a_Function A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 09. Returning_Multiple_Values_from_a_Function already exi sts. Error occurred while processing: 09. Returning_Multiple_Values_from_a_Function. [Wistia] ykvuwsr9h8: Downloading JSON metadata [download] WebHD_720p.mp4-ykvuwsr9h8.mp4 has already been downloaded

[download] 100% of 20.03MiB Downloading Naming_Return_Values A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 10. Naming_Return_Values already exists. Error occurred while processing: 10. Naming_Return_Values. [Wistia] 4sgq37222m: Downloading JSON metadata [download] WebHD_720p.mp4-4sgq37222m.mp4 has already been downloaded

[download] 100% of 16.47MiB Downloading Variadic_Parameter_List A subdirectory or file -p already exists. Error occurred while processing: -p. A subdirectory or file 11. Variadic_Parameter_List already exists. Error occurred while processing: 11. Variadic_Parameter_List. [Wistia] t5a5ij43a9: Downloading JSON metadata [download] WebHD_720p.mp4-t5a5ij43a9.mp4 has already been downloaded

[download] 100% of 24.17MiB C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/lecture.rb:62:i n `': No such file or directory - wget https://d2vvqscadf4c1f.cloudfront.net/bS 60NpY9QUKuZZ18Tb32_871bc3d8-7e2a-4dca-b5fb-1b85583f3b45.zip -c -O 871bc3d8-7e2a- 4dca-b5fb-1b85583f3b45.zip (Errno::ENOENT) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:62:indownload_zip' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:35:in block in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:11:inblock in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:inmkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:32:in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:19:inblock (2 levels) in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:18:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:18:inblock in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:11:in block in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:inchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:17:indownload' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:12:in block (2 levels) in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:36:inblock in execute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:31:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:31:inexecute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:11:in block in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:11:inblock in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:10:inmkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:10:in run' from stackskills_dl.rb:8:in

'

C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\stackskills-dl-master>

-=-=~~+Thank you for your time! ;)

yoonwaiyan commented 7 years ago

Seems like the mkdir doesn't work well on Windows. I have updated the code to use another library, can you please do me a favor to delete -p folder and download again, then update me whether it works properly without -p folder this time?

Glitchingreality commented 7 years ago

Thank you for taking the time to look into this issue, I've since downloaded (& run) the updated version of your script & noticed there are no more '-p' errors, which is quite nice, unfortunately, the script still stops on the same video as last time.

I will include my current output from cmd for further consideration, below:

Login Email: ***@*.com Login password: ***** Login Successfully. Downloading Course: Learn_GoogleGo-_Golang_Programming_for_Beginners Downloading Course_Introduction [Wistia] 1sa3d9tf1k: Downloading JSON metadata [download] WebHD_720p.mp4-1sa3d9tf1k.mp4 has already been downloaded

[download] 100% of 39.79MiB Downloading Installing_Go [Wistia] qbhgemv1kq: Downloading JSON metadata [download] WebHD_720p.mp4-qbhgemv1kq.mp4 has already been downloaded

[download] 100% of 32.67MiB Downloading Verifying_the_Install_with_hello.go [Wistia] wk7mrao7a7: Downloading JSON metadata [download] WebHD_720p.mp4-wk7mrao7a7.mp4 has already been downloaded

[download] 100% of 26.23MiB Downloading Getting_Package_Documentation [Wistia] hcime8tidn: Downloading JSON metadata [download] WebHD_720p.mp4-hcime8tidn.mp4 has already been downloaded

[download] 100% of 59.23MiB Downloading Data_Types_and_Declaration [Wistia] eb2ohcmqxg: Downloading JSON metadata [download] WebHD_720p.mp4-eb2ohcmqxg.mp4 has already been downloaded

[download] 100% of 27.53MiB Downloading Program_Structure_with_Global_Var_Declaration [Wistia] fn4xh1d77r: Downloading JSON metadata [download] WebHD_720p.mp4-fn4xh1d77r.mp4 has already been downloaded

[download] 100% of 32.13MiB Downloading Declaring_Multiple_Variables_on_Single_Line [Wistia] kg94igtlac: Downloading JSON metadata [download] WebHD_720p.mp4-kg94igtlac.mp4 has already been downloaded

[download] 100% of 16.34MiB Downloading Introduction_to_Functions [Wistia] bswmeel7sr: Downloading JSON metadata [download] WebHD_720p.mp4-bswmeel7sr.mp4 has already been downloaded

[download] 100% of 19.54MiB Downloading Returning_Multiple_Values_from_a_Function [Wistia] ykvuwsr9h8: Downloading JSON metadata [download] WebHD_720p.mp4-ykvuwsr9h8.mp4 has already been downloaded

[download] 100% of 20.03MiB Downloading Naming_Return_Values [Wistia] 4sgq37222m: Downloading JSON metadata [download] WebHD_720p.mp4-4sgq37222m.mp4 has already been downloaded

[download] 100% of 16.47MiB Downloading Variadic_Parameter_List [Wistia] t5a5ij43a9: Downloading JSON metadata [download] WebHD_720p.mp4-t5a5ij43a9.mp4 has already been downloaded

[download] 100% of 24.17MiB C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/lecture.rb:62:i n `': No such file or directory - wget https://d2vvqscadf4c1f.cloudfront.net/bS 60NpY9QUKuZZ18Tb32_871bc3d8-7e2a-4dca-b5fb-1b85583f3b45.zip -c -O 871bc3d8-7e2a- 4dca-b5fb-1b85583f3b45.zip (Errno::ENOENT) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:62:indownload_zip' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:35:in block in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:13:inblock in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:12:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:12:inmkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/le cture.rb:32:in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:19:inblock (2 levels) in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:18:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:18:inblock in download' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:13:in block in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:12:inchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:12:in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse.rb:17:indownload' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:12:in block (2 levels) in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:36:inblock in execute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:31:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:31:inexecute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:11:in block in run' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:13:inblock in mkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:12:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/ut ilities.rb:12:inmkchdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/stackskills-dl-master/lib/co urse_finder.rb:10:in run' from stackskills_dl.rb:8:in

'

C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\stackskills-dl-master>

=-~=-~+`Thanks again! =-+ please let me know if there is any other information i can provide that may help.

Glitchingreality commented 7 years ago

I've tried reinstalling an older version of ruby with older gems. Still getting the same error on the same video. :/

yoonwaiyan commented 7 years ago

Hi there, sorry I couldn't debug the problem for now, it's related to directories but couldn't replicate it from my machine. Can you put this line before lib/lecture.rb:35

puts `cd`

and update me what's the output from this line? (To know what's the working directory when the zip is being downloaded)

Glitchingreality commented 7 years ago

I don't understand how I'm supposed to add puts cdto lib/lecture.rb because lib is a folder and lecture.rb is a script inside that folder.

decided to try and add puts cd to the beginning of the lecture.rb script anyway, but i don't think that's what you wanted because it messes everything up..

C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\stackskills-dl-master>ruby stackskills_dl .rb WARN: Unresolved specs during Gem::Specification.reset: unf_ext (>= 0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require' : C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/stackskills-dl-master/lib/lecture.rb:1: syntax error, unexpected keyword_class, expecting end-of-input (SyntaxError) putscdclass Lecture ^ from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54 :inrequire' from stackskills_dl.rb:4:in `

'

C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\stackskills-dl-master>

yoonwaiyan commented 7 years ago

Yep that's what I mean, put that line inside lecture.rb before line 35(before download_zip if you notice that). Not only cd but

puts `cd`
Glitchingreality commented 7 years ago

Okay I will try that now

Glitchingreality commented 7 years ago

holy shit, it's working!

Glitchingreality commented 7 years ago

I added the command you recommended ,

to line 35, where download_zip previously was (now line 36) and ran the script again. Currently downloading courses that i could not before.

yoonwaiyan commented 7 years ago

Does that mean the zip file has been downloaded successfully? Did you re-download the entire course?

That's even weirder as it shouldn't be changing any behaviour of the code or I don't understand Windows commands enough.

Glitchingreality commented 7 years ago

The script is currently still running, it did not re-download the courses which I have already downloaded previously, which is good. the videos have saved properly in their respective directories and are of good quality.

yoonwaiyan commented 7 years ago

Ok, glad it had worked for you. Closing this issue for now.