From d3348143bd8dddcfd3824217990e8e2e52404aac Mon Sep 17 00:00:00 2001 From: Claromes Date: Wed, 13 Dec 2023 14:34:36 -0300 Subject: [PATCH] Fix iframe --- app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 442021b..c59b0d8 100644 --- a/app.py +++ b/app.py @@ -279,17 +279,15 @@ def display_not_tweet(): response_html = requests.get(original_link) - if response_html.status_code not in range(200, 399): - st.warning('HTTP ERROR') - if mimetype[i] == 'text/html' or mimetype[i] == 'warc/revisit' or mimetype[i] == 'unk': if ('.jpg' in tweet_links[i] or '.png' in tweet_links[i]) and response_html.status_code == 200: components.iframe(tweet_links[i], height=500, scrolling=True) elif status: st.info(f'Replying to {st.session_state.current_handle}') + elif '/status/' not in original_link: + st.info('Original link is not a tweet') else: - if response_html.status_code == 200: - components.iframe(clean_link(link), height=500, scrolling=True) + components.iframe(clean_link(link), height=500, scrolling=True) st.divider() elif mimetype[i] == 'application/json': -- 2.34.1