Closed JacquesvanWyk closed 6 years ago
What's the folder name being created?
Hi, I have the same problem on Windows 7, have tried a few different "youtube-dl" gems but no success so far. Tested with ruby-youtube-dl, youtubeDL, youtube-dl.rb (0.3.1.2016.09.11.1) It creates folders for the course but then stops at this error.
folder names is for example: C:\Users\xxxx\Documents\stackskills-dl\downloads\JavaScript_Programming_Complete\00. Introduction and Syntax\01. Promo
ruby-youtube-dl seems to get the closest to actualy downloading, but it stops with this error:
Downloading Internal_JavaScript
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-youtube-dl-0.0.5/bin/ruby-youtube-dl
:3:in ``': Exec format error - C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-youtu
be-dl-0.0.5/bin/youtube-dl.py --restrict-filenames https://fast.wistia.net/embed
/iframe/0unuxm3l5d (Errno::ENOEXEC)
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-youtube-dl-0.0.5/bin/ru
by-youtube-dl:3:in `<top (required)>'
from C:/Ruby24-x64/bin/ruby-youtube-dl:22:in `load'
from C:/Ruby24-x64/bin/ruby-youtube-dl:22:in `<main>'
@Aikio, for Windows, please install youtube-dl
via the official website here instead of using wrapped gems. Please update me whether it works after installing from the official source.
I tried this, but the exe file for windows does not seem to be compatible as such.
It's not an installer.
Or I am not sure how to edit lecture.rb to use the youtube-dl.exe correctly.
When running the exe file directly this is the message you get.
Usage: youtube-dl.exe [OPTIONS] URL [URL...]
youtube-dl.exe: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
Hmm is it mandatory to execute youtube-dl
without .exe
? I think we'll need some workaround to make youtube-dl work.
For your case, I think it'll be putting the youtube.exe in the same folder as stackskills_dl.rb. If .exe
is mandatory to run youtube-dl in Windows, please change line 57 of lib/lecture.rb from youtube-dl
to youtube-dl.exe
and try running the script again.
Not sure whether this works, but I'll appreciate your few minutes of time to try it out and update me if this quick hack works. Thanks in advance.
According to youtube-dl github page, you'll need to place it in your system folder:
Windows users can download an .exe file and place it in any location on their PATH except for %SYSTEMROOT%\System32 (e.g. do not put in C:\Windows\System32).
After placing it in the System32 folder I get this message:
Downloading Internal_JavaScript Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings'
Current thread 0x00001b80 (most recent call first):
Downloading Access_HTML_with_Commenting_Functionality_in_JavaScript C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:229:in
mkdir': Invalid argument @ dir _s_mkdir - 01. Get Access on Web Content |Better understanding of JS (Errno::EIN VAL) from C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:229:in
fu_mkdir' from C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:207:inblock (2 levels) in mkdir_p' from C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:205:in
reverse_each' from C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:205:in `block in mkdir_p'from C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:191:in `each' from C:/Ruby24-x64/lib/ruby/2.4.0/fileutils.rb:191:in `mkdir_p' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:11:in `m
kchdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/lecture.rb:36:in
dow nload' from C:/Users/xxxx/Documents/stackskills-dl/lib/course.rb:24:in
bloc k (2 levels) in download' from C:/Users/xxxx/Documents/stackskills-dl/lib/course.rb:23:ineach ' from C:/Users/xxxx/Documents/stackskills-dl/lib/course.rb:23:in
bloc k in download' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:13:inb lock in mkchdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:12:in
c hdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:12:inm kchdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/course.rb:22:in
down load' from C:/Users/xxxx/Documents/stackskills-dl/lib/course_finder.rb:13:i nblock (2 levels) in run' from C:/Users/xxxx/Documents/stackskills-dl/lib/course_finder.rb:41:i n
block in execute' from C:/Users/xxxx/Documents/stackskills-dl/lib/course_finder.rb:36:i neach' from C:/Users/xxxx/Documents/stackskills-dl/lib/course_finder.rb:36:i n
execute' from C:/Users/xxxx/Documents/stackskills-dl/lib/course_finder.rb:12:i nblock in run' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:13:in
b lock in mkchdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:12:inc hdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/utilities.rb:12:in
m kchdir' from C:/Users/xxxx/Documents/stackskills-dl/lib/course_finder.rb:11:i nrun' from stackskills_dl.rb:11:in
'
For the first issue, you can refer to this issue in youtube-dl: https://github.com/rg3/youtube-dl/issues/10372 or Google for the solution, it's related to Python instead of this repo.
For the second issue, please try change line 18 of lib/course_section.rb to @name = Utilities.escape_chars(@name.strip)
and run again, suspecting the error comes from unicode issues in Windows.
It created the folders but wont go further.
@JacquesvanWyk What's the output you get when you put puts self.name
after line 49 in lib/lecture.rb?
Hi again.
According to youtube-dl github page, you'll need to place it in your system folder:
Windows users can download an .exe file and place it in any location on their PATH except for >%SYSTEMROOT%\System32 (e.g. do not put in C:\Windows\System32).
You cannot place it in the System32 folder. What you have to do is place it in any other folder (I chose the Stackskills_dl folder) and then add the path to the youtube-dl.exe file in Environmental variables under PATH (I.e. C:\Users\xxxx\Documents\stackskills-dl)
My issue with Python was solved by uninstalling python from my laptop and restarting windows.
So to summarize; To get it to work on my Win7 Computer you have to download the youtube-dl.exe file and add the path to the program to environmental variables... (anywhere except System folder) Change line 57 in lecture.rb from
puts `youtube-dl --restrict-filenames #{video_url}`
to puts
youtube-dl.exe --restrict-filenames #{video_url}
Change line 18 in course_section.rb from
@name = @name.strip to @name = Utilities.escape_chars(@name.strip)
Thank you for the script and all the help :)
@JacquesvanWyk Sorry it's been a while. I've pushed the fix as suggested to @Aikio, does this solves your issue?
Closing this for now as there's no newer response. Please re-open the issue if the problem persists, thanks.
Good Day
I have gotten this to work but now i get this error
What does this mean?I have youtube-dl also in main directory but am stuck now.It does actually create folders but then that error.