|
@ -16,22 +16,13 @@ class Base(TorrentProvider): |
|
|
urls = { |
|
|
urls = { |
|
|
'test': 'https://iptorrents.com/', |
|
|
'test': 'https://iptorrents.com/', |
|
|
'base_url': 'https://iptorrents.com', |
|
|
'base_url': 'https://iptorrents.com', |
|
|
'login': 'https://iptorrents.com/take_login.php', |
|
|
|
|
|
'login_check': 'https://iptorrents.com/oldinbox.php', |
|
|
|
|
|
'search': 'https://iptorrents.com/t?%s%%s&q=%s&qf=ti#torrents&p=%%d', |
|
|
'search': 'https://iptorrents.com/t?%s%%s&q=%s&qf=ti#torrents&p=%%d', |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
http_time_between_calls = 1 # Seconds |
|
|
http_time_between_calls = 1 # Seconds |
|
|
login_fail_msg = 'Invalid username and password combination' |
|
|
login_fail_msg = 'Invalid username and cookie combination' |
|
|
cat_backup_id = None |
|
|
cat_backup_id = None |
|
|
|
|
|
|
|
|
def loginDownload(self, url = '', nzb_id = ''): |
|
|
|
|
|
try: |
|
|
|
|
|
if not self.login(): |
|
|
|
|
|
log.error('Failed downloading from %s', self.getName()) |
|
|
|
|
|
return self.urlopen(url, headers=self.getRequestHeaders()) |
|
|
|
|
|
except: |
|
|
|
|
|
log.error('Failed downloading from %s: %s', (self.getName(), traceback.format_exc())) |
|
|
|
|
|
|
|
|
|
|
|
def buildUrl(self, title, media, quality): |
|
|
def buildUrl(self, title, media, quality): |
|
|
return self._buildUrl(title.replace(':', ''), quality) |
|
|
return self._buildUrl(title.replace(':', ''), quality) |
|
@ -59,7 +50,7 @@ class Base(TorrentProvider): |
|
|
current_page = 1 |
|
|
current_page = 1 |
|
|
while current_page <= pages and not self.shuttingDown(): |
|
|
while current_page <= pages and not self.shuttingDown(): |
|
|
data = self.getHTMLData(base_url % (freeleech, current_page), headers = self.getRequestHeaders()) |
|
|
data = self.getHTMLData(base_url % (freeleech, current_page), headers = self.getRequestHeaders()) |
|
|
|
|
|
|
|
|
if data: |
|
|
if data: |
|
|
html = BeautifulSoup(data) |
|
|
html = BeautifulSoup(data) |
|
|
|
|
|
|
|
@ -71,8 +62,8 @@ class Base(TorrentProvider): |
|
|
final_page_link = next_link.previous_sibling.previous_sibling |
|
|
final_page_link = next_link.previous_sibling.previous_sibling |
|
|
pages = int(final_page_link.string) |
|
|
pages = int(final_page_link.string) |
|
|
|
|
|
|
|
|
result_table = html.find('table', attrs={'id': 'torrents'}) |
|
|
result_table = html.find('table', id="torrents") |
|
|
|
|
|
|
|
|
if not result_table or 'nothing found!' in data.lower(): |
|
|
if not result_table or 'nothing found!' in data.lower(): |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
@ -114,19 +105,14 @@ class Base(TorrentProvider): |
|
|
return { |
|
|
return { |
|
|
'Cookie': self.conf('cookiesetting') or '' |
|
|
'Cookie': self.conf('cookiesetting') or '' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
def download(self, url = '', nzb_id = ''): |
|
|
|
|
|
try: |
|
|
|
|
|
return self.urlopen(url, headers=self.getRequestHeaders()) |
|
|
|
|
|
except: |
|
|
|
|
|
log.error('Failed getting release from %s: %s', (self.getName(), traceback.format_exc())) |
|
|
|
|
|
|
|
|
def getLoginParams(self): |
|
|
return 'try_next' |
|
|
return { |
|
|
|
|
|
'username': self.conf('username'), |
|
|
|
|
|
'password': self.conf('password'), |
|
|
|
|
|
'login': 'submit', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
def loginSuccess(self, output): |
|
|
|
|
|
return 'don\'t have an account' not in output.lower() |
|
|
|
|
|
|
|
|
|
|
|
def loginCheckSuccess(self, output): |
|
|
|
|
|
return '/logout.php' in output.lower() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config = [{ |
|
|
config = [{ |
|
@ -150,11 +136,6 @@ config = [{ |
|
|
'default': '', |
|
|
'default': '', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
'name': 'password', |
|
|
|
|
|
'default': '', |
|
|
|
|
|
'type': 'password', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
'name': 'freeleech', |
|
|
'name': 'freeleech', |
|
|
'default': 0, |
|
|
'default': 0, |
|
|
'type': 'bool', |
|
|
'type': 'bool', |
|
|