Commit 7a20aeac authored by echel0n's avatar echel0n

Fixed issue with TorrentLeech logins

parent 37896dd2
......@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
The ultimate PVR application that downloads and manages your TV shows
Copyright (C) 2010 - echel0n
Copyright (C) 2014 - echel0n
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
SiCKRAGE - Copyright (C) 2010 - echel0n
SiCKRAGE - Copyright (C) 2014 - echel0n
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
......
# Changelog
- * 9ca359a - 2018-10-08: Release v9.3.80
- * 414a1aa - 2018-10-09: Fixed issue with TorrentLeech logins
- * a9e7913 - 2018-10-08: Release v9.3.80
- * 615cf7d - 2018-10-08: Pre-Release v9.3.80.dev6
- * fabc483 - 2018-10-08: Added web session hook to handle redirects when doing posts. Fixed issues with getting search results from YGGTorrent provider.
- * f64a196 - 2018-10-08: Pre-Release v9.3.80.dev5
......
......@@ -20,6 +20,8 @@ from __future__ import unicode_literals
from urlparse import urljoin
from requests.utils import dict_from_cookiejar
import sickrage
from sickrage.core.caches.tv_cache import TVCache
from sickrage.core.helpers import bs4_parser, convert_size, try_int
......@@ -38,8 +40,8 @@ class TorrentLeechProvider(TorrentProvider):
self.username = None
self.password = None
self.enable_cookies = True
self.required_cookies = ('tluid', 'tlpass')
# self.enable_cookies = True
# self.required_cookies = ('tluid', 'tlpass')
self.minseed = None
self.minleech = None
......@@ -48,32 +50,32 @@ class TorrentLeechProvider(TorrentProvider):
self.cache = TVCache(self, min_time=20)
def login(self):
return self.cookie_login('log in')
# def login(self):
# cookies = dict_from_cookiejar(self.session.cookies)
# if any(cookies.values()) and cookies.get('member_id'):
# return True
#
# login_params = {
# 'username': self.username,
# 'password': self.password,
# 'login': 'submit',
# 'remember_me': 'on',
# }
#
# try:
# response = self.session.post(self.urls['login'], data=login_params, timeout=30).text
# except Exception:
# sickrage.app.log.warning("Unable to connect to provider")
# return False
#
# if '<title>Login :: TorrentLeech.org</title>' in response:
# sickrage.app.log.warning("Invalid username or password. Check your settings")
# return False
#
# return True
# return self.cookie_login('log in')
def login(self):
cookies = dict_from_cookiejar(self.session.cookies)
if any(cookies.values()) and cookies.get('member_id'):
return True
login_params = {
'username': self.username,
'password': self.password,
'login': 'submit',
'remember_me': 'on',
}
try:
response = self.session.post(self.urls['login'], data=login_params, timeout=30).text
except Exception:
sickrage.app.log.warning("Unable to connect to provider")
return False
if '<title>Login :: TorrentLeech.org</title>' in response:
sickrage.app.log.warning("Invalid username or password. Check your settings")
return False
return True
def search(self, search_strings, age=0, ep_obj=None, **kwargs):
results = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment