elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [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 3,158 veces)
.:WindHack:.

Desconectado Desconectado

Mensajes: 167

Prisionero de mi propia mente...


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



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
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  4. #   Written by SebastiᮠCastaᯠ(.:WindHack:.)
  5. #             DaW - Labs & Cibernodo
  6. #   - www.daw-labs.com | | www.cibernodo.net  -
  7. #           Version: 1.1 ( Renaissance )
  8. #              Interactive Console
  9. # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  10.  
  11. import urllib
  12. import re
  13.  
  14. bLogo = '''
  15. .--. .-.               .-.   .-----.    .-.
  16. : .--': :               : :.-.`-. .-'    : :
  17. `. `. : `-.  .--.  .--. : `'.'  : :.-..-.: `-.  .--.
  18. _`, :: .. :' .; ; : ..': . `.  : :: :; :' .; :' '_.'
  19. `.__.':_;:_;`.__,_;:_;  :_;:_;  :_;`.__.'`.__.'`.__.'
  20. (C) DaW - Labs & Cibernodo.
  21.  
  22. Welcome!
  23. NOTE: Enter -e or --end to exit the application.
  24.        '''
  25.  
  26. Char = ['%3A','%2F','%26','%2C','%3D','%252C','%253A','%7C','%3F']
  27. By =   [':','/','&',',','=',',',':','<begin>','?']
  28.  
  29.  
  30. def URLDecode(sURL):
  31.    for i in range(len(Char)):
  32.        sURL = sURL.replace(Char[i],By[i])
  33.    return sURL
  34.  
  35. def CleanData(sData,IsHTML=True):
  36.    if IsHTML == True:
  37.        rReg = re.compile(r'\&.*?;')
  38.    else:
  39.        rReg = re.compile(r',[0-9].?')
  40.    return rReg.sub('',sData)
  41.  
  42. def GetSourceCode(sURL):
  43.    try:
  44.        URL = urllib.urlopen(sURL)
  45.        sSource = URL.read()
  46.        URL.close()
  47.        return sSource
  48.    except:
  49.        print '[+] Connection error.'
  50.        exit()
  51.  
  52. def GetIndexVideo(sSource,Tags):
  53.    return sSource.find(Tags)
  54.  
  55. def GetVideoInformation(sSource):
  56.    sSource = sSource[2000:4500]
  57.    sInfo = []
  58.    #Title...
  59.    sReg = re.findall(r'<meta property="og:title" content="(.+)">',sSource)
  60.    sInfo.append(sReg[0])
  61.    #Shortlink...
  62.    sReg = re.findall(r'<link rel="shortlink" href="(.+)">',sSource)
  63.    sInfo.append(sReg[0])
  64.    #Description...
  65.    sReg = re.findall(r'<meta property="og:description" content="(.+)">',sSource)
  66.    sInfo.append(CleanData(sReg[0]))
  67.    return sInfo
  68.  
  69. def GetDownloadURL(sSource,sTitle):
  70.    sSource = sSource[10000:18000]
  71.    Begin = GetIndexVideo(sSource,'width="640" id="movie_player" height="390"    flashvars=')+57
  72.    sSource = sSource[Begin:]
  73.    End = GetIndexVideo(sSource,'allowscriptaccess="always" allowfullscreen="true"')+49
  74.    sSource = sSource[:End].split('<begin>')
  75.    lClean = []
  76.    sTitle = '&title='+sTitle.replace(' ','%20')+'%20[SharkTube]'
  77.    for i in sSource:
  78.        if i.startswith('http://v') and len(i) < 400:
  79.            lClean.append(CleanData(i,IsHTML=False)+sTitle)
  80.    return lClean
  81.  
  82. def __main__():
  83.    print bLogo
  84.    while 1:
  85.        Id = raw_input('Please, enter the YouTube Id. >> ')
  86.        if Id == '-e' or Id == '--end':
  87.            print 'Thank you for using SharkTube. Goodbye'
  88.            exit(1)
  89.        else:
  90.            if len(Id) == 11:
  91.                try:
  92.                    Source = URLDecode(GetSourceCode('http://www.youtube.com/watch?v='+Id))
  93.                    lInfo = GetVideoInformation(Source)
  94.                    URL = GetDownloadURL(Source,lInfo[0])
  95.                    print '''
  96.  
  97.            -*- Video Information -*-
  98.  
  99. Title: %s
  100. Shortlink: %s
  101. Description:
  102. %s
  103.  
  104. Link(s) available(s) to download:
  105. %s
  106.  
  107.          ''' % (lInfo[0],lInfo[1],lInfo[2],'\n\n'.join(URL))
  108.                except IndexError:
  109.                    print 'Wrong Id. Please, try again...'
  110.            else:
  111.                print 'The ID must be eleven characters. Try again...'
  112.  
  113. if __name__ == "__main__":
  114.   __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

Follow me on Twitter: @windhack | Visit my website: www.daw-labs.com

"The only thing they can't take from us are our minds."
angrisano

Desconectado Desconectado

Mensajes: 1


Ver Perfil
¡Descarga vídeos de YouTube!
« Respuesta #1 en: 22 Marzo 2014, 20:35 pm »

Hola espero que os sirva a todos los que queráis bajar videos de Youtube.
Hay un programa que es muy sencillo y no tiene ningún problema en descargar los videos, música y todo lo que queráis de Youtube.
Este programa lo estoy usando ni me acuerdo ya. Y a mi siempre me ha ido de maravilla.
Se llama: YTD Video Downloader.
No os puedo mandar el enlace porque en este momento no lo encuentro. Un saludo y hasta pronto.


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 1,758 Último mensaje 2 Febrero 2008, 02:39 am
por gm-vl
Youtube - problema con descarga de videos
Multimedia
Folker 6 4,840 Último mensaje 30 Diciembre 2008, 22:18 pm
por ®d
Miro 3.0: visualiza vídeos en HD y descarga vídeos de YouTube
Multimedia
wolfbcn 0 3,461 Último mensaje 28 Marzo 2010, 01:56 am
por wolfbcn
Por que los videos de YouTube detienen la descarga?
Foro Libre
Psyfurius 0 2,573 Último mensaje 17 Agosto 2010, 10:29 am
por Psyfurius
[Python] WS Downloader: ¡Descarga vídeos de YouTube!
Scripting
.:WindHack:. 5 4,135 Último mensaje 19 Noviembre 2010, 02:54 am
por .:WindHack:.
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines