From 586a109a16754295afdfc29b0854346fb9f149a7 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Sun, 2 Jun 2024 15:30:20 +0000 Subject: [PATCH] drugs, urlinfo, youtube: fix 'invalid escape sequence' SyntaxWarnings --- bot/drugs.py | 2 +- bot/urlinfo.py | 10 +++++----- bot/youtube.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bot/drugs.py b/bot/drugs.py index 88ca1bb..3e79d04 100644 --- a/bot/drugs.py +++ b/bot/drugs.py @@ -113,4 +113,4 @@ class Drugs(Plugin): %%meth [] """ - self.bot.action(target, 'legt {} eine dicke Line Meth \________'.format(args.get('', mask.nick))) + self.bot.action(target, r'legt {} eine dicke Line Meth \________'.format(args.get('', mask.nick))) diff --git a/bot/urlinfo.py b/bot/urlinfo.py index f75349c..76fac8f 100644 --- a/bot/urlinfo.py +++ b/bot/urlinfo.py @@ -9,11 +9,11 @@ from . import Plugin class URLInfo(Plugin): BLACKLIST = [ - "^https?:\/\/(?:www\.)?youtube\.com", - "^https?:\/\/youtu\.be", - "^https?:\/\/w0bm\.com", - "^https?:\/\/f0ck\.me", - "^https?:\/\/(?:(?:vid|img|thumb)\.)?pr0gramm\.com" + r"^https?:\/\/(?:www\.)?youtube\.com", + r"^https?:\/\/youtu\.be", + r"^https?:\/\/w0bm\.com", + r"^https?:\/\/f0ck\.me", + r"^https?:\/\/(?:(?:vid|img|thumb)\.)?pr0gramm\.com" ] # set the size limit to 2 MB so we don't fully download too large resources diff --git a/bot/youtube.py b/bot/youtube.py index f8c360f..1225d4f 100644 --- a/bot/youtube.py +++ b/bot/youtube.py @@ -29,7 +29,7 @@ class YouTube(Plugin): item = data['items'][0] date = date_from_iso(item['snippet']['publishedAt']) - length = re.findall('(\d+[DHMS])', item['contentDetails']['duration']) + length = re.findall(r'(\d+[DHMS])', item['contentDetails']['duration']) views = int(item['statistics'].get('viewCount', 0)) likes = int(item['statistics'].get('likeCount', 0))