Skip to content

Instantly share code, notes, and snippets.

@nna774
Created July 26, 2019 23:02
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 nna774/5535121741b3e57a6171cd961a47caf5 to your computer and use it in GitHub Desktop.
Save nna774/5535121741b3e57a6171cd961a47caf5 to your computer and use it in GitHub Desktop.
#! /bin/bash -xe
BUCKET='gs://nana-youtube'
TEMPDIR=$(mktemp -d)
DATE=$(date +%s)
./youtube-dl -v -o "${TEMPDIR}/${DATE}-%(title)s-%(id)s.%(ext)s" "$1"
./youtube-dl -J "$1" | tee "${TEMPDIR}/${DATE}.json"
gsutil cp "${TEMPDIR}/*" ${BUCKET}
rm -fr ${TEMPDIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment