16 lines
345 B
Python
Executable File
16 lines
345 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
# extracts cover from flac audio file
|
|
|
|
from mutagen.flac import FLAC, Picture
|
|
|
|
song = "cover.flac"
|
|
|
|
var = FLAC(song)
|
|
pics = var.pictures
|
|
print (pics)
|
|
for p in pics:
|
|
if p.type == 3: #front cover
|
|
print("\nfound front cover")
|
|
with open("cover.jpg", "wb") as f:
|
|
f.write(p.data) |