Skip to content

Instantly share code, notes, and snippets.

@akashnimare
Last active January 9, 2024 10:00
Show Gist options
  • Star 42 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save akashnimare/a572e336e071af9bfd9f117876a78816 to your computer and use it in GitHub Desktop.
Save akashnimare/a572e336e071af9bfd9f117876a78816 to your computer and use it in GitHub Desktop.
Download Frontend Master courses video. Note: This is for learning purpose only. Please don't mis-use it.
# Requirements
* Python 2.7
* Google Chrome
* ChromeDriver - WebDriver for Chrome
- Download the latest chromedrive which is 2.28 from here - https://sites.google.com/a/chromium.org/chromedriver/downloads
- Extract and move `chromedriver` file to `/usr/local/bin/chromedriver`
- git clone https://github.com/li-xinyang/OS_FrontendMaster-dl
- cd OS_FrontendMaster-dl
- pip install -r requirements.txt
- python frontendmasters-dl.py --id YOUR-USERNAME --password YOUR-PASSWORD --course COURSE-ID
# Example
- python frontendmasters-dl.py --id myusername --password mypass --course good-parts-javascript-web
- All videos will be saved in ./Download directory
@esparkman
Copy link

Have you thought of a way to grab Workshop videos?

@agungsetiawan
Copy link

pip install -r requirements.txt didn't work for me
I did this instead pip install -r requirements.txt --user

@akashnimare
Copy link
Author

@esparkman not yet.

@ssanusi
Copy link

ssanusi commented Oct 18, 2017

Traceback (most recent call last):
File "frontendmasters-dl.py", line 21, in
downloader()
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "frontendmasters-dl.py", line 9, in downloader
spider = Spider()
File "/OS_FrontendMaster-dl/extractor/spider.py", line 22, in init
self.browser = webdriver.Chrome()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in init
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 151, in init
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: session not created exception: Chrome version must be >= 60.0.3112.0
(Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.13.0 x86_64)

@ssanusi
Copy link

ssanusi commented Oct 18, 2017

anybody can help me with the above error

@asollberger
Copy link

asollberger commented Nov 6, 2017

@agungsetiawan already answered that
pip install -r requirements.txt --user

@nmassi
Copy link

nmassi commented Nov 29, 2017

Traceback (most recent call last):
File "frontendmasters-dl.py", line 1, in
import click
File "/Users/nico/Library/Python/2.7/lib/python/site-packages/click/init.py", line 18, in
from .core import Context, BaseCommand, Command, MultiCommand, Group,
File "/Users/nico/Library/Python/2.7/lib/python/site-packages/click/core.py", line 8, in
from .types import convert_type, IntRange, BOOL
File "/Users/nico/Library/Python/2.7/lib/python/site-packages/click/types.py", line 4, in
from ._compat import open_stream, text_type, filename_to_ui,
File "/Users/nico/Library/Python/2.7/lib/python/site-packages/click/_compat.py", line 2, in
import io
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in
import _io
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

Copy link

ghost commented Nov 30, 2017

Traceback (most recent call last):
File "frontendmasters-dl.py", line 2, in
from extractor.spider import Spider
File "/home/okeefe77/.tmp/OS_FrontendMaster-dl/extractor/spider.py", line 1, in
from bs4 import BeautifulSoup
File "/usr/lib/python2.7/dist-packages/bs4/init.py", line 30, in
from .builder import builder_registry, ParserRejectedMarkup
File "/usr/lib/python2.7/dist-packages/bs4/builder/init.py", line 314, in
from . import _html5lib
File "/usr/lib/python2.7/dist-packages/bs4/builder/_html5lib.py", line 70, in
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'

@MahbbRah
Copy link

MahbbRah commented Dec 4, 2017

WOW, Thanks for this gist. It really helped me! 👍

@aykutyunus2
Copy link

UnboundLocalError: local variable 'course_path' referenced before assignment
any idea?

@aykutyunus2
Copy link

Login with your credential
Downloading course: javascript-foundations
Traceback (most recent call last):
File "frontendmasters-dl.py", line 24, in
downloader()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "frontendmasters-dl.py", line 17, in downloader
spider.download(course, high_resolution, video_per_video)
File "/Users/aykut/Documents/OS_FrontendMaster-dl/extractor/spider.py", line 52, in download
course_downloadbale = self._get_downloadable_links(course_detailed_list, high_resolution, video_per_video)
File "/Users/aykut/Documents/OS_FrontendMaster-dl/extractor/spider.py", line 155, in _get_downloadable_links
i1, i2, subsection, section_title, course_path
UnboundLocalError: local variable 'course_path' referenced before assignment

@hzhu
Copy link

hzhu commented Jan 1, 2018

UnboundLocalError: local variable 'course_path' referenced before assignment

Same issue here.

@geirman
Copy link

geirman commented Jan 6, 2018

>>> Login with your credential
>>> Downloading course: testing-javascript/introduction
Traceback (most recent call last):
  File "frontendmasters-dl.py", line 24, in <module>
    downloader()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "frontendmasters-dl.py", line 17, in downloader
    spider.download(course, high_resolution, video_per_video)
  File "/Users/{username}/dev/node/OS_FrontendMaster-dl/extractor/spider.py", line 49, in download
    course_detailed_list = self._get_detailed_course_list(course)
  File "/Users/{username}/dev/node/OS_FrontendMaster-dl/extractor/spider.py", line 75, in _get_detailed_course_list
    sections_items = sections.find_all(
AttributeError: 'NoneType' object has no attribute 'find_all'

@geirman
Copy link

geirman commented Jan 6, 2018

Ok, I got this working. I can't really explain why this works, but after taking these steps the videos did indeed download for me.

  1. Open extractor/spider.py
  2. On line 74, change 'CourseToc' to 'CourseInfo'
  3. Run the script (e.g. python frontendmasters-dl.py --id YOUR-USERNAME --password YOUR-PASSWORD --course COURSE-ID)
  4. On line 74, change 'CourseInfo' back to 'CourseToc'
  5. Run the script again. This time it worked for me.

I don't know Python, but love how easy it is to read. I noticed there's a spider.pyc file that appears to be a compiled version of the 'spider.py` file. So, my best guess is that changing anything caused it to recompile and that's what actually resolved the issue. But this is just a guess.

UPDATE: I spoke to a friend who knows Python and he thought it's a pretty good guess that the pyc file is the culprit. You might want to simply delete that file and let the py compile itself straight off. That's essentially what I did by changing the py file. The one in the repo is probably compiled with a slightly different setup than I have, so it errored.

@nehamonga12
Copy link

Getting below message:

Login with your credential
Downloading course: react
Retrieving: react/Complete_Introduction_to_React_v3/Introduction
429: You have reached maximum request limit. Sleeping for 15 minutes

Any thoughts?

@lavshah
Copy link

lavshah commented Jan 22, 2018

I was not able to download videos due to same errors specified by @geirman.
But I managed to get all the links in .csv file. and after then you can download the videos using link.
If anyone can create script for that created .csv files to autodownload videos it will be great.
Thanks in advanced if anyone could help.!

@digvijay442
Copy link

digvijay442 commented Mar 16, 2018

Not able to download the course.........facing SSL certificate issue...............

[0316/150902.789:ERROR:gpu_process_transport_factory.cc(1009)] Lost UI shared context.
[0316/150902.794:ERROR:instance.cc(49)] Unable to locate service manifest for metrics
[0316/150904.749:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics

Login with your credential
Downloading course: javascript-hard-parts
[0316/150932.653:INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://embedwistia-a.akamaihd.net will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://frontendmasters.com/courses/javascript-hard-parts/ (0)
Retrieving: javascript-hard-parts/JavaScript_The_Hard_Parts/Introduction
Video URL: http://placehold.it/500x500
Retrieving: javascript-hard-parts/Principles_of_JavaScript/Global_Execution_Context
[0316/150957.634:ERROR:instance.cc(49)] Unable to locate service manifest for metrics
[0316/150957.636:ERROR:service_manager.cc(890)] Failed to resolve service name: metrics

@it-sumanp
Copy link

it-sumanp commented Apr 8, 2018

Can anyone helpme with this ?

Traceback (most recent call last):
File "frontendmasters-dl.py", line 24, in
downloader()
File "/Users/sumanpatra/Library/Python/2.7/lib/python/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Users/sumanpatra/Library/Python/2.7/lib/python/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/sumanpatra/Library/Python/2.7/lib/python/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/sumanpatra/Library/Python/2.7/lib/python/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "frontendmasters-dl.py", line 12, in downloader
spider = Spider(mute_audio)
File "/Users/sumanpatra/PlayGround/OS_FrontendMaster-dl/extractor/spider.py", line 34, in init
self.browser = webdriver.Chrome(chrome_options=options)
File "/Users/sumanpatra/Library/Python/2.7/lib/python/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in init
self.service.start()
File "/Users/sumanpatra/Library/Python/2.7/lib/python/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 20] Not a directory

@vjrngn
Copy link

vjrngn commented Apr 17, 2018

Downloading this version of chromedriver fixed the issue for me.

@ankitbtanna
Copy link

Frontend masters are able to trace if we are downloading via script :( any solition?

@Mr-Usman
Copy link

Repository does not exist anymore!

@akashnimare
Copy link
Author

If you have a student college email ID sign up for the GitHub education pack and connect your GitHub with the Frontend Masters account. You'll get six months free 🚀

@dabsclement
Copy link

Is the above download script applicable for windows users?

@Mahe-git2hub
Copy link

does anybody the github repo's content. I beleive the repo was removed.

@ekodikara
Copy link

They will ban your account if they can track your are downloding the videos.
Check this: kyoz/fem-downloader#1

@adeleke5140
Copy link

Won't the user get banned from using this?

@Maricaya
Copy link

Maricaya commented Mar 3, 2021

Repository does not exist anymore! Does anybody know the new address?

@Coursefree
Copy link

Thankyou so much Provide this information to us. It is really helpful for me. Create Chatbot Using Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment