Inicio
Buscar
Ingresar
Registrarse
Starfield: el juego que revolucionará el espacio y la tecnología
Hack x Crack - Comunidad de Seguridad informática
»
Programación
»
Otros
»
Convertir Videos/Audios con python
Imprimir
Páginas: [
1
]
Ir Abajo
Autor
Tema: Convertir Videos/Audios con python (Leído 6364 veces)
R3LI4NT
{ L4 } Geek
Mensajes: 396
El poder del usuario radica en su ANONIMATO.
Convertir Videos/Audios con python
«
en:
Noviembre 23, 2020, 02:00:02 am »
Primero descargamos la librería Pafy:
Código: Text
pip3 install pafy
Y luego youtube_dl:
Código: Text
pip3 install youtube_dl
VIDEO
Código:
Código: Python
import
pafy
#URL
download_url
=
input
(
"URL del video: "
)
video
=
pafy.
new
(
download_url
)
streams
=
video.
streams
for
i
in
streams:
print
(
i
)
#Mejor resolucion
best
=
video.
getbest
(
)
print
(
best.
resolution
,
best.
extension
)
#Descarga - Directorio
best.
download
(
filepath
=
"video"
)
print
(
"Video descargado correctamente..."
)
AUDIO
Código:
Código: Python
import
pafy
download_url
=
input
(
"URL de la cancion: "
)
video
=
pafy.
new
(
download_url
)
audiostreams
=
video.
audiostreams
for
i
in
audiostreams:
print
(
i.
bitrate
,
i.
extension
,
i.
get_filesize
(
)
)
audiostreams
[
1
]
.
download
(
)
Repositorio:
https://github.com/R3LI4NT/Convertidor
«
Última modificación: Diciembre 18, 2020, 11:22:56 pm por R3LI4NT
»
En línea
No contesto dudas por MP, si las tienes, las planteas en el foro.
Road To Hacking v3:
https://github.com/R3LI4NT/road-to-hacking
Imprimir
Páginas: [
1
]
Ir Arriba
Hack x Crack - Comunidad de Seguridad informática
»
Programación
»
Otros
»
Convertir Videos/Audios con python
Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso...
OK
Learn more