Release MPS, a New Tool to stream Music


I've noticed that MPS tends to die when running Album searches. Here's the error message I get:

Code:
Search :  Vangelis - Deliverance - 04:30
Traceback (most recent call last):
  File "./mps.py", line 3, in <module>
    mps_pkg.main.main()
  File "/mnt/utmp/mps/mps_pkg/main.py", line 2114, in main
    globals()[func](*matches)
  File "/mnt/utmp/mps/mps_pkg/main.py", line 1286, in search_album
    songs.append(next(itt))
  File "/mnt/utmp/mps/mps_pkg/main.py", line 1334, in _match_tracks
    results = get_tracks_from_page(wdata) if wdata else None
  File "/mnt/utmp/mps/mps_pkg/main.py", line 749, in get_tracks_from_page
    matches = re.findall(r"\<li.(duration[^>]+)\>", page)
  File "/usr/lib/python2.7/re.py", line 177, in findall
    return _compile(pattern, flags).findall(string)
TypeError: expected string or buffer
- Neelix
 
It seems to be trying to do some kind of poor man's HTML parsing on the variable 'page' which somehow is not a string. My guess is that the HTTP (or whatever) request it was doing before to retrieve 'page' (probably around line 1330 of main.py) timed or errored out and the 'if wdata' check is not catching this particular error scenario. Possibly it is enough to wrap the code around line 749 of main.py inside an 'if page:'. But I dislike python too much to actually try it :)
 
Back
Top