aboutsummaryrefslogtreecommitdiffstats
path: root/tpblite/models
diff options
context:
space:
mode:
Diffstat (limited to 'tpblite/models')
-rw-r--r--tpblite/models/torrents.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py
index 79c05f1..32b6b5f 100644
--- a/tpblite/models/torrents.py
+++ b/tpblite/models/torrents.py
@@ -4,6 +4,7 @@ from bs4 import BeautifulSoup
from .utils import Query
+#TODO: implement a pretty print for Torrents object
def fileSizeStrToInt(size_str):
'''Converts file size given in *iB format to bytes integer'''
@@ -101,10 +102,12 @@ class Torrents(object):
def __getRows(self, soup):
rows = soup.body.find_all('tr')
- # remove first and last entries
+ # remove first entry (header)
if len(rows) > 1:
del rows[0]
- del rows[-1]
+ if len(rows) == 31:
+ # last row is bottom of page
+ del rows[-1]
return rows
else:
print('No torrents found!')