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. 35
      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 os.path.isdir(self.conf('directory')):
#if os.path.isdir(self.conf('directory')):
options['download_location'] = self.conf('directory')
else:
log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory'))
#else:
# log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('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_path'] = self.conf('completed_directory')
else:
log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory'))
#else:
# log.error('Download directory from Deluge settings: %s doesn\'t exist', self.conf('directory'))
if data.get('seed_ratio'):
options['stop_at_ratio'] = 1

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

@ -16,22 +16,13 @@ class Base(TorrentProvider):
urls = {
'test': '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',
}
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
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):
return self._buildUrl(title.replace(':', ''), quality)
@ -71,7 +62,7 @@ class Base(TorrentProvider):
final_page_link = next_link.previous_sibling.previous_sibling
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():
return
@ -115,18 +106,13 @@ class Base(TorrentProvider):
'Cookie': self.conf('cookiesetting') or ''
}
def getLoginParams(self):
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 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 loginCheckSuccess(self, output):
return '/logout.php' in output.lower()
return 'try_next'
config = [{
@ -150,11 +136,6 @@ config = [{
'default': '',
},
{
'name': 'password',
'default': '',
'type': 'password',
},
{
'name': 'freeleech',
'default': 0,
'type': 'bool',

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

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

2
libs/synchronousdeluge/transfer.py

@ -19,7 +19,7 @@ class DelugeTransfer(object):
self.disconnect()
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
def disconnect(self):

Loading…
Cancel
Save