-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
twitch.py: eval client_id and token when used with secures #555
Conversation
Hi, Thanks for the PR. The version 0.8 of the script was already released in past (current version is 0.9), and the script version must be updated as well. Also could you please fill the form in the pull request? Thanks. |
Ah my bad sorry! Updated the version. Well, while looking at the upstream version, I notice that it already contains those eval expressions. Both seems to have slightly diverged. While upstreaming it upstream, here is the produced diff: diff --git a/twitch.py b/twitch.py
index eca1d82..17f7cdf 100644
--- a/twitch.py
+++ b/twitch.py
@@ -34,6 +34,8 @@
#
# # History:
#
+# 2024-06-20, stacyharper
+# v0.10: eval client_id and token expressions. Usefull when used with weechat secures values.
# 2020-07-27,
# v0.9: added support for Oauth token to support twitch APIs requirement -mumixam
# fix bug for when api returns null for game_id -mas90
@@ -336,7 +338,7 @@ def twitch_clearchat(data, modifier, modifier_data, string):
user = mp['text']
channel = mp['channel']
try:
- tags = dict([s.split('=',1) for s in mp['tags'].split(';')])
+ tags = dict([s.split('=') for s in mp['tags'].split(';')])
except:
tags = ''
buffer = weechat.buffer_search("irc", "%s.%s" % (server, channel))
@@ -377,7 +379,7 @@ def twitch_clearmsg(data, modifier, modifier_data, string):
server = modifier_data
channel = mp['channel']
try:
- tags = dict([s.split('=',1) for s in mp['tags'].split(';')])
+ tags = dict([s.split('=') for s in mp['tags'].split(';')])
except:
tags = ''
buffer = weechat.buffer_search("irc", "%s.%s" % (server, channel))
@@ -452,7 +454,7 @@ def twitch_usernotice(data, modifier, server, string):
buffer = weechat.buffer_search(
"irc", "%s.%s" % (server, mp['channel']))
if mp['tags']:
- tags = dict([s.split('=',1) for s in mp['tags'].split(';')])
+ tags = dict([s.split('=') for s in mp['tags'].split(';')])
msg = tags['system-msg'].replace('\s',' ')
if mp['text']:
msg += ' [Comment] '+mp['text']
@@ -496,7 +498,7 @@ def twitch_in_privmsg(data, modifier, server_name, string, prefix=''):
if '#' + mp['nick'] == mp['channel']:
return mp['message_without_tags'].replace(mp['nick'], '~' + mp['nick'], 1)
- tags = dict([s.split('=',1) for s in mp['tags'].split(';')])
+ tags = dict([s.split('=') for s in mp['tags'].split(';')])
if tags['user-type'] == 'mod':
prefix += '@'
if tags['subscriber'] == '1':
@@ -642,7 +644,7 @@ if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
" /set plugins.var.python.twitch.ssl_verify off\n"
"\n\n"
" Required server settings:\n"
- " /server add twitch irc.chat.twitch.tv\n"
+ " /server add twitch irc.twitch.tv\n"
" /set irc.server.twitch.capabilities \"twitch.tv/membership,twitch.tv/commands,twitch.tv/tags\"\n"
" /set irc.server.twitch.nicks \"My Twitch Username\"\n"
" /set irc.server.twitch.password \"oauth:My Oauth Key\"\n" I could open a MR upstream to merged diffs. But why those split command diverged? |
While backporting the eval expression to weechat-scripts: weechat/scripts#555 I did notice that both version have diverged slightly. This MR merge back it upstream here.
Sorry for the delay. I see now i committed some code to my scripts repo 4 years ago but it never made it to the weechat script repo. I will submit script update PR in the next day or so hopefully i'm trying to get some clarification from @stacyharper about the changed with split() |
please close this PR. |
quoting me as co-author of the commit woud have been gentleman |
Ok seeing as Flash hasn't accept the PR yet i went ahead and added your name to it. |
Script info
Description
Checklist (new script)
New script name.py: short description…
hook_process
is used for any blocking callChecklist (script update)
script_name.py X.Y: …
Checklist (script deletion)
Remove script name.py
with reasons in description