#!/usr/bin/perl use MP3::Tag; $file=shift; if($file eq '') { print "Usage: picturegetter.pl \n"; } if(!-e $file) { die("Cannot open $file"); #hey loser, you didnt give a real file or something } $mp3=MP3::Tag->new($file); ($song,$track,$artist,$album)=$mp3->autoinfo(); #autoinfo rox if(exists $mp3->{ID3v2}) { ($data,$j)=$mp3->{ID3v2}->get_frame("APIC"); $pic=$$data{"_Data"}; #i hope its pr0n! if($pic) { open(FIL,">$artist - $album.jpg"); binmode(FIL); print FIL $pic; close(FIL); print "Found! Saved as $artist - $album.jpg\n"; #probably not pr0n though } else { die("ID3v2 Tag found, but no APIC data!\n"); #agh...im dead! } } else{ die("Error! No ID3v2 tag found!\n"); #agh...im double dead } $mp3->close();