I'm working on a search plugin for a site that returns HTML. It's mostly working fine except I'm getting an error when the magnet url doesn't have a DN.
Here's my extract_title (I've based my code on the piratebay search plugin)
if soup.get('href') and 'torrent' in soup.get('href'):
# using DN from magnet for name
match = re.search('dn=(.+).torrent', soup.get('href'))
log.debug('WWT extract title: after match' )
if match and match.group(1):
log.debug('WWT extract title: %s' % match)
log.debug('WWT extract title: %s' % match.group(1))
Here's the error I get
Error searching with worldwidetorrents: Tried to set title to None
input magnet link
Any pointers for error handling would be appreciated.