Include option to disable readerserver

This commit is contained in:
Tanner Collin 2022-03-05 22:04:25 +00:00
parent f8e8597e3a
commit 7386e1d8b0
2 changed files with 9 additions and 1 deletions

View File

@ -54,8 +54,12 @@ def get_article(url):
logging.info('Trying our server instead...') logging.info('Trying our server instead...')
if not settings.READER_URL:
logging.info('Readerserver not configured, aborting.')
return ''
try: try:
r = requests.post(READ_API, data=dict(url=url), timeout=20) r = requests.post(settings.READER_URL, data=dict(url=url), timeout=20)
if r.status_code != 200: if r.status_code != 200:
raise Exception('Bad response code ' + str(r.status_code)) raise Exception('Bad response code ' + str(r.status_code))
return r.text return r.text

View File

@ -14,6 +14,10 @@ NUM_TILDES = 5
#MEILI_URL = 'http://127.0.0.1:7700/' #MEILI_URL = 'http://127.0.0.1:7700/'
MEILI_URL = '' MEILI_URL = ''
# Readerserver URL
# Leave blank if not using, but that defeats the whole point
READER_URL = 'http://127.0.0.1:33843/'
# Reddit account info # Reddit account info
# leave blank if not using Reddit # leave blank if not using Reddit
REDDIT_CLIENT_ID = '' REDDIT_CLIENT_ID = ''