mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-16 00:25:31 +01:00
rutracker 2nd login
try logging in again after 10 secs if 1st attempt fails
This commit is contained in:
@@ -6,6 +6,7 @@ from urlparse import urlparse
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
|
||||
import headphones
|
||||
@@ -45,6 +46,10 @@ class Rutracker(object):
|
||||
|
||||
try:
|
||||
r = self.session.post(loginpage, data=post_params, timeout=self.timeout)
|
||||
# try again
|
||||
if 'bb_data' not in r.cookies.keys():
|
||||
time.sleep(10)
|
||||
r = self.session.post(loginpage, data=post_params, timeout=self.timeout)
|
||||
if r.status_code != 200:
|
||||
logger.error("rutracker login returned status code %s" % r.status_code)
|
||||
self.loggedin = False
|
||||
|
||||
Reference in New Issue
Block a user