Cover lookup timeout

Bug #850295 reported by Aliaksandr Barysiuk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CoverLovin
Status tracked in Trunk
Trunk
Fix Released
Medium
James Stewart

Bug Description

If cover is unavailable, urllib2.urlopen(url) hangs. It would be nice to import socket and add socket.setdefaulttimeout(10) for example. Or use another approach to set timeout. Thank's

Tags: enhancement
James Stewart (amorphic)
Changed in coverlovin:
importance: Undecided → Medium
assignee: nobody → James Stewart (jstewart101)
Revision history for this message
trent-- (sylvainfaivre) wrote :

I ran into the same problem and just changed line 68 from :
            coverImgWeb = urllib2.urlopen(url)
to:
            coverImgWeb = urllib2.urlopen(url,None,10)
to set a 10 second timeout

Revision history for this message
Donn (donn-lasher) wrote :

added the timeout, but when it actually times out, then fails to the next option, it fails badly.. any idea as to why?

-------------

Trying url: http://www.technodisco.net/img/tracks/a/ace-of-base/2553560-ace-of-base-cruel-summer.jpg
Exception: <urlopen error timed out>
Trying url: http://www.chartstats.com/images/artwork/16793.jpg
Downloading cover from: http://www.chartstats.com/images/artwork/16793.jpg
 to:/NFS/media/music/Ace Of Base/Cruel_Summer/cover.jpg
Traceback (most recent call last):
  File "./coverlovin.py", line 243, in <module>
    sys.exit(main())
  File "./coverlovin.py", line 240, in main
    process_dir(unicode(argsOpts['musicDir'], 'utf-8'))
  File "./coverlovin.py", line 137, in process_dir
    process_dir(dir)
  File "./coverlovin.py", line 137, in process_dir
    process_dir(dir)
  File "./coverlovin.py", line 126, in process_dir
    itemFullPath=os.path.join(thisDir, item)
  File "/usr/lib/python2.7/posixpath.py", line 71, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 19: ordinal not in range(128)

--------------------------------

Happy to post more info needed - -love the program.

Revision history for this message
trent-- (sylvainfaivre) wrote :

Donn, it seems like you hit another bug. I think the folder you have on your NFS share following "/NFS/media/music/Ace Of Base/Cruel_Summer/" has an accent, and CoverLovin fails handling it (which is weird, because I have folders with accents and they got processed right).
Does it only happen after a request timed out ?

Revision history for this message
Bo Mellberg (bosse-w) wrote :

I can report the same problem as above, without the initial time out error:

Evaluating /files/music/Adolphson & Falk/Med Rymden I blodet (LTS)
Traceback (most recent call last):
  File "./coverlovin.py", line 248, in <module>
    sys.exit(main())
  File "./coverlovin.py", line 243, in main
    process_dir(unicode(argsOpts['musicDir'], 'utf-8'))
  File "./coverlovin.py", line 137, in process_dir
    process_dir(dir)
  File "./coverlovin.py", line 137, in process_dir
    process_dir(dir)
  File "./coverlovin.py", line 126, in process_dir
    itemFullPath=os.path.join(thisDir, item)
  File "/usr/lib/python2.7/posixpath.py", line 71, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 16: ordinal not in range(128)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.