mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-03-26 23:46:46 +00:00
Stop trying to regex a string into linked picture file
This commit is contained in:
parent
3500853dc8
commit
67fdbba510
1
twoot.py
1
twoot.py
@ -401,6 +401,7 @@ def main(argv):
|
|||||||
m = re.search(r"http[^ \n\xa0]*", tweet_text)
|
m = re.search(r"http[^ \n\xa0]*", tweet_text)
|
||||||
if m is not None:
|
if m is not None:
|
||||||
link_url = m.group(0)
|
link_url = m.group(0)
|
||||||
|
if link_url.endswith(".html"): # Only process a web page
|
||||||
try:
|
try:
|
||||||
r = requests.get(link_url, timeout=10)
|
r = requests.get(link_url, timeout=10)
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user