Skip to content

Instantly share code, notes, and snippets.

@clamytoe
Created March 1, 2018 16:39
Show Gist options
  • Save clamytoe/513299bedb4c0e8f9766f5ce786f3ddb to your computer and use it in GitHub Desktop.
Save clamytoe/513299bedb4c0e8f9766f5ce786f3ddb to your computer and use it in GitHub Desktop.
Linux only script for downloading all of the videos for edX course HardvardX: PH526x - Using Python for Research
#!/home/mohh/anaconda3/bin/python
from collections import namedtuple
from os import system
Video = namedtuple('Video', 'name link')
videos = [
Video('0.1 - Introduction', 'https://edx-video.net/HARUPRXX2016-V000100_DTH.mp4'),
Video('1.1.1 - Python Basics', 'https://edx-video.net/HARUPRXX2016-V000200_DTH.mp4'),
Video('1.1.2 - Objects', 'https://edx-video.net/HARUPRXX2016-V000400_DTH.mp4'),
Video('1.1.3 - Modules and Methods', 'https://edx-video.net/HARUPRXX2016-V001000_DTH.mp4'),
Video('1.1.4 - Numbers and Basic Calculations', 'https://edx-video.net/HARUPRXX2016-V000900_DTH.mp4'),
Video('1.1.5 - Random Choice', 'https://edx-video.net/HARUPRXX2016-V000600_DTH.mp4'),
Video('1.1.6 - Expressions and Booleans', 'https://edx-video.net/HARUPRXX2016-V000300_DTH.mp4'),
Video('1.2.1 - Sequences', 'https://edx-video.net/HARUPRXX2016-V000500_DTH.mp4'),
Video('1.2.2 - Lists', 'https://edx-video.net/HARUPRXX2016-V000800_DTH.mp4'),
Video('1.2.3 - Tuples', 'https://edx-video.net/HARUPRXX2016-V000700_DTH.mp4'),
Video('1.2.4 - Ranges', 'https://edx-video.net/HARUPRXX2016-V002200_DTH.mp4'),
Video('1.2.5 - Strings', 'https://edx-video.net/HARUPRXX2016-V001900_DTH.mp4'),
Video('1.2.6 - Sets', 'https://edx-video.net/HARUPRXX2016-V001200_DTH.mp4'),
Video('1.2.7 - Dictionaries', 'https://edx-video.net/HARUPRXX2016-V003800_DTH.mp4'),
Video('1.3.1 - Dynamic Typing', 'https://edx-video.net/HARUPRXX2016-V002600_DTH.mp4'),
Video('1.3.2 - Copies', 'https://edx-video.net/HARUPRXX2016-V001500_DTH.mp4'),
Video('1.3.3 - Statements', 'https://edx-video.net/HARUPRXX2016-V001600_DTH.mp4'),
Video('1.3.4 - For and While Loops', 'https://edx-video.net/HARUPRXX2016-V002900_DTH.mp4'),
Video('1.3.5 - List Comprehensions', 'https://edx-video.net/HARUPRXX2016-V003100_DTH.mp4'),
Video('1.3.6 - Reading and Writing Files', 'https://edx-video.net/HARUPRXX2016-V002400_DTH.mp4'),
Video('1.3.7 - Introduction to Functions', 'https://edx-video.net/HARUPRXX2016-V002000_DTH.mp4'),
Video('1.3.8 - Writing Simple Functions', 'https://edx-video.net/HARUPRXX2016-V001400_DTH.mp4'),
Video('1.3.9 - Common Mistakes and Errors', 'https://edx-video.net/HARUPRXX2016-V002800_DTH.mp4'),
Video('2.1.1 - Scope Rules', 'https://edx-video.net/HARUPRXX2016-V005600_DTH.mp4'),
Video('2.1.2 - Classes and OOP', 'https://edx-video.net/HARUPRXX2016-V003300_DTH.mp4'),
Video('2.2.1 - Introduction to NumPy Arrays', 'https://edx-video.net/HARUPRXX2016-V006900_DTH.mp4'),
Video('2.2.2 - Slicing NumPy Arrays', 'https://edx-video.net/HARUPRXX2016-V002700_DTH.mp4'),
Video('2.2.3 - Indexing NumPy Arrays', 'https://edx-video.net/HARUPRXX2016-V001800_DTH.mp4'),
Video('2.2.4 - Building and Examining NumPy Arrays', 'https://edx-video.net/HARUPRXX2016-V003600_DTH.mp4'),
Video('2.3.1 - Introduction to Matplotlib and Pyplot', 'https://edx-video.net/HARUPRXX2016-V003500_DTH.mp4'),
Video('2.3.2 - Customizing Your Plots', 'https://edx-video.net/HARUPRXX2016-V003000_DTH.mp4'),
Video('2.3.3 - Plotting Using Logarithmic Axes', 'https://edx-video.net/HARUPRXX2016-V003400_DTH.mp4'),
Video('2.3.4 - Generating Histograms', 'https://edx-video.net/HARUPRXX2016-V001300_DTH.mp4'),
Video('2.4.1 - Simulating Randomness', 'https://edx-video.net/HARUPRXX2016-V001100_DTH.mp4'),
Video('2.4.2 - Examples Involving Randomness', 'https://edx-video.net/HARUPRXX2016-V002300_DTH.mp4'),
Video('2.4.3 - Using the NumPy Random Module', 'https://edx-video.net/HARUPRXX2016-V001700_DTH.mp4'),
Video('2.4.4 - Measuring Time', 'https://edx-video.net/HARUPRXX2016-V003200_DTH.mp4'),
Video('2.4.5 - Random Walks', 'https://edx-video.net/HARUPRXX2016-V002100_DTH.mp4'),
Video('3.1.1 - Introduction to DNA Translation', 'https://edx-video.net/HARUPRXX2016-V004700_DTH.mp4'),
Video('3.1.2 - Dowloading DNA Data', 'https://edx-video.net/HARUPRXX2016-V004200_DTH.mp4'),
Video('3.1.3 - Importing DNA Data Into Python', 'https://edx-video.net/HARUPRXX2016-V003900_DTH.mp4'),
Video('3.1.4 - Translating the DNA Sequence', 'https://edx-video.net/HARUPRXX2016-V004300_DTH.mp4'),
Video('3.1.5 - Comparing Your Translation', 'https://edx-video.net/HARUPRXX2016-V004600_DTH.mp4'),
Video('3.2.1 - Introduction to Language Processing', 'https://edx-video.net/HARUPRXX2016-V004000_DTH.mp4'),
Video('3.2.2 - Counting Words', 'https://edx-video.net/HARUPRXX2016-V004400_DTH.mp4'),
Video('3.2.3 - Reading in a Book', 'https://edx-video.net/HARUPRXX2016-V004100_DTH.mp4'),
Video('3.2.4 - Computing Word Frequency Statistics', 'https://edx-video.net/HARUPRXX2016-V004500_DTH.mp4'),
Video('3.2.5 - Reading Multiple Files', 'https://edx-video.net/HARUPRXX2016-V006400_DTH.mp4'),
Video('3.2.6 - Plotting Book Statistics', 'https://edx-video.net/HARUPRXX2016-V006000_DTH.mp4'),
Video('3.3.1 - Introduction to kNN Classification', 'https://edx-video.net/HARUPRXX2016-V005300_DTH.mp4'),
Video('3.3.2 - Finding Distance Between Two Points', 'https://edx-video.net/HARUPRXX2016-V005400_DTH.mp4'),
Video('3.3.3 - Majority Vote', 'https://edx-video.net/HARUPRXX2016-V007200_DTH.mp4'),
Video('3.3.4 - Finding Nearest Neighbors', 'https://edx-video.net/HARUPRXX2016-V004900_DTH.mp4'),
Video('3.3.5 - Generating Synthetic Data', 'https://edx-video.net/HARUPRXX2016-V006700_DTH.mp4'),
Video('3.3.6 - Making a Prediction Grid', 'https://edx-video.net/HARUPRXX2016-V005500_DTH.mp4'),
Video('3.3.7 - Plotting the Prediction Grid', 'https://edx-video.net/HARUPRXX2016-V007700_DTH.mp4'),
Video('3.3.8 - Applying the kNN Method', 'https://edx-video.net/HARUPRXX2016-V006500_DTH.mp4'),
Video('4.1.1 - Getting Started with Pandas', 'https://edx-video.net/HARUPRXX2016-V007500_DTH.mp4'),
Video('4.1.2 - Loading and Inspecting Data', 'https://edx-video.net/HARUPRXX2016-V006200_DTH.mp4'),
Video('4.1.3 - Exploring Correlations', 'https://edx-video.net/HARUPRXX2016-V007000_DTH.mp4'),
Video('4.1.4 - Clustering Whiskies By Flavor Profile', 'https://edx-video.net/HARUPRXX2016-V006100_DTH.mp4'),
Video('4.1.5 - Comparing Correlation Matrices', 'https://edx-video.net/HARUPRXX2016-V007100_DTH.mp4'),
Video('4.2.1 - Introduction to GPS Tracking of Birds', 'https://edx-video.net/HARUPRXX2016-V005100_DTH.mp4'),
Video('4.2.2 - Simple Data Visualizations', 'https://edx-video.net/HARUPRXX2016-V007400_DTH.mp4'),
Video('4.2.3 - Examining Flight Speed', 'https://edx-video.net/HARUPRXX2016-V004800_DTH.mp4'),
Video('4.2.4 - Using Datetime', 'https://edx-video.net/HARUPRXX2016-V005200_DTH.mp4'),
Video('4.2.5 - Calculating Daily Mean Speed', 'https://edx-video.net/HARUPRXX2016-V006600_DTH.mp4'),
Video('4.2.6 - Using the Cartopy Library', 'https://edx-video.net/HARUPRXX2016-V005900_DTH.mp4'),
Video('4.3.1 - Introduction to Network Analysis', 'https://edx-video.net/HARUPRXX2016-V006800_DTH.mp4'),
Video('4.3.2 - Basics of NetworkX', 'https://edx-video.net/HARUPRXX2016-V005800_DTH.mp4'),
Video('4.3.3 - Graph Visualization', 'https://edx-video.net/HARUPRXX2016-V007600_DTH.mp4'),
Video('4.3.4 - Random Graphs', 'https://edx-video.net/HARUPRXX2016-V006300_DTH.mp4'),
Video('4.3.5 - Plotting the Degree Distribution', 'https://edx-video.net/HARUPRXX2016-V005700_DTH.mp4'),
Video('4.3.6 - Descriptive Statistics of Empirical Social Networks', 'https://edx-video.net/HARUPRXX2016-V007300_DTH.mp4'),
Video('4.3.7 - Finding the Largest Connected Component', 'https://edx-video.net/HARUPRXX2016-V005000_DTH.mp4'),
Video('5.1.1 - Introduction to Statistical Learning', 'https://edx-video.net/HARUPRXX2016-V009300_DTH.mp4'),
Video('5.1.2 - Generating Example Regression Data', 'https://edx-video.net/HARUPRXX2016-V011700_DTH.mp4'),
Video('5.1.3 - Simple Linear Regression', 'https://edx-video.net/HARUPRXX2016-V009200_DTH.mp4'),
Video('5.1.4 - Least Squares Estimation in Code', 'https://edx-video.net/HARUPRXX2016-V011500_DTH.mp4'),
Video('5.1.5 - Simple Linear Regression in Code', 'https://edx-video.net/HARUPRXX2016-V011900_DTH.mp4'),
Video('5.1.6 - Multiple Linear Regression', 'https://edx-video.net/HARUPRXX2016-V011400_DTH.mp4'),
Video('5.1.7 - scikit-learn for Linear Regression', 'https://edx-video.net/HARUPRXX2016-V011600_DTH.mp4'),
Video('5.1.8 - Assessing Model Accuracy', 'https://edx-video.net/HARUPRXX2016-V012000_DTH.mp4'),
Video('5.2.1 - Generating Example Classification Data', 'https://edx-video.net/HARUPRXX2016-V010500_DTH.mp4'),
Video('5.2.2 - Logistic Regression', 'https://edx-video.net/HARUPRXX2016-V010300_DTH.mp4'),
Video('5.2.3 - Logistic Regression in Code', 'https://edx-video.net/HARUPRXX2016-V011200_DTH.mp4'),
Video('5.2.4 - Computing Predictive Probabilities Across the Grid', 'https://edx-video.net/HARUPRXX2016-V010200_DTH.mp4'),
Video('5.3.1 - Tree-Based Methods for Regression and Classification', 'https://edx-video.net/HARUPRXX2016-V011300_DTH.mp4'),
Video('5.3.2 - Random Forest Predictions', 'https://edx-video.net/HARUPRXX2016-V010400_DTH.mp4'),
]
def download_vids():
completed = 0
for video in videos:
system(f'wget -c {video.link} -O "{video.name}.mp4"')
completed += 1
print(f'Successfully downloaded {completed} videos')
if __name__ == '__main__':
download_vids()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment