Skip to content

Instantly share code, notes, and snippets.

@iphoting
Created October 12, 2012 04:23
Show Gist options
  • Save iphoting/3877286 to your computer and use it in GitHub Desktop.
Save iphoting/3877286 to your computer and use it in GitHub Desktop.
Tumblr Video Downloader
#!/usr/bin/env bash
#
# This scripts searches for a video_file link from the a Tumblr
# video premalink page and uses wget to download the video file.
#
# Requirements: curl, 7.21.2 or newer.
#
if [ -z "$1" ];
then
echo "Usage: $0 <tumblr permalink URL>"
exit 1
fi
set -e
set -o pipefail
URL=`curl -s -S -L "$1" | grep -i "video_file" | tr ' ' '\n' | grep -i video_file | sed 's|\\\\x22||g' | sed 's|^src=||g' `
echo "$URL"
set -x
#wget --content-disposition -c "$URL"
curl -L -C - -J -O "$URL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment