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

Receiving following errors: Permission denied @ dir_chdir - Enrolled (Errno::EACCES) #43

Closed linux95 closed 5 years ago

linux95 commented 5 years ago

Just started to received the following error attempting to download course:

[user@dockerf stackskills-dl]$ ruby stackskills_dl.rb -u "username@email.com" -p "pass" -c https://stackskills.com/courses/enrolled/107858
Loaded login credentials from environment variables.
Login Successfully.
Finding https://stackskills.com/courses/enrolled/107858 from your list of courses
Number of courses found: 1
Downloading Course: Enrolled
/home/user/stackskills-dl/lib/utilities.rb:12:in `chdir': Permission denied @ dir_chdir - Enrolled (Errno::EACCES)
        from /home/user/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from /home/user/stackskills-dl/lib/course.rb:22:in `download'
        from /home/user/stackskills-dl/lib/course_finder.rb:13:in `block (2 levels) in run'
        from /home/user/stackskills-dl/lib/course_finder.rb:41:in `block in execute'
        from /home/user/stackskills-dl/lib/course_finder.rb:36:in `each'
        from /home/user/stackskills-dl/lib/course_finder.rb:36:in `execute'
        from /home/user/stackskills-dl/lib/course_finder.rb:12:in `block in run'
        from /home/user/stackskills-dl/lib/utilities.rb:13:in `block in mkchdir'
        from /home/user/stackskills-dl/lib/utilities.rb:12:in `chdir'
        from /home/user/stackskills-dl/lib/utilities.rb:12:in `mkchdir'
        from /home/user/stackskills-dl/lib/course_finder.rb:11:in `run'
        from stackskills_dl.rb:11:in `<main>'

Let me know if you need more info. Thanks.

yoonwaiyan commented 5 years ago

This is a permission denied problem for folders, can you make sure your downloads folder has a correct permission? From your log it seems to me that you run the command explicitly without using any docker command, so I'm guessing you're not building from Dockerfile that's provided in the codebase.

linux95 commented 5 years ago

yoonwaiyan, You assumption was correct. It appears that I had a previous download that left an errant file with incorrect permissions. For some reason, everytime you download a new course, it is named with "Enrolled" as the title. You have to download each course individually and rename the "Enrolled" directory to the correct course name. This has been happening for awhile now. Anyway, I removed the directory and now the course downloads correctly. Thanks again for your help.

yoonwaiyan commented 5 years ago

The "Enrolled" directory issue has been fixed for now, apparently caused by how scraper read the title differently as the layout has changed. I'll close this issue for now, let me know if the "Enrolled" folder issue persists.