Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 19, 2020 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/00c0888282009af35f2fd2a0e8277032 to your computer and use it in GitHub Desktop.
Save parzibyte/00c0888282009af35f2fd2a0e8277032 to your computer and use it in GitHub Desktop.
contador = 0
with open(archivo) as lista:
for linea in lista:
linea_sin_salto = linea.rstrip()
busqueda = artista + linea_sin_salto
nombre_salida = linea_sin_salto
if argumentos.artista:
nombre_salida = directorio + "/" + linea_sin_salto
else:
nombre_salida = linea_sin_salto
nombre_salida = nombre_salida + ".%(ext)s"
print("Buscando '{}'... ".format(busqueda), end="")
comando = """youtube-dl --output \"""" + nombre_salida + \
"""\" --extract-audio --audio-format mp3 \"ytsearch1:{}\"""".format(
busqueda)
check_output(comando)
print("[OK]")
contador = contador + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment