elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 05:15  


Tema destacado: Grupo de Facebook de elhacker.net

+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting (Moderadores: Novlucker, Leo Gutiérrez., EleKtro H@cker)
| | |-+  [Python] SharkTube: ¡Descarga vídeos de YouTube!
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Python] SharkTube: ¡Descarga vídeos de YouTube!  (Leído 819 veces)
.:WindHack:.

Desconectado Desconectado

Mensajes: 162


Prisionero de mi propia mente...


Ver Perfil WWW
[Python] SharkTube: ¡Descarga vídeos de YouTube!
« en: 23 Abril 2011, 07:22 »



SharkTube es una utilidad o aplicación gratuita que te permite descargar vídeos de YouTube.
Citar
NOTA: Esta utilidad se encuentra registrada en SafeCreative bajo la licencia Creative Commons Reconocimiento-NoComercial-CompartirIgual 3.0.

Sus características y mejoras son:
  • Más servidores de YouTube.
       
  • Disponibilidad de formatos FLV, MP4, entre otros. *
       
  • Ejecutable por línea de comandos y alternativa con Interfaz web.
  • Mejor rendimiento en la búsqueda de servidores.
  • Extracción de título, descripción y enlace corto.
  • Posibilidad de compartir el vídeo en servicios sociales.

Shark.py
Código
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#   Written by SebastiᮠCastaᯠ(.:WindHack:.)
#             DaW - Labs & Cibernodo
#   - www.daw-labs.com | | www.cibernodo.net  -
#           Version: 1.1 ( Renaissance )
#              Interactive Console
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
import urllib
import re
 
bLogo = '''
.--. .-.               .-.   .-----.    .-.
: .--'
: :               : :.-.`-. .-'    : :
`. `. : `-.  .--.  .--. : `'
.'  : :.-..-.: `-.  .--.
_`, :: .. :'
.; ; : ..': . `.  : :: :; :' .; :' '_.'
`.__.'
:_;:_;`.__,_;:_;  :_;:_;  :_;`.__.'`.__.'`.__.'
(C) DaW - Labs & Cibernodo.
 
Welcome!
NOTE: Enter -e or --end to exit the application.
       '
''
 
Char = ['%3A','%2F','%26','%2C','%3D','%252C','%253A','%7C','%3F']
By =   [':','/','&',',','=',',',':','<begin>','?']
 
 
def URLDecode(sURL):
   for i in range(len(Char)):
       sURL = sURL.replace(Char[i],By[i])
   return sURL
 
def CleanData(sData,IsHTML=True):
   if IsHTML == True:
       rReg = re.compile(r'\&.*?;')
   else:
       rReg = re.compile(r',[0-9].?')
   return rReg.sub('',sData)
 
def GetSourceCode(sURL):
   try:
       URL = urllib.urlopen(sURL)
       sSource = URL.read()
       URL.close()
       return sSource
   except:
       print '[+] Connection error.'
       exit()
 
def GetIndexVideo(sSource,Tags):
   return sSource.find(Tags)
 
def GetVideoInformation(sSource):
   sSource = sSource[2000:4500]
   sInfo = []
   #Title...
   sReg = re.findall(r'<meta property="og:title" content="(.+)">',sSource)
   sInfo.append(sReg[0])
   #Shortlink...
   sReg = re.findall(r'<link rel="shortlink" href="(.+)">',sSource)
   sInfo.append(sReg[0])
   #Description...
   sReg = re.findall(r'<meta property="og:description" content="(.+)">',sSource)
   sInfo.append(CleanData(sReg[0]))
   return sInfo
 
def GetDownloadURL(sSource,sTitle):
   sSource = sSource[10000:18000]
   Begin = GetIndexVideo(sSource,'width="640" id="movie_player" height="390"    flashvars=')+57
   sSource = sSource[Begin:]
   End = GetIndexVideo(sSource,'allowscriptaccess="always" allowfullscreen="true"')+49
   sSource = sSource[:End].split('<begin>')
   lClean = []
   sTitle = '&title='+sTitle.replace(' ','%20')+'%20[SharkTube]'
   for i in sSource:
       if i.startswith('http://v') and len(i) < 400:
           lClean.append(CleanData(i,IsHTML=False)+sTitle)
   return lClean
 
def __main__():
   print bLogo
   while 1:
       Id = raw_input('Please, enter the YouTube Id. >> ')
       if Id == '-e' or Id == '--end':
           print 'Thank you for using SharkTube. Goodbye'
           exit(1)
       else:
           if len(Id) == 11:
               try:
                   Source = URLDecode(GetSourceCode('http://www.youtube.com/watch?v='+Id))
                   lInfo = GetVideoInformation(Source)
                   URL = GetDownloadURL(Source,lInfo[0])
                   print '''
 
           -*- Video Information -*-
 
Title: %s
Shortlink: %s
Description:
%s
 
Link(s) available(s) to download:
%s
 
         '
'' % (lInfo[0],lInfo[1],lInfo[2],'\n\n'.join(URL))
               except IndexError:
                   print 'Wrong Id. Please, try again...'
           else:
               print 'The ID must be eleven characters. Try again...'
 
if __name__ == "__main__":
  __main__()

Captura


Para usar la versión de Interface Web ( Captura superior ) se debe de descargar el proyecto con todo lo necesario del siguiente enlace: http://db.tt/Jtq2sAA

Más información:
- DaW - Labs | SharkTube: ¡Descarga vídeos de YouTube!
- Cibernodo | SharkTube: ¡Descarga vídeos de YouTube!

Eso es todo, espero les sea de ayuda y le puedan sacar provecho.
Por último, agradecimiento especial a 5475UK1 por la ayuda en el diseño y creación del logo.




Saludos.,


En línea



Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Tutorial Enlace/Descarga Directa a Videos de Youtube PHP
PHP
gm-vl 0 553 Último mensaje 2 Febrero 2008, 02:39
por gm-vl
Youtube - problema con descarga de videos
Multimedia
Folker 6 2,344 Último mensaje 30 Diciembre 2008, 22:18
por ®d
Miro 3.0: visualiza vídeos en HD y descarga vídeos de YouTube
Multimedia
wolfbcn 0 681 Último mensaje 28 Marzo 2010, 01:56
por wolfbcn
Por que los videos de YouTube detienen la descarga?
Foro Libre
Psyfurius 0 953 Último mensaje 17 Agosto 2010, 10:29
por Psyfurius
[Python] WS Downloader: ¡Descarga vídeos de YouTube!
Scripting
.:WindHack:. 5 1,067 Último mensaje 19 Noviembre 2010, 02:54
por .:WindHack:.
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines