Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
here's a basic Amazon MP3 Downloader ebuild that works
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
merky1
n00b
n00b


Joined: 22 Apr 2003
Posts: 46

PostPosted: Mon Nov 16, 2009 4:22 am    Post subject: Reply with quote

I did some hacking on this, and it seems to work for both albums and single songs.

Thanks for posting this, otherwise I would have to keep using winders to grab stuffs from Amazon.

Code:

#!/usr/bin/perl -w
use strict;
use XML::XPath;      #use the xpath language for parsing XML


my $workdir = "/home/smurfoff/AmazonMP3";
chomp $workdir;
(-e $ARGV[0]) || die "File does not exist";
my %song_info;
my @songs;
open (TEMP,">/tmp/amz-xml.out");
print TEMP `clamz -i '$ARGV[0]'`;
close (TEMP);

my $xp = XML::XPath->new(filename => "/tmp/amz-xml.out");  # new parser
my $nodeset = $xp->find('/playlist/trackList/track');
foreach my $tracknode ($nodeset->get_nodelist) {
        $song_info{Title}=$tracknode->findvalue('./title');
        $song_info{Creator}=$tracknode->findvalue('./creator');
        $song_info{Image}=$tracknode->findvalue('./image');
        $song_info{Album}=$tracknode->findvalue('./album');
}

my $artist_dir = "/home/smurfoff/AmazonMP3/$song_info{Creator}";
my $album_dir = "$artist_dir/$song_info{Album}";
unless (-e $artist_dir) {
    mkdir ($artist_dir) || die "Couldn't make artist dir";
}
mkdir ($album_dir) || die "Couldn't make song dir $album_dir" unless (-e $album_dir);
chdir ($album_dir) || die "Album directory $album_dir not created";

#get album art
system ("wget $song_info{Image}");
my $tmp = reverse($song_info{Image});
$tmp =~ s/^([^\/]+).*/$1/;
system ("mv " . reverse ($tmp) . " cover.jpg");

#actually get songs
system ("clamz '$ARGV[0]'");


sub clean_filename {
    my $filename = shift;
    $filename =~ tr{*\"><[]|:;,'=/?}{_};
    return $filename;
}

_________________
ooo000 WoooHooo 000ooo
Back to top
View user's profile Send private message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 92
Location: Austin, TX

PostPosted: Mon Jan 18, 2010 9:03 am    Post subject: Reply with quote

Note to those who are intimidated by all these scripts and ebuilds that people are posting: If you can stomach installing something "manually" (i.e., no emerge), clamz-0.2 (see URL posted by slackbassist above) installed fine for me (x86 system) following the included README, and works perfectly well with no additional scripts required.

I'm posting this just because I was intimidated, and so avoided doing anything about this for months. I finally broke down and installed the program, and it works just fine...

- dcljr
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 5345
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Wed Jan 26, 2011 4:29 pm    Post subject: Reply with quote

any news on this ?

would this also work with ~amd64 and multilib ?

the system's pretty up-to-date (update from a few days ago)

thanks !
_________________
Unofficial minimal livecd x86/amd64 w/reiser4+truecrypt (by Neo2)
2.6.37.2_plus_v1: BFS, CFS,THP,compaction, zcache or TOI
Hardcore Linux user since 2004 :D
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2248
Location: Silver City, NM

PostPosted: Wed Jan 26, 2011 6:47 pm    Post subject: Reply with quote

I have clamz-0.4 installed from source on an amd64 system with multilib and it works great. Give it a shot. See if you can find a free album to test it on. There were a bunch of free albums over the holidays, I imagine there must still be some kicking around.

I see that clamz-0.4 is in portage so you should be able to just "emerge clamz".
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 332
Location: Leeds

PostPosted: Tue Nov 22, 2011 8:29 pm    Post subject: Reply with quote

Cheers BitJam.. perfect! Thanks.
_________________
# touch cock
touch: cannot touch `cock': Permission denied
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum