tblancher / pymazon

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

Doesn't download album containing ampersand #42

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Pymazon 0.9.1 is unable to download album "Charles-Marie Widor: 5e & 6e 
Symphonies pour Orgue aux Grandes Orgues de Notre-Dame de Paris"

Apparently the ampersand character is causing problems in some XML processing 
step.

Stack trace:

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 54, in run
    self.do_work()
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 63, in do_work
    data = self._download(obj, handle)
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 92, in _download
    fs = int(obj.filesize)
ValueError: invalid literal for int() with base 10: ''

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 54, in run
    self.do_work()
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 63, in do_work
    data = self._download(obj, handle)
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 92, in _download
    fs = int(obj.filesize)
ValueError: invalid literal for int() with base 10: ''

Warning:
Failed to set text from markup due to error parsing markup: Error on line 1: 
Entity did not end with a semicolon; most likely you used an ampersand 
character without intending to start an entity - escape ampersand as &
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 54, in run
    self.do_work()
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 63, in do_work
    data = self._download(obj, handle)
  File "/usr/lib/python2.6/site-packages/pymazon/core/downloader.py", line 92, in _download
    fs = int(obj.filesize)
ValueError: invalid literal for int() with base 10: ''

^CTraceback (most recent call last):
  File "/usr/bin/pymazon", line 67, in <module>
    main()
  File "/usr/bin/pymazon", line 51, in main
    main(amzs)
  File "/usr/lib/python2.6/site-packages/pymazon/gtk/ui.py", line 320, in main
    gtk.main()

Original issue reported on code.google.com by nsush...@sushkins.net on 29 Oct 2011 at 1:53

GoogleCodeExporter commented 8 years ago
I'm having the same trouble with this album: 
http://www.amazon.com/Mumford-Laura-Marling-Dharohar-Project/dp/B004CTBWV6

Error:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/pymazon/core/downloader.py", line 54, in run
    self.do_work()
  File "/usr/local/lib/python2.7/dist-packages/pymazon/core/downloader.py", line 63, in do_work
    data = self._download(obj, handle)
  File "/usr/local/lib/python2.7/dist-packages/pymazon/core/downloader.py", line 92, in _download
    fs = int(obj.filesize)
ValueError: invalid literal for int() with base 10: ''

Thanks!

Original comment by ibspam...@gmail.com on 29 Oct 2011 at 6:56

GoogleCodeExporter commented 8 years ago
Can you email me your amz file? You have my word that I wont download your 
songs. Amazon recently started shipping amz's that aren't encrypted and may 
have relaxed their xml format in the process. I'll need to look at the xml in 
order to see what's going on.

Original comment by SCColbert@gmail.com on 29 Oct 2011 at 7:04

GoogleCodeExporter commented 8 years ago
I get the same thing using ciphered *.amz, but it works from cloud player 
(plain text).
clamz works in either case.

$ pymazon -c -d /tmp ~/Amazon-MP3-1320148756.amz 

##############################################
#                                            #
#                PYMAZON!                    # 
#                                            #
##############################################

Journey - Greatest Hits 2
    01. Stone In Love (GH 2 Version)
    02. After The Fall (GH 2 Version)
    03. Chain Reaction (GH 2 Version)
    04. The Party's Over (Hopelessly In Love) (GH 2 Version)
    05. Escape (GH 2 Version)
    06. Still They Ride (GH 2 Version)
    07. Good Morning Girl (GH 2 Version)
    08. Stay Awhile (GH 2 Version)
    09. Suzanne (GH 2 Version)
    10. Feeling That Way (GH 2 Version)
    11. Anytime (GH 2 Version)
    12. Walks Like A Lady (GH 2 Version)
    13. Little Girl (GH 2 Version)
    14. Just The Same Way (GH 2 Version)
    15. Patiently (GH 2 Version)
    16. When I Think Of You (GH 2 Version)
    17. Mother, Father (Live GH 2 Version)

Download these items? (Yes/No)
Yes

##############################################

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 530, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/site-packages/pymazon/core/downloader.py", line 54, in run
    self.do_work()
  File "/usr/lib/python2.7/site-packages/pymazon/core/downloader.py", line 63, in do_work
    data = self._download(obj, handle)
  File "/usr/lib/python2.7/site-packages/pymazon/core/downloader.py", line 92, in _download
    fs = int(obj.filesize)
ValueError: invalid literal for int() with base 10: ''

##############################################

Files downloaded to:
/tmp

Name format used:
${artist}/${album}/${tracknum} - ${title}

##############################################
#                                            #
#               Finished!                    #
#                                            #
##############################################
$

I will send Amazon-MP3-1320148756.amz to you.

Original comment by rickr...@gmail.com on 1 Nov 2011 at 9:34

GoogleCodeExporter commented 8 years ago
Any progress on this issue? I keep getting errors in other .amz files.

Original comment by nsush...@sushkins.net on 30 Nov 2011 at 6:36

GoogleCodeExporter commented 8 years ago
Actually it seems that the real problem is that some tracks have no <meta 
rel="http://www.amazon.com/dmusic/fileSize">

Original comment by nsush...@sushkins.net on 30 Nov 2011 at 8:12

GoogleCodeExporter commented 8 years ago
Can patch downloader.py to take file size from the response header, if the 
metadata is not available in the .amz file. Seems to fix my issue. The 
ampersand warning still persist, but doesn't prevent downloading.

Original comment by nsush...@sushkins.net on 30 Nov 2011 at 8:49

GoogleCodeExporter commented 8 years ago
Fixed the patch. The original was a reverse one.

Original comment by nsush...@sushkins.net on 30 Nov 2011 at 9:14

Attachments:

GoogleCodeExporter commented 8 years ago
Patch works good.  Thanks.  I have been using clamz v0.5 for the past week or 
so.

Original comment by rickr...@gmail.com on 30 Nov 2011 at 9:18

GoogleCodeExporter commented 8 years ago
Patch works great here too -- please update the source. :)

Original comment by chowa...@gmail.com on 18 Sep 2012 at 1:59

GoogleCodeExporter commented 8 years ago
I got this problem today and this patch fixed it.  Why hasn't it been rolled 
into the main branch yet?

Original comment by raven...@gmail.com on 21 Sep 2012 at 5:35

GoogleCodeExporter commented 8 years ago
Because I have a job that pays me to do other things. 

Original comment by SCColbert@gmail.com on 21 Sep 2012 at 6:44

GoogleCodeExporter commented 8 years ago
Maybe it makes sense to move the project to Github; making it easier to merge 
patches.

Original comment by SCColbert@gmail.com on 21 Sep 2012 at 6:46

GoogleCodeExporter commented 8 years ago
I have been making some patches (as has 
[http://code.google.com/r/michaelstrecke-pymazon/source/browse 
michaelstrecke]), and I'd support moving the project to GitHub. Let me know if 
you do, as I have some modifications to contribute.

(I think some of the changes that michaelstrecke made in his clone also fix 
this bug, but I think they were made without knowledge of the above patch.)

Original comment by jsphs...@gmail.com on 24 Oct 2012 at 5:43

GoogleCodeExporter commented 8 years ago
I'll try to move the project to Github this weekend if I can find the minutes.

Original comment by SCColbert@gmail.com on 24 Oct 2012 at 11:54

GoogleCodeExporter commented 8 years ago
Ditto. Applied pymazon-issue-42.patch to downloader.py and fixed problems here 
on Gentoo with =net-misc/pymazon-0.9.1.  Cheers!  I've gotten my Relaxing 
Symphony music.

Original comment by rogerx....@gmail.com on 2 Nov 2012 at 4:34

GoogleCodeExporter commented 8 years ago
Great patch, thanks.

+1 for Github, if possible. Maybe someone else could take over the project if 
you don't have the time, @SCColbert?

Original comment by adamnf...@gmail.com on 30 May 2013 at 11:40

GoogleCodeExporter commented 8 years ago
I went ahead and imported it into https://github.com/fortian/pymazon

It should have retained all of the history.

I did not merge any patches in.

Original comment by ben.st...@gmail.com on 30 May 2013 at 4:41

GoogleCodeExporter commented 8 years ago
I also made SCColbert a "collaborator."

Original comment by ben.st...@gmail.com on 30 May 2013 at 7:45