Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Split big pseudo zip-archive from prostopleer.com into small mp3 files.
#!/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;
}
@shoorick

This comment has been minimized.

Copy link
Owner Author

commented Dec 4, 2013

in Russian

Разбивает большие файлы *.zip с сайта ProstoPleer.com (на самом деле не являющиеся ZIP-архивами) на отдельные MP3-файлы.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.