all repos — gif-escarbot @ 465814d33970e2d31852c62fa59753995231de1f

Earthbound Café's custom delivery bot with other cool utilities built-in.

add support for youtube shorts
Marco Andronaco andronacomarco@gmail.com
Tue, 29 Aug 2023 15:21:17 +0200
commit

465814d33970e2d31852c62fa59753995231de1f

parent

4e8118e3afad72143e6ade376a9d432d221aac2c

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M escarbot/replace.pyescarbot/replace.py

@@ -35,7 +35,7 @@ return '{}:{:02}:{:02}'.format(hours, minutes, seconds)

replacers = [ { - "regex": re.compile(r"(?:(?:https?:)?\/\/)?(?:(?:www|m)\.)?(?:(?:youtube(?:-nocookie)?\.com|youtu.be))(?:\/(?:[\w\-]+\?v=|embed\/|live\/|v\/)?)([\w\-]+)(\S+)?", re_flags), + "regex": re.compile(r"(?:(?:https?:)?\/\/)?(?:(?:www|m)\.)?(?:(?:youtube(?:-nocookie)?\.com|youtu.be))(?:\/(?:[\w\-]+\?v=|embed\/|live\/|v\/|shorts\/)?)([\w\-]+)(\S+)?", re_flags), "becomes": "https://y.outube.duckdns.org/{}", "timestamp": youtube_timestamp },