Created
February 4, 2010 19:08
-
-
Save maxaf/294989 to your computer and use it in GitHub Desktop.
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 | |
# -*- cperl -*- | |
use strict; | |
use HTTP::Proxy qw/:log/; | |
use Time::HiRes qw/time/; | |
use HTTP::Proxy::BodyFilter::save; | |
use File::Path qw/mkpath/; | |
my $dir = shift @ARGV || die "usage: $0 /path/to/music/dump"; | |
$dir =~ s/\/+$//; | |
mkpath $dir; | |
my $proxy = HTTP::Proxy->new(host => '127.0.0.1', port => 3845); | |
$proxy->logmask(STATUS); | |
$proxy | |
->push_filter( | |
mime => 'audio/x-mpeg', | |
path => qr!/contentfs/content!, | |
response => HTTP::Proxy::BodyFilter::save | |
->new(filename => sub { return "${dir}/" . time() . ".mp3"; })); | |
$proxy->start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment