Created
March 22, 2015 14:43
-
-
Save ynott/36c1e2caa4a7751de8a8 to your computer and use it in GitHub Desktop.
get coursera materials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MATERIAL_NO='ml-005' | |
START_NO=1 | |
END_NO=114 | |
for NUM in $(seq ${START_NO} ${END_NO}) | |
do | |
curl -L -O --remote-header-name "https://class.coursera.org/${MATERIAL_NO}/lecture/download.mp4?lecture_id=${NUM}" | |
curl -L -O --remote-header-name "https://class.coursera.org/${MATERIAL_NO}/lecture/subtitles?q=${NUM}_ja&format=srt" | |
done | |
for file in $(ls *.{srt,mp4}) ; do | |
decode_fn="$(echo -n -e "$(echo "${file}" | sed 's/+/ /g;s/%\(..\)/\\x\1/g;' )")" | |
decode_fn="$(echo "${decode_fn}" | sed 's/\//_/g;')" | |
mv "${file}" "${decode_fn}"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MATERIAL_NO=
に
コースのVideo Lectures パスを入れてください。