Skip to content

Instantly share code, notes, and snippets.

@Marlysson
Created May 16, 2018 16:47
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 Marlysson/c7460389845a19e2dd011ea758453df1 to your computer and use it in GitHub Desktop.
Save Marlysson/c7460389845a19e2dd011ea758453df1 to your computer and use it in GitHub Desktop.
import sys
from urllib import urlretrieve
from mutagen.mp3 import MP3
file_musics = sys.argv[1]
with open(file_musics) as file_music:
url_musics = [link.strip() for link in file_music.readlines()]
for url_music in url_musics:
filename, headers = urlretrieve(url_music)
audio = MP3(filename)
print audio.info.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment