forked from tanner/qotnews
remove useless try blocks.
This commit is contained in:
parent
1318259d3d
commit
6ea9844d00
|
@ -9,14 +9,11 @@ TIMEOUT = 30
|
||||||
|
|
||||||
|
|
||||||
def get_html(url):
|
def get_html(url):
|
||||||
try:
|
logging.info(f"Declutter Scraper: {url}")
|
||||||
logging.info(f"Declutter Scraper: {url}")
|
details = get_details(url)
|
||||||
details = get_details(url)
|
if not details:
|
||||||
if not details:
|
return ''
|
||||||
return ''
|
return details['content']
|
||||||
return details['content']
|
|
||||||
except:
|
|
||||||
raise
|
|
||||||
|
|
||||||
def get_details(url):
|
def get_details(url):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -8,14 +8,11 @@ READ_API = 'http://127.0.0.1:33843/details'
|
||||||
TIMEOUT = 20
|
TIMEOUT = 20
|
||||||
|
|
||||||
def get_html(url):
|
def get_html(url):
|
||||||
try:
|
logging.info(f"Local Scraper: {url}")
|
||||||
logging.info(f"Local Scraper: {url}")
|
details = get_details(url)
|
||||||
details = get_details(url)
|
if not details:
|
||||||
if not details:
|
return ''
|
||||||
return ''
|
return details['content']
|
||||||
return details['content']
|
|
||||||
except:
|
|
||||||
raise
|
|
||||||
|
|
||||||
def get_details(url):
|
def get_details(url):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -9,13 +9,10 @@ OUTLINE_API = 'https://api.outline.com/v3/parse_article'
|
||||||
TIMEOUT = 20
|
TIMEOUT = 20
|
||||||
|
|
||||||
def get_html(url):
|
def get_html(url):
|
||||||
try:
|
details = get_details(url)
|
||||||
details = get_details(url)
|
if not details:
|
||||||
if not details:
|
return ''
|
||||||
return ''
|
return details['html']
|
||||||
return details['html']
|
|
||||||
except:
|
|
||||||
raise
|
|
||||||
|
|
||||||
def get_details(url):
|
def get_details(url):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user