Blackhold

Descargar vídeos de vimeo pro

Posted on febrer 2nd, 2012 by admin

Pues vimeopro, es como vimeo, pero con un pro detrás :P

Primero de todo tenemos un vídeo en vimeopro, tendremos que conseguir acceder al vídeo tal cual:

Teniendo por ejemplo éste vídeo:

http://vimeopro.com/staff/originals/video/23156561

vamos al código y localizamos el vínculo para aislarlo del resto del interfaz de vimeo:

http://player.vimeo.com/video/23156561?portfolio_id=168

y eliminamos la parte ?portfolio_id=168 y nos quedará así:

http://player.vimeo.com/video/23156561

finalmente ejecutamos éste script (Descarga)

#!/bin/sh
#
# Vimeo Downloader
#
# Copyright (C) 2008, 2010  Denver Gingerich
# Copyright (C) 2009  Jori Hamalainen
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


if [ $# -ne 1 ]; then
	echo "Vimeo Downloader v0.3.1"
	echo "by Denver Gingerich (http://ossguy.com/)"
	echo "    with script improvements by Jori Hamalainen"
	echo
	echo "Usage: $0 "
	exit 1
fi
VIMEO_ID=`echo $1 | awk -F / '{print $NF}'`

which wget
if [ $? -eq 0 ]; then
	echo "Using wget..."
	GET_CMD="wget -O -"
else
	which curl
	if [ $? -eq 0 ]; then
		echo "Using curl..."
		GET_CMD="curl -L"
	else
		echo "Could not find wget or curl"
		exit 2
	fi
fi

which perl
if [ $? -eq 0 ]; then
	echo "Using perl..."
	USING_PERL=1
else
	echo "Using sed..."
	USING_PERL=0
fi

VIDEO_XML=`${GET_CMD} http://www.vimeo.com/moogaloop/load/clip:${VIMEO_ID}`

if [ $USING_PERL -eq 1 ]; then
	REQUEST_SIGNATURE=`echo $VIDEO_XML | perl -p -e 's:^.*?(.*?).*$:$1:g'`
	REQUEST_SIGNATURE_EXPIRES=`echo $VIDEO_XML | perl -p -e 's:^.*?(.*?).*$:$1:g'`
	CAPTION=`echo $VIDEO_XML | perl -p -e 's:^.*?(.*?).*$:$1:g'`
	ISHD=`echo $VIDEO_XML |  perl -p -e 's:^.*?(.*?).*$:$1:g'`

	if [ ${ISHD} -eq 1 ]; then
		ISHD="hd"
	else
		ISHD="sd"
	fi

	# caption can contain bad characters (like '/') so don't use it for now
	#FILENAME="${CAPTION}-(${ISHD}${VIMEO_ID}).flv"

	FILENAME="${VIMEO_ID}-${ISHD}.flv"
else
	REQUEST_SIGNATURE=`echo $VIDEO_XML | sed -e 's/^.*([^<]*)<.*$/1/g'`
	REQUEST_SIGNATURE_EXPIRES=`echo $VIDEO_XML | sed -e 's/^.*([^<]*) "${FILENAME}"
echo "Video ${VIMEO_ID} saved to ${FILENAME}"
echo `file "${FILENAME}"`
echo

Y lo ejecutamos de esta forma:

# ./download_vimeo.sh http://player.vimeo.com/video/23156561

Este post simplemente muestra técnicamente como hacerlo, no incita a la descarga de vídeos con licencias con copyright, esto ya es una cuestión ética de cada persona.

This entry was posted on dijous, febrer 2nd, 2012 at 00:27 and is filed under bash. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Descargar vídeos de vimeo pro”

oskoctubre 29th, 2012 at 19:05

me gustaria que este un poco mas explicado el método, que aun no se como, ni de donde ejecutar el script apreciaría tu ayuda. o algun link de como hacerlo

Leave a Response

« »

guy fawkes