Commit 17063315 authored by echel0n's avatar echel0n

Bumped version for cfscrape to v2.0.8

Fixed issue with web sessions and CloudFlare handler
Refactored NZBGet host:post required pattern, resolves issues with saving config settings
Refactored frequency change functions to use `reschedule_job` apscheduler function, resolves issues with frequency not being updated correctly
Fixed issue for full backlog searches not running if no show_id is passed
parent ae7acbe0
......@@ -2,7 +2,7 @@ APScheduler == 3.5.3
babelfish == 0.5.5
bencode3 == 0.1.0
CacheControl == 0.12.5
cfscrape == 1.9.7
cfscrape == 2.0.8
configobj == 5.0.6
feedparser == 5.2.1
guessit == 3.0.3
......
......@@ -1161,8 +1161,7 @@ class Config(object):
if self.autopostprocessor_freq < self.min_autopostprocessor_freq:
self.autopostprocessor_freq = self.min_autopostprocessor_freq
sickrage.app.scheduler.modify_job(sickrage.app.auto_postprocessor.name,
trigger=IntervalTrigger(minutes=self.autopostprocessor_freq))
sickrage.app.scheduler.reschedule_job(sickrage.app.auto_postprocessor.name, trigger='interval', minutes=self.autopostprocessor_freq)
def change_daily_searcher_freq(self, freq):
"""
......@@ -1174,8 +1173,7 @@ class Config(object):
if self.daily_searcher_freq < self.min_daily_searcher_freq:
self.daily_searcher_freq = self.min_daily_searcher_freq
sickrage.app.scheduler.modify_job(sickrage.app.daily_searcher.name,
trigger=IntervalTrigger(minutes=self.daily_searcher_freq))
sickrage.app.scheduler.reschedule_job(sickrage.app.daily_searcher.name, trigger='interval', minutes=self.daily_searcher_freq)
def change_backlog_searcher_freq(self, freq):
"""
......@@ -1187,8 +1185,7 @@ class Config(object):
if self.backlog_searcher_freq < self.min_backlog_searcher_freq:
self.backlog_searcher_freq = self.min_backlog_searcher_freq
sickrage.app.scheduler.modify_job(sickrage.app.backlog_searcher.name,
trigger=IntervalTrigger(minutes=self.backlog_searcher_freq))
sickrage.app.scheduler.reschedule_job(sickrage.app.backlog_searcher.name, trigger='interval', minutes=self.backlog_searcher_freq)
def change_updater_freq(self, freq):
"""
......@@ -1200,8 +1197,7 @@ class Config(object):
if self.version_updater_freq < self.min_version_updater_freq:
self.version_updater_freq = self.min_version_updater_freq
sickrage.app.scheduler.modify_job(sickrage.app.version_updater.name,
trigger=IntervalTrigger(hours=self.version_updater_freq))
sickrage.app.scheduler.reschedule_job(sickrage.app.version_updater.name, trigger='interval', hours=self.version_updater_freq)
def change_showupdate_hour(self, freq):
"""Change frequency of show updater thread
......@@ -1213,11 +1209,8 @@ class Config(object):
if self.showupdate_hour < 0 or self.showupdate_hour > 23:
self.showupdate_hour = 0
sickrage.app.scheduler.modify_job(sickrage.app.show_updater.name,
trigger=IntervalTrigger(hours=1,
start_date=datetime.datetime.now().replace(
hour=self.showupdate_hour))
)
sickrage.app.scheduler.reschedule_job(sickrage.app.show_updater.name, trigger='interval', hours=1,
start_date=datetime.datetime.now().replace(hour=self.showupdate_hour))
def change_subtitle_searcher_freq(self, freq):
"""
......@@ -1229,8 +1222,7 @@ class Config(object):
if self.subtitle_searcher_freq < self.min_subtitle_searcher_freq:
self.subtitle_searcher_freq = self.min_subtitle_searcher_freq
sickrage.app.scheduler.modify_job(sickrage.app.subtitle_searcher.name,
trigger=IntervalTrigger(hours=self.subtitle_searcher_freq))
sickrage.app.scheduler.reschedule_job(sickrage.app.subtitle_searcher.name, trigger='interval', hours=self.subtitle_searcher_freq)
def change_failed_snatch_age(self, age):
"""
......
......@@ -80,8 +80,8 @@ class BacklogSearcher(object):
if not show_id and self.forced:
sickrage.app.log.info("Running limited backlog on missed episodes " + str(sickrage.app.config.backlog_days) + " day(s) old")
from_date = datetime.date.today() - datetime.timedelta(days=sickrage.app.config.backlog_days)
elif len(show_list):
sickrage.app.log.info('Running full backlog search on missed episodes for selected shows')
else:
sickrage.app.log.info('Running full backlog search on missed episodes for all shows')
# go through non air-by-date shows and see if they need any episodes
for curShow in show_list:
......
......@@ -579,9 +579,9 @@
class="form-control"
autocapitalize="off"
type="url"
pattern="https?://.+:[0-9]+/?">
pattern="[a-zA-Z]+:[0-9]+">
<div class="invalid-tooltip">
Please fill in a valid URL.
Please fill in a valid host:port
</div>
</div>
</div>
......
......@@ -178,8 +178,8 @@ class WebHelpers(object):
return (
resp.status_code == 503
and resp.headers.get('Server', '').startswith('cloudflare')
and 'jschl_vc' in resp.content
and 'jschl_answer' in resp.content
and b'jschl_vc' in resp.content
and b'jschl_answer' in resp.content
)
if is_cloudflare_challenge(resp):
......
......@@ -54,6 +54,8 @@ class SpeedCDProvider(TorrentProvider):
# return self.cookie_login('log in')
def login(self):
# return self.cookie_login('loginform')
if any(dict_from_cookiejar(self.session.cookies).values()):
return True
......@@ -66,7 +68,7 @@ class SpeedCDProvider(TorrentProvider):
with bs4_parser(self.session.get(self.urls['login']).text) as html:
login_url = urljoin(self.urls['base_url'], html.find('form', id='loginform').get('action'))
response = self.session.post(login_url, data=login_params, timeout=30).text
except Exception:
except Exception as e:
sickrage.app.log.warning("Unable to connect to provider")
self.session.cookies.clear()
return False
......
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