diff options
author | Mango0x45 <thomasvoss@live.com> | 2020-08-23 12:21:39 +0000 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2020-08-23 12:21:39 +0000 |
commit | 737771a4d7fd94c34292c69885faed49c6eb603a (patch) | |
tree | d261627dcae59a1a41c951b05d238eb08cbcba01 /cogs | |
parent | a1d82d89fe9bea901ddf6fc97f1add09fe1e7035 (diff) | |
download | steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.tar steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.tar.gz steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.tar.bz2 steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.tar.lz steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.tar.xz steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.tar.zst steve-bot-737771a4d7fd94c34292c69885faed49c6eb603a.zip |
Video filter splits on =
Diffstat (limited to 'cogs')
-rwxr-xr-x | cogs/admin.py | 4 | ||||
-rwxr-xr-x | cogs/src.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cogs/admin.py b/cogs/admin.py index c023cd4..ed7b7cc 100755 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -301,7 +301,7 @@ class Admin(commands.Cog): @commands.check(is_mod) async def blacklistvideo(self, ctx, uri): """Set runs from a specific url to be auto rejected""" - video_id = uri.split('/')[-1] + video_id = uri.split('/')[-1].split('=')[-1] with open('runs_blacklist.json', 'w') as f: self.bot.runs_blacklist["videos"].append(video_id) json.dump(self.bot.runs_blacklist, f, indent=4) @@ -320,7 +320,7 @@ class Admin(commands.Cog): @commands.check(is_mod) async def runs_blacklist(self, ctx): """Sends a list of blacklisted videos and players""" - message = '```The following URIs are blacklisted:\n' + message = '```The following videos are blacklisted:\n' for uri in self.bot.runs_blacklist["videos"]: message += f'{uri}, ' await ctx.send(f'{message[:-2]}```') diff --git a/cogs/src.py b/cogs/src.py index af54240..10cb824 100755 --- a/cogs/src.py +++ b/cogs/src.py @@ -152,7 +152,8 @@ async def pendingRuns(self, ctx): for run in pending_runs: # Reject run if video is blacklisted - if run.video.split('/')[-1] in self.bot.runs_blacklist["videos"]: + if run.video.split('/')[-1].split( + '=')[-1] in self.bot.runs_blacklist["videos"]: runs_to_reject.append( [run, 'Detected as spam by our automatic filter.']) |