Created
January 24, 2016 16:40
-
-
Save kirbyUK/fb977fe84b758e4a02d5 to your computer and use it in GitHub Desktop.
Update MP3 tags from the command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use Getopt::Long; | |
use MP3::Tag; | |
use strict; | |
my %tags; | |
GetOptions( | |
"artist=s" => \$tags{"artist"}, | |
"album=s" => \$tags{"album"}, | |
"comment=s" => \$tags{"comment"}, | |
"genre=s" => \$tags{"genre"}, | |
"title=s" => \$tags{"title"}, | |
"track=i" => \$tags{"track"}, | |
"year=s" => \$tags{"year"} | |
); | |
my $mp3 = MP3::Tag->new($ARGV[0]) or die "Cannot open '$ARGV[0]': $!\n"; | |
$mp3->update_tags(\%tags); | |
$mp3->close; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment