Closed bruut closed 12 years ago
That's likely because the torrent object has been instantiated with a wrong torrent id (maybe a group torrent id?).
torrent = whatcd.getTorrent(torrentid)
In any case, I've just sanitized the code to avoid the exception. I'll push it tonight.
Well that fixed that. Problem is, now I get zero results.
11-sep-2012 20:22:06 - INFO :: Thread-12 : Searching torrents for Analogik New S
eeland since it was marked as wanted
authenticating...
11-sep-2012 20:22:13 - INFO :: Thread-12 : What.cd artist ID: 69099
11-sep-2012 20:22:13 - INFO :: Thread-12 : Found 0 releases on what.cd for Analo
gik
11-sep-2012 20:22:13 - INFO :: Thread-12 : No results found from What.cd for Ana
logik New Seeland after filtering
(The album is listed on What, for the record)
Download the latest whatapi version and check your code. Also delete your cookie, just in case. It's working for me:
whatcd = whatapi.getWhatcdNetwork('devilcius', 'pass')
artist = whatcd.getArtist("Analogik")
print artist.getArtistTags()
result:
authenticating... ['electronic', 'jazz', 'balkan', 'world.music', 'downtempo', 'folk', 'experimental', 'broken.beat', 'trip.hop', 'swing', 'house', 'dub', 'tech.house', 'denmark', 'nu.jazz', 'alternative', 'tartelet', 'electro.swing', 'electro', 'chillosophy.music', 'ambient', 'idm', 'pop', 'funk', 'copenhagen', 'soul', 'indie.rock', 'minimal', 'electronica', 'indie', 'ethiopian', 'acoustic', 'easy.listening', 'danish', 'progressive.trance', 'mestizo', 'reggae', 'deep.house']
artist.getArtistReleases() is still blank for that above example.
I don't know too much about this stuff, but I don't think there's a {'class':'torrent_table'} when doing the soup.fetch in artistInfo. It'll work for {'class':'torrent_table grouped release_table'} instead, but then the result is a list of torrent groups, rather than a list of torrents. Need to then be able to sort through the torrents within the torrent group, and get single torrents with non-group torrentIDs.
Now that I've resolved my authentication issues, I'm seeing the same behavior as fatcat. It does look like the problem is in that code he pointed out. I'm gonna throw things in the ol' debugger and see if I can work out what it needs to do there.
After swapping to {'class':'torrent_table grouped release_table'} in artist.getArtistReleases(), it definitely seems to get a proper list of releases / torrent groups. I'll just need to tweak things to get the actual torrent listings out of the list.
That's it. Line 1247 should be replaced by
for releasetype in soup.fetch('table', {'class': re.compile(r'\btorrent_table\b')}):
I'll push a fixed version later on
It still does not find any releases, which it did do before (see log of first post). Besides, it now prints a logout url :s
12-sep-2012 09:16:14 - INFO :: Thread-12 : Searching torrents for Analogik New S
eeland since it was marked as wanted
authenticating...
User id: #idremoved#
logout.php?auth=#authkeyremoved#
12-sep-2012 09:16:23 - INFO :: Thread-12 : What.cd artist ID: 69099
12-sep-2012 09:16:23 - INFO :: Thread-12 : Found 0 releases on what.cd for Analo
gik
12-sep-2012 09:16:23 - INFO :: Thread-12 : No results found from What.cd for Ana
logik New Seeland after filtering
I'll have a commit ready in just a little bit that should allow it to get much further. Some restructuring and bug fixing was required.
I assume is not related with whatapi. I've fixed and pushed the artistinfo fix though
It wasn't. Thanks. Headphones is working very well with the new what implementation.
Thanks for all your work
Using your code in combination with headphones in cohena's what implementation. It authenticates nicely and finds the album I want but then it gives me the following error:
Any suggestions?