Created
January 18, 2017 22:43
-
-
Save paveljurca/7d03cb5f2edc558acf9bd01133394aec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use strict; | |
use warnings; | |
# SINGLE | |
# perl iradio.pl 20min_marketa_pravdova_cestina.mp3 | |
# MULTI | |
# perl iradio.pl ladislav_hejdanek_dopisy_priteli_ | |
my $name = shift; | |
die unless $name; | |
my ($list) = $name =~ /_(\d+)$/; | |
$name =~ s/_\d+$//; | |
for (<>) { | |
chomp; | |
next unless $_ // m|^http|; | |
s/prehravac/media/; | |
s/audio/_audio/; | |
system 'curl', '-o', ($name . ( $list ? ('_'.$list++) : '') . '.mp3'), $_; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment