Recently I got a collection of bulgarian songs with very nice filenames but no ID3 tags. So I wrote a simple script that reads a file with name like so: “trackN artist - song.mp3″, converts it to cyrillic and writes the tags.
The format of the filename can be easily changed by modifying the regex and you can add other tags as well. I knew in advance that my compilation will have 500 songs, that’s why the track numbers are set to “$track/500″. At this point is is quite custom script for my needs but can be easily changed to translate to other languages and modify other tags.
The cyrillic conversion is not perfect, but I’m too lasy to fix it as it isn’t that bad either.
#!/usr/bin/perl -w
use Data::Dumper;
use MP3::Tag;
use Encode;
-
my $filename = $ARGV[0];
my $artist;
my $track;
my $song;
-
print "Working on $filename\n";
-
@cyr = ('ч','щ','ш','ю','а','б','в','г','д','е','ж','з','и','й','к'
,'л','м','н','о','п','р','с','т','у','ф','х','ц','ъ','ь','я',
'у','Ч','Щ','Ш','Ю','А','Б','В', 'Г','Д','Е','Ж','З','И','Й',
'К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ъ','Ь','Я','У');
-
@lat = ('ch','sht','sh','iu','a','b','v','g','d','e','j','z','i','j',
'k','l','m','n','o','p','r','s','t','u','f','h','c','y','y',
'q','w','Ch','Sht','Sh','Iu','A','B','V', 'G','D','E','J','Z',
'I','J','K','L','M','N','O','P','R','S','T','U','F','H','C','Y','Y','Q','W');
-
sub trim($)
{
my $string = shift;
$string =~ s/^\s+//;
$string =~ s/\s+$//;
return $string;
}
-
$temp=$filename;
$temp=~s/\.mp3//gi;
if ($temp =~ m/([\d]{3})\s+(.+\s*.+)\s?-\s?(.+\s?.+)/)
{
$track = $1;
$artist = $2;
$song = $3;
}
my $retext = "$track $artist - $song";
print $retext."\t";
$i = 0;
while($i < @lat) {
$l = $lat[$i];
$c = $cyr[$i];
$artist=~s/$l/$c/g;
$song=~s/$l/$c/g;
-
#print $l."\t".$c."\n";
$i++;
}
-
-
$songname = "$track ".trim($artist)." - ".trim($song);
print $songname."\n";
-
$mp3 = MP3::Tag->new($filename);
$mp3->get_tags;
my $id3v2 = $mp3->new_tag("ID3v2");
$id3v2->add_frame('TRCK', "$track/500");
$id3v2->add_frame('TIT2', decode('UTF-8',$song));
$id3v2->add_frame('TPE1', decode('UTF-8',$artist));
$id3v2->write_tag;
-
The first big concert from the Bulgarian music idol was not bad. I think Rusina and Boyan did the best job of all. I especially liked Boyan for his performance. On the other hand the hosts, the drama around the abuse and the two roma guys is a bit too much for my linking. All in all was a good concert though.
Because the weather is starting to worm up, I decided to store the rest of my sauerkraut. The easiest way, of course, is to freeze it and that is what I did. I left 40-50 whole leaves for stuffed cabbage, and the rest (from 8 whole cabbage heads) prepared directly for cooking.
I also left 2 heads outside to see how well it stays good so I know next year.
I hope it is still good after thawing it, but I don’t think there will be problems by freezing it.

Since I got a bread machine I’ve been experimenting with this bulgarian sweet bread that everyone I know loves. I tries a few recipes and decorations. I’ve never twisted? this bread before and since now didn’t realize that one thread disappears visually.



3 threads, 4 threads and 4 threads baked


4 threads, 4 threads baked in the bread maker
Of course, I’ve made bread in the machine as well.

Yesterday I went to play badminton. I’ve never played before by the rules (and didn’t know them). All in all was quite a bit of running around.
The bad part was it is not in Stamford and it is $15 bucks per person for 2 hours of play, which I think is not cheap.
According to the Orthodox calendar, today is the day of St. Hrisant and Daria, thus our sweet Dary has a so called name day. We wish her good luck and all the best (hug).
BTW According to other sources Darina also has a name day on Todor’s name day, and I’ve heard on Christmas as well?…
Good luck Dari
I think I have not blogged about it yet (I have not posted anything in a while …). For a few months now, I’ve been going to this climbing gym once a week, doing some bouldering in the beginning and now top roping as well. I wasn’t expecting it to be so physically demanding activity. Every time after a workout, my muscles cannot recover for a couple a days. I’m still a beginner and not very good at it yet. I can boulder at most V3 (I did one V4 last week) and top rope at most 5.9.
Last week I got new climbing shoes, because it turned out I shouldn’t be wearing socks and the shoes should be snug fit, mine were pretty loose even with socks so… Unfortunately, now I have to pass the break-in period of the new shoes. I hope it happens faster rather than later. When it gets warmer I might visit one of the near by outdoors climbing locations (The Gunks is a couple of hours drive and it seems to be quite famous in the NE US).
My books on the Yangjia Michuan Taiji Quan form arrived recently. I also got a video with the demonstration of the form and some tips, but it is in mandarin, so … can’t use it yet. I will start to read the books tho, which are both english and chinese.