mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-23 20:11:11 +00:00
Catch exception on bad nitter page
This commit is contained in:
parent
4246cca0a4
commit
53d7dcdc93
11
twoot.py
11
twoot.py
|
@ -539,9 +539,9 @@ def build_config(args):
|
||||||
options = {
|
options = {
|
||||||
'nitter_instances': [
|
'nitter_instances': [
|
||||||
'n.opnxng.com', # added 10/11/2023
|
'n.opnxng.com', # added 10/11/2023
|
||||||
'nitter.ktachibana.party', # added 01/11/2023
|
|
||||||
'nitter.mint.lgbt', # added 09/02/2024
|
'nitter.mint.lgbt', # added 09/02/2024
|
||||||
'nitter.1d4.us', # added 09/02/2024
|
'nitter.1d4.us', # added 09/02/2024
|
||||||
|
# 'nitter.ktachibana.party', # added 01/11/2023
|
||||||
# 'nitter.x86-64-unknown-linux-gnu.zip', # down 09/02/2024
|
# 'nitter.x86-64-unknown-linux-gnu.zip', # down 09/02/2024
|
||||||
# 'nitter.tinfoil-hat.net', # down 09/02/2024
|
# 'nitter.tinfoil-hat.net', # down 09/02/2024
|
||||||
# 'nitter.eu.projectsegfau.lt', # down 14/11/2023
|
# 'nitter.eu.projectsegfau.lt', # down 14/11/2023
|
||||||
|
@ -687,8 +687,13 @@ def get_timeline(session, nitter_url):
|
||||||
tl = soup.find('div', class_='timeline')
|
tl = soup.find('div', class_='timeline')
|
||||||
|
|
||||||
# Get the list of direct children of timeline
|
# Get the list of direct children of timeline
|
||||||
list = tl.find_all('div', recursive=False)
|
try:
|
||||||
|
list = tl.find_all('div', recursive=False)
|
||||||
|
except AttributeError:
|
||||||
|
logging.fatal('The Nitter page ' + url + ' does not include the expected content')
|
||||||
|
logging.fatal(twit_account_page.text)
|
||||||
|
shutdown(-1)
|
||||||
|
|
||||||
timeline = []
|
timeline = []
|
||||||
for item in list:
|
for item in list:
|
||||||
classes = item['class']
|
classes = item['class']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user