Browse Source

Merge pull request #7292 from swordfish6975/develop

iptorrents.py no password now just cookie
pull/7305/head
Ruud Burger 6 years ago
committed by GitHub
parent
commit
c0a05086d8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      couchpotato/core/downloaders/deluge.py
  2. 41
      couchpotato/core/media/_base/providers/torrent/iptorrents.py
  3. 6
      couchpotato/core/media/movie/providers/torrent/iptorrents.py
  4. 2
      libs/synchronousdeluge/transfer.py

12
couchpotato/core/downloaders/deluge.py

@ -80,17 +80,17 @@ class Deluge(DownloaderBase):
} }
if self.conf('directory'): if self.conf('directory'):
if os.path.isdir(self.conf('directory')): #if os.path.isdir(self.conf('directory')):
options['download_location'] = self.conf('directory') options['download_location'] = self.conf('directory')
else: #else:
log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory')) # log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory'))
if self.conf('completed_directory'): if self.conf('completed_directory'):
if os.path.isdir(self.conf('completed_directory')): #if os.path.isdir(self.conf('completed_directory')):
options['move_completed'] = 1 options['move_completed'] = 1
options['move_completed_path'] = self.conf('completed_directory') options['move_completed_path'] = self.conf('completed_directory')
else: #else:
log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory')) # log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory'))
if data.get('seed_ratio'): if data.get('seed_ratio'):
options['stop_at_ratio'] = 1 options['stop_at_ratio'] = 1

41
couchpotato/core/media/_base/providers/torrent/iptorrents.py

@ -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',

6
couchpotato/core/media/movie/providers/torrent/iptorrents.py

@ -11,9 +11,9 @@ class IPTorrents(MovieProvider, Base):
cat_ids = [ cat_ids = [
([87], ['3d']), ([87], ['3d']),
([89], ['bd50']), ([89, 90], ['bd50']),
([48], ['720p', '1080p']), ([48, 20, 62], ['720p', '1080p']),
([101], ['2160p']), ([100, 101], ['2160p']),
([48, 20], ['brrip']), ([48, 20], ['brrip']),
([7, 77], ['dvdrip']), ([7, 77], ['dvdrip']),
([6], ['dvdr']), ([6], ['dvdr']),

2
libs/synchronousdeluge/transfer.py

@ -19,7 +19,7 @@ class DelugeTransfer(object):
self.disconnect() self.disconnect()
self.sock = socket.create_connection(hostport) self.sock = socket.create_connection(hostport)
self.conn = ssl.wrap_socket(self.sock, None, None, False, ssl.CERT_NONE, ssl.PROTOCOL_TLSv1) self.conn = ssl.wrap_socket(self.sock, None, None, False, ssl.CERT_NONE, ssl.PROTOCOL_TLSv1_2)
self.connected = True self.connected = True
def disconnect(self): def disconnect(self):

Loading…
Cancel
Save