BTJunkie uses X instead of 0 if there are no seeds/leechers

This commit is contained in:
Correl Roush 2011-09-17 20:24:04 -04:00
parent 730bc97ee9
commit 7787f75223

View file

@ -20,7 +20,11 @@ class BTJunkie(Search):
f = urlopen(url)
soup = BeautifulStoneSoup(f.read())
for item in soup.findAll('item'):
(name, seeds, leechers) = re.findall('(.*?)\s+\[(\d+)\/(\d+)\]$', item.title.text)[0]
(name, seeds, leechers) = re.findall('(.*?)\s+\[(\d+|X)\/(\d+|X)\]$', item.title.text)[0]
if seeds == 'X':
seeds = 0
if leechers == 'X':
leechers = 0
torrents.append({
'url': item.enclosure['url'],
'name': name,