Created
October 12, 2012 04:23
-
-
Save iphoting/3877286 to your computer and use it in GitHub Desktop.
Tumblr Video Downloader
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
#!/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