Skip to content

Instantly share code, notes, and snippets.

@ynott
Created March 22, 2015 14:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ynott/36c1e2caa4a7751de8a8 to your computer and use it in GitHub Desktop.
Save ynott/36c1e2caa4a7751de8a8 to your computer and use it in GitHub Desktop.
get coursera materials
#!/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
@ynott
Copy link
Author

ynott commented Mar 22, 2015

MATERIAL_NO=

コースのVideo Lectures パスを入れてください。

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