1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-04 08:25:04 -05:00

Fixes corner case where cookie could not be found

This commit is contained in:
Nils Vogels 2014-05-06 10:30:33 +02:00
parent 6deee59236
commit 23b991e9c9

View File

@ -103,14 +103,19 @@ class TorrentDayProvider(generic.TorrentProvider):
logger.log(u'Invalid username or password for ' + self.name + ', Check your settings!', logger.ERROR)
return False
sickbeard.TORRENTDAY_UID = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
sickbeard.TORRENTDAY_HASH = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
if requests.utils.dict_from_cookiejar(self.session.cookies)['uid'] and requests.utils.dict_from_cookiejar(self.session.cookies)['pass']:
sickbeard.TORRENTDAY_UID = requests.utils.dict_from_cookiejar(self.session.cookies)['uid']
sickbeard.TORRENTDAY_HASH = requests.utils.dict_from_cookiejar(self.session.cookies)['pass']
self.cookies = {'uid': sickbeard.TORRENTDAY_UID,
'pass': sickbeard.TORRENTDAY_HASH
}
self.cookies = {'uid': sickbeard.TORRENTDAY_UID,
'pass': sickbeard.TORRENTDAY_HASH
}
return True
else:
logger.log(u'Unable to obtain cookie for TorrentDay', logger.ERROR)
return False
return True
def _get_season_search_strings(self, ep_obj):