Created
December 4, 2013 10:08
-
-
Save shoorick/7785185 to your computer and use it in GitHub Desktop.
Split big pseudo zip-archive from prostopleer.com into small mp3 files.
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 -0777 -n | |
=head1 DESCRIPTION | |
Split big pseudo zip-archive from prostopleer.com into small mp3 files. | |
=head1 USAGE | |
./split-prostopleer.pl big-pseudo.zip | |
=head1 SEE ALSO | |
L<< https://gist.github.com/shoorick/7785185 >> | |
=head1 AUTHOR | |
Alexander Sapozhnikov | |
L<< http://shoorick.ru/ >> | |
L<< E<lt>shoorick@cpan.orgE<gt> >> | |
=cut | |
binmode(STDIN); | |
my $divisor = "ID3\x04\x00"; | |
my @chunks = split $divisor; | |
shift @chunks; | |
my $i = 1; | |
foreach my $chunk ( @chunks ) { | |
open(my $fh, '>', sprintf('%02d.mp3', $i++)) | |
or die "cannot open for writing: $!"; | |
print $fh $divisor, $chunk; | |
close $fh; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in Russian
Разбивает большие файлы *.zip с сайта ProstoPleer.com (на самом деле не являющиеся ZIP-архивами) на отдельные MP3-файлы.