xpock-dl: baixe vídeos do xpock.com.br (v20071030)

Publicado por Douglas Augusto 24/11/2007

[ Hits: 6.820 ]

Download xpock-dl




Xpock.com.br é um site brasileiro que provê vídeos ao estilo Youtube.com, e como este requer o plugin Flash ao passo que não fornece acesso direto aos seus vídeos.

O xpock-dl é um shell script que, dado o endereço da página de um vídeo do xpock.com.br, extrai sua URL e o baixa como um arquivo FLV (Macromedia Flash Video). Este formato de vídeo, no entanto, pode normalmente ser visualizado por programas livres como mplayer ou VLC, não sendo assim necessário o Adobe Flash.

Versão de 30/10/2007.

  



Esconder código-fonte

#!/bin/sh

#  xpock-dl - download a video file from xpock.com.br
#
#  USAGE: 
#    xpock-dl video_page_url [video1_page_url ...]
#
#  REQUIRES: curl, sh, sed, grep, basename (coreutils)

#   xpock-dl
#   Copyright (C) 2007  Douglas A. Augusto (daaugusto@gmail.com)
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.

echo "xpock-dl v20071030"

# Check dependencies
DEP="curl sed grep basename"
for d in $DEP; do
   if ! type -a $d >> /dev/null 2>&1; then echo "Error: $d is required!"; exit 1; fi
done

for i in $*
do
   echo; echo "Extracting video url from $i..."
   FLV=`curl -s -S "$i" | grep "file=" | grep -m 1 "\.flv" | \
        sed 's/.*file=\(.*.flv\).*/\1/' | sed 's/ //g'`

   if [ "$?" == "0" -a "$FLV" != "" ]; then 
      echo; echo "Saving $FLV"; 
   else 
      echo "The video url couldn't be found! Please ensure that the flash video is actually hosted on xpock.com.br"
      exit 1; 
   fi

   #OUT=`basename "$FLV"`
   OUT="`basename "$i" .flv`.flv"

   curl --progress-bar "$FLV" -o "$OUT" \
        -w "Downloaded %{size_download} bytes in %{time_total} seconds (%{speed_download}B/s).\n" 

   if [ "$?" == "0" ]; then 
      echo; echo "Video saved as: $OUT"; 
   else 
      echo "An error occurred while saving the FLV video!"; exit 1; 
   fi

done

Scripts recomendados

[Nokia-3g] Configuração do Nokia Internet Stick CS 10

Apagar arquivos maliciosos de pastas compartilhadas pelo Samba periodicamente

Selecionar wallpaper no Fluxbox (baseado no Xdialog)

Limpar arquivos da lixeira do Samba

Backup Interativo


  

Comentários
[1] Comentário enviado por leo@hotmail.com em 29/11/2007 - 15:09h

vc e show


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts