kevin-vigor / clamz

Automatically exported from code.google.com/p/clamz
0 stars 0 forks source link

Does not work with amz files from Amazon Cloud Player #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open Amazon Cloud Player
2. Select "Download" from any album's drop-down context menu
3. Open the resulting .amz file with clamz

What is the expected output? What do you see instead?

Output shows "ERROR: Error downloading file: The requested URL returned error: 
400"

What version of the product are you using? On what operating system?

Clamz 0.4 on Ubuntu 10.04

Original issue reported on code.google.com by d...@daverea.com on 12 Oct 2011 at 4:41

GoogleCodeExporter commented 9 years ago
I am unable to download as well, but I am getting a different error:

ERROR: Invalid base64 data in AMZ file
'/home/ejohnson/Downloads/Amazon-MP3-1318723338.amz'

0 of 1 AMZ files downloaded successfully.

This is on Arch Linux running clamz 0.4.

Original comment by paleh...@gmail.com on 16 Oct 2011 at 12:14

GoogleCodeExporter commented 9 years ago
This is happening on Debian testing as well with clamz 0.4-3 on the debian 
testing repo's. Same error as above  base64 error. 

Original comment by mpmilest...@gmail.com on 19 Oct 2011 at 12:49

GoogleCodeExporter commented 9 years ago
It looks like Amazon no longer encrypts the .amz files

the following patch to playlist.c will attempt to download with the raw text if 
the decryption fails. I'm not sure if all amz's are now unencrypted or not so 
this should handle both cases:

diff -u playlist.c clamz-0.4/playlist.c 
--- playlist.c  2010-04-19 16:01:59.000000000 -0700
+++ clamz-0.4/playlist.c    2011-10-18 20:35:39.850146353 -0700
@@ -499,12 +499,21 @@
 {
   struct parseinfo pi;
   unsigned char *decrypted, *xml;
-  unsigned long decrypted_len;
+  unsigned long decrypted_len, i;
   int xerr;

   decrypted = decrypt_amz_file(b64data, b64len, fname);
-  if (!decrypted)
-    return 1;
+  if (!decrypted){
+    // XXX Perhaps the code file is unencrypted already.
+    decrypted = malloc((b64len + 1) * sizeof(char));
+    if (!decrypted) {
+      print_error("Out of memory");
+      return 1;
+    }
+    for (i = 0; i < b64len; i++) {
+      decrypted[i] = b64data[i]; 
+    }
+  }
   decrypted_len = strlen((char*) decrypted);

   pi.parser = XML_ParserCreate(NULL);

Original comment by john.sou...@gmail.com on 19 Oct 2011 at 3:39

GoogleCodeExporter commented 9 years ago
I applied the patch (manually) and rebuilt clamz... At first got "403 
forbidden" errors but realized I was using a pretty old .amz file. I got a 
"fresh" one from Amazon Cloud Drive and now clamz digests it perfectly!

Thank you!! I definitely nominate this change for a clamz 0.5! :)

Original comment by d...@daverea.com on 20 Oct 2011 at 1:00

GoogleCodeExporter commented 9 years ago
I ran into this exact problem; the patch worked as expected. How soon can we 
expect a new version to reflect the change on Amazon's part?

Original comment by daniel.s...@saplinglearning.com on 20 Oct 2011 at 3:08

GoogleCodeExporter commented 9 years ago
Confirmed that the patch is working for me as well.

Original comment by paleh...@gmail.com on 20 Oct 2011 at 5:21

GoogleCodeExporter commented 9 years ago
Thank you, John, for the patch!

Indeed, it seems that the amz files generated by the Amazon Cloud Player are 
not encrypted anymore.  But the amz files generated by the MP3 store itself 
still are encrypted (for some albums, at least.)  So I guess clamz needs to 
support both formats.  I'll release a new version as soon as possible.

Weird, though; an unencrypted amz file should not cause the error that Dave 
originally described.

Original comment by Benjamin...@gmail.com on 21 Oct 2011 at 2:04

GoogleCodeExporter commented 9 years ago
I can also confirm that this patch works exactly as intended.  Simple and 
effective.  Thank you!

Hopefully this will be merged into the main code tree soon.

Original comment by BlackPet...@gmail.com on 22 Oct 2011 at 3:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in 0.5

Original comment by Benjamin...@gmail.com on 23 Oct 2011 at 9:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Is there a reason you haven't just upgraded to 0.5?

Original comment by paleh...@gmail.com on 11 Nov 2011 at 9:02

GoogleCodeExporter commented 9 years ago
Had trouble installing since it's not available in software center but I worked 
it out. Here's how if anybody has the same problem:

downloaded and installed these items from software center:

1 - Devolopment Files and Documentation for Libcurl (OpenSSL)
-with all recommended add-ons

2 - libexpat1-dev
-with all recommended add-ons

3 - libgcrypt11-dev
-with all recommended add-ons

Then I downloaded Clamz from this site:

http://code.google.com/p/clamz/downloads/detail?name=clamz-0.5.tar.gz&can=2&q=

After downloading, I moved the file from my downloads to my home folder.

Then I opened Terminal (CTRL ALT T) and ran these commands:

tar xfvz clamz-0.5.tar.gz

cd clamz-0.5

./configure

make

sudo make install

Now it's up and works like a charm

Original comment by Lents.M...@gmail.com on 11 Nov 2011 at 10:11

GoogleCodeExporter commented 9 years ago
I followed the above guide by Lentz, and it's working great.  

Original comment by johndmc...@yahoo.com on 7 Mar 2012 at 7:29

GoogleCodeExporter commented 9 years ago
+1 For the instructions by Lents. Thanks!

Original comment by richardr...@gmail.com on 23 Mar 2012 at 5:55