iewdjhrefhurewiu

remotes/1693045480750635534/spooky-22
fireworks88 2021-10-27 11:19:29 +02:00
parent 02f83e46ca
commit 3ac12cf03a
1 changed files with 2 additions and 0 deletions

View File

@ -866,10 +866,12 @@ def submit_post(v):
# archive other urls in post
url_regex = '<a href=\"(https?://[a-z]{1,20}\.[^\"]+)\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">([^\"]+)</a>'
_body = new_post.body_html
print(_body)
for url_match in re.finditer(url_regex, _body, flags=re.M|re.I):
href = url_match.group(1)
if not href:
print(f'{url_match.group(0)} skip')
continue
print(href)