Class of magnet link anchor on kat.cr page has changed, so perhaps you should remove 'imagnet ' from the following:
magnet = item.find('a', {'class': 'imagnet icon16'}).get('href')
Seems to work when I remove it.
EDIT:
The following change seems to work properly, by opening a magnet link in torrent application:
magnet = item.find('a', {'title':'Torrent magnet link', 'class': 'icon16'}).get('href')
Debug output below:
Starting debug for 'KA Torrents'
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:34:26 workflow.py:1892 ERROR 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/Users/.../Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.xxx/workflow/workflow.py", line 1890, in run
func(self)
File "torrents.py", line 69, in main
for item in scrape_torrent_site(query):
File "torrents.py", line 39, in scrape_torrent_site
magnet = item.find('a', {'class': 'imagnet icon16'}).get('href')
AttributeError: 'NoneType' object has no attribute 'get'