Treehouse Video Downloader downloads videos (with optional subtitles) from the specified Treehouse courses and workshops.
Install all dependencies:
pip install -r requirements.txt
or install them separately
pip install requests
pip install youtube_dl
pip install beautifulsoup4
- Add your credentials to
main.py
file
USERNAME = 'your_username'
PASSWORD = 'your_password'
- define the courses/workshops you would like to download in the
links.txt
file. Example list of the courses/workshops is already in the file. - Go to file directory where
main.py
andlinks.txt
are saved and runmain.py
from the terminal with:python main.py
- Wait until all videos are downloaded and have fun watching them.
If the download of the video fails, the course URL will be saved in log.txt
.
If you would like to:
- download the subtitles of the videos set
SUBTITLES = True
. They are not downloaded by default. - download ONLY subititles and not the videos set
SUBTITLES = True
and comment out the line that downloads the video
# ydl.download([videolink])
The default video format is webm, but you can
also get mp4 files, just change VIDEO_FORMAT = 'mp4'
in the main.py
script.
One of the users noticed mp4 video format downloads only 30 sec clips so test it to make sure mp4 format is available for a particular course.
Default downloader is aria2c
. If you wish to change it, edit EXTERNAL_DL = 'aria2c'
You can extend the script by adding options in the options
variable:
options = {
'outtmpl': output,
'external_downloader': EXTERNAL_DL
# ,'verbose': True
}
Here is the list of all options (however not all of them work): https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L129-L290
Feel free to experiment and test.
You can upgrade youtube-dl
with sudo -H pip install --upgrade youtube-dl
Upgraded on 4 May with 2 functions from project https://github.com/dx0x58/Treehouse-dl
Script was tested with the youtube-dl 2019.4.30
and Python 3.6.7
.