Skip to content

Instantly share code, notes, and snippets.

@ongspxm
Last active October 30, 2018 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ongspxm/1d708dc072a20452d0d0eef06262f16d to your computer and use it in GitHub Desktop.
Save ongspxm/1d708dc072a20452d0d0eef06262f16d to your computer and use it in GitHub Desktop.
download videos from viu using youtube-dl
# run with the starting index like so: `dload 5`
# first url on the list will be index-ed 5
# pipe in list of urls
i=$1
if [ -d $1 ]; then i=1; fi
while read f; do
name=$(echo $f | tr "/" "\n" | tail -n 1)
youtube-dl "$f" --sub-lang English --write-sub -o $name-$i.mp4
i=$(( $i+1 ))
done
// gets full list of the url from the playlist, in the right order
console.log([].slice.call(document.querySelectorAll('.video-alllist a')).map(a=>a.href).reverse().join('\n'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment