diff --git a/.gitignore b/.gitignore index 0130b99..e478148 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist tts.spec random*.txt quotes.txt +tts.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f04e05..a36c4fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. If there is a `Changed` section please read carefully, as this often means that you will need to adapt your `config.yml`. +## [1.7.4] + +### Changed 1.7.4 + +* "oauth_token doesn't need to start with "oauth:" anymore +* Improved oauth-token detection + ## [1.7.3] - 2022-10-20 ### Fixed 1.7.3 diff --git a/tts.exe b/tts.exe index 091fdd9..9873fad 100644 Binary files a/tts.exe and b/tts.exe differ diff --git a/tts.py b/tts.py index e59f2ea..8d48a67 100644 --- a/tts.py +++ b/tts.py @@ -84,6 +84,8 @@ class IRC: logging.info("Connecting to: %s", server) logging.info('Waiting...') + botpass = botpass.replace('oauth:','') + try: self.irc.connect((server, port)) except ConnectionResetError: @@ -92,7 +94,7 @@ class IRC: self.irc.settimeout(1) - self.irc.send(bytes("PASS " + botpass + "\r\n", "UTF-8")) + self.irc.send(bytes("PASS oauth:" + botpass + "\r\n", "UTF-8")) self.irc.send(bytes( "USER " + botnick + " " + botnick +" " + botnick + " :python\r\n", "UTF-8") ) @@ -1257,8 +1259,10 @@ class HTTPserv(BaseHTTPRequestHandler): function displayCode() {\ var url = window.location.href;\ var test = url.indexOf(\"access_token\");\ + const queryString = window.location.search;\ + const urlParams = new URLSearchParams(queryString);\ + const token = urlParams.get(\"access_token\")\ if (test != -1) { \ - token = url.substring(42,72); \ document.getElementById(\"code\").innerHTML = \"\

oauth:\" + token + \"

\

Copy the token into your config.yml and restart \ @@ -1530,8 +1534,6 @@ def load_config(): if not CONF['IRC_OAUTH_TOKEN']: CONF['IRC_OAUTH_TOKEN'] = "Invalid" return CONF - if not CONF['IRC_OAUTH_TOKEN'].startswith('oauth:'): - raise ValueError('Your oauth-token is invalid, it has to start with: "oauth:"') return CONF @@ -1617,7 +1619,7 @@ if __name__ == "__main__": sys.tracebacklimit = 3 - VERSION = "1.7.3" + VERSION = "1.7.4" CONF = {} tts_done = [] MSG_QUEUE_RAW = []