#! /usr/bin/perl ########################################################################### # This is an example script that sends external metadata to streamripper. # It implements an external program that: # 1) Fetches a web page # 2) Searches the web page for the artist and title information # 3) Sends the information to streamripper # # To invoke the script, do this: # streamripper URL -E "perl fetch_external_metadata.pl META_URL" # # This assumes that META_URL is the URL with the artist/title information # # You will need perl and LWP::Simple installed to run this script. # On unix, you install LWP::Simple as root, like this: # perl -MCPAN -e 'install LWP::Simple'; # On windows, LWP::Simple is included in the ActiveState perl distribution. # # This script is in the public domain. You are free to use, modify and # redistribute without restrictions. ########################################################################### use LWP::Simple; if ($#ARGV != 0) { die "Usage: fetch_external_metadata.pl URL\n"; } $url = $ARGV[0]; while (1) { my $content = get $url; if ($content =~ m/title="(.*)" artist="(.*)"/) { $title = "TITLE=$1\n"; $artist = "ARTIST=$2\n"; $end_of_record = ".\n"; $meta_data = $title . $artist . $end_of_record; syswrite (STDOUT, $meta_data, length($meta_data)); } sleep (10); }
streamripper URL -E "perl fetch_external_metadata.pl META_URL"
title="name" artist="track_artist"
if ($content =~ m/title="(.*)" artist="(.*)"/) {
title="" artist=""
/usr/name/2017-09-03/15:55:45 - artist - title.mp3
-D /usr/name/`date +%Y-%m-%d`
-D "/usr/name/`date +%Y-%m-%d/%T` - %A - %T"
perl -MCPAN -e 'install LWP::Simple'
-D "/usr/name/`date +%Y-%m-%d/%H:%M:%S` - %A - %T"
-D "/usr/name/`date +%F/%T` - %A - %T"
sudo streamripper URL -E "perl /путь к скрипту/fetch_external_metadata.pl **********
#! /usr/bin/perl ########################################################################### # This is an example script that sends external metadata to streamripper. # It implements an external program that: # 1) Fetches a web page # 2) Searches the web page for the artist and title information # 3) Sends the information to streamripper # # To invoke the script, do this: # streamripper URL -E "perl fetch_external_metadata.pl META_URL" # # This assumes that META_URL is the URL with the artist/title information # # You will need perl and LWP::Simple installed to run this script. # On unix, you install LWP::Simple as root, like this: # perl -MCPAN -e 'install LWP::Simple'; # On windows, LWP::Simple is included in the ActiveState perl distribution. # # This script is in the public domain. You are free to use, modify and # redistribute without restrictions. ########################################################################### use LWP::Simple; if ($#ARGV != 0) { die "Usage: fetch_external_metadata.pl URL\n"; } $url = $ARGV[0]; while (1) { my $content = get $url; if ($content =~ m/title="(.*)" artist="(.*)"/) { $title = "TITLE=$1\n"; $artist = "ARTIST=$2\n"; $end_of_record = ".\n"; $meta_data = $title . $artist . $end_of_record; syswrite (STDOUT, $meta_data, length($meta_data)); } else{ die "ERROR\n"; } sleep (10); }
title="titleTest" artist="artistTest"
sudo streamripper ********** -E "perl /usr/share/doc/streamripper/examples/metadata.pl **********
ERROR [skipping... ] - [ 121kb]
# perl fetch_external_metadata.pl ********** TITLE=Miracle (Amice Remix) ARTIST=Julian Perretta . TITLE=Miracle (Amice Remix) ARTIST=Julian Perretta . TITLE=She's On My Mind ARTIST=JP Cooper . TITLE=She's On My Mind ARTIST=JP Cooper .