Merge branch 'main' of gitlab.com:bashrc2/epicyon

merge-requests/30/head
Bob Mottram 2022-02-22 12:17:45 +00:00
commit 22a5a30160
2 changed files with 14 additions and 5 deletions

View File

@ -1524,10 +1524,14 @@ class PubServer(BaseHTTPRequestHandler):
self.server.outbox_thread_index[account_outbox_thread_name] = index
# remove any existing thread from the current index in the buffer
if self.server.outboxThread.get(account_outbox_thread_name):
acct = account_outbox_thread_name
if self.server.outboxThread[acct][index].is_alive():
self.server.outboxThread[acct][index].kill()
acct = account_outbox_thread_name
if self.server.outboxThread.get(acct):
if len(self.server.outboxThread[acct]) > index:
try:
if self.server.outboxThread[acct][index].is_alive():
self.server.outboxThread[acct][index].kill()
except BaseException:
pass
return index
def _post_to_outbox_thread(self, message_json: {}) -> bool:

View File

@ -176,8 +176,13 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
if '/c/' in url:
# don't try to embed peertube channel page
continue
url = url.replace('/w/', '/embed/')
if '/w/' in url:
if '/videos/' not in url:
url = url.replace('/w/', '/videos/embed/')
else:
url = url.replace('/w/', '/embed/')
url = url.replace('/watch/', '/embed/')
content += \
"<center>\n<iframe loading=\"lazy\" " + \
"sandbox=\"allow-same-origin " + \