From 5601c71e460ada12e66a609cba5aeeb8ad829241 Mon Sep 17 00:00:00 2001 From: 0xd3d0c3d <0xd3d0c3d@protonmail.com> Date: Wed, 24 Aug 2022 14:34:16 -0500 Subject: [PATCH] v2.666 --- plugins/tool_bus_plugin.py | 59 +++++++++++++++++++++-------------- plugins/url_grabber_plugin.py | 8 +++-- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/plugins/tool_bus_plugin.py b/plugins/tool_bus_plugin.py index 49ab1e5..8e8869d 100644 --- a/plugins/tool_bus_plugin.py +++ b/plugins/tool_bus_plugin.py @@ -3,6 +3,7 @@ global bus, dims, matrixbot, ircbot from plugins.tool_dims_plugin import dims from plugins.tool_guds_plugin import guds from plugins.tool_colors_plugin import colorform as print +from random import randint as rint import re regex=re.compile("\x03(?:\d{1,2}(?:,\d{1,2})?)?",re.UNICODE) ########################################################################################### @@ -79,6 +80,16 @@ class BUS: elif network_chanroom_user_src.startswith('^'): prefix_src="^d" netsrc=network_chanroom_user_src if prefix_src=="": return + + sabotage="" + isabotage=rint(0,75) + if isabotage==9:sabotage=".smokin " + if isabotage==19:sabotage="!ai " + if isabotage==21:sabotage=".drinkin " + if isabotage==45:sabotage=".sober " + if isabotage==69:sabotage="^c " + if isabotage==73:sabotage="🖕 " + for network_chanroom_dest in self.bridged_network_roomchans: from plugins.net_irc_plugin import d_irc_msg from plugins.net_matrix_plugin import d_matrix_msg @@ -92,10 +103,10 @@ class BUS: if verbose_bridge: _data=regex.sub("",_data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=regex.sub("",data) d_telegram_msg(network_chanroom_dest,msg) @@ -104,10 +115,10 @@ class BUS: if verbose_bridge: _data=regex.sub("",_data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=regex.sub("",data) d_discord_msg(network_chanroom_dest,msg) @@ -116,10 +127,10 @@ class BUS: if verbose_bridge: _data=regex.sub("",_data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=regex.sub("",data) d_matrix_msg(network_chanroom_dest,msg) @@ -128,10 +139,10 @@ class BUS: if verbose_bridge: _data=regex.sub("",_data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {_data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=f'{_data.strip()}' d_irc_msg(network_chanroom_dest,msg) @@ -142,10 +153,10 @@ class BUS: if verbose_bridge: data=regex.sub("",data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=regex.sub("",data) d_telegram_msg(network_chanroom_dest,msg) @@ -154,10 +165,10 @@ class BUS: if verbose_bridge: data=regex.sub("",data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=regex.sub("",data) d_discord_msg(network_chanroom_dest,msg) @@ -166,10 +177,10 @@ class BUS: if verbose_bridge: data=regex.sub("",data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=regex.sub("",data) d_matrix_msg(network_chanroom_dest,msg) @@ -178,10 +189,10 @@ class BUS: if verbose_bridge: data=regex.sub("",data) if maple_dispatch: - mapled=" 👻" + mapled="👻 " else: - mapled=":" - msg=f'{user_src}{prefix_src}{mapled} {data.strip()}' + mapled="" + msg=f'{sabotage}{mapled}{user_src}{prefix_src}: {data.strip()}' else: msg=f'{data.strip()}' d_irc_msg(network_chanroom_dest,msg) diff --git a/plugins/url_grabber_plugin.py b/plugins/url_grabber_plugin.py index 2500271..d5f1590 100644 --- a/plugins/url_grabber_plugin.py +++ b/plugins/url_grabber_plugin.py @@ -69,8 +69,12 @@ class Plugin: for content in r.iter_content(chunk_size=2000): tree = fromstring(content) title = tree.find(".//title") + title = title.text.strip()[:100] if title is not None: - title = title.text.strip()[:100] + if not url.lower().find('soundcloud.com')==-1: + if title.startswith('Stream'): + title=title[7:] + title=title.split(" | Listen")[0].lower() msg = "\x02\x0302{nick:}\x0F\x02\x0304 > \x0F\x1D\x0314{title:}\x0F".format(nick=mask.nick,title=title) msg = self.bot.emo(msg) self.bot.privmsg(target, msg) @@ -114,4 +118,4 @@ class Plugin: pass ####################################################################################### ####################################################################################### -####################################################################################### EOF \ No newline at end of file +####################################################################################### EOF