Skip to content

Commit 404e0ab

Browse files
committed
Merge tag 'v1.5.6' into extend
ETM: Follow up with the latest Telegram URL restriction.
2 parents 64e4414 + 6170811 commit 404e0ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if sys.version_info.major < 3:
1111
raise Exception("Python 3.x is required. Your version is %s." % sys.version)
1212

13-
__version__ = "1.5.5"
13+
__version__ = "1.5.6"
1414

1515
parser = argparse.ArgumentParser(description="EH Forwarder Bot is an extensible chat tunnel framework which allows "
1616
"users to contact people from other chat platforms, and ultimately "

plugins/eh_telegram_master/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ def recognize(self, *args, **kwargs):
11551155
return self._reply_error(bot, update, "Language is not supported. Try with zh, ja or en. (RS03)")
11561156
if update.message.reply_to_message.voice.duration > 60:
11571157
return self._reply_error(bot, update, "Only voice shorter than 60s is supported. (RS04)")
1158-
path, mime = self._download_file(update.message, update.message.reply_to_message.voice.file_id, MsgType.Audio)
1158+
path, mime = self._download_file(update.message, update.message.reply_to_message.voice, MsgType.Audio)
11591159

11601160
results = {}
11611161
if len(args) == 0:
@@ -1273,8 +1273,8 @@ def stop_polling(self, val):
12731273

12741274
@staticmethod
12751275
def b64en(s):
1276-
return base64.b64encode(s.encode()).decode()
1276+
return base64.b64encode(s.encode(), b"-_").decode().rstrip("=")
12771277

12781278
@staticmethod
12791279
def b64de(s):
1280-
return base64.b64decode(s).decode()
1280+
return base64.b64decode((s + '=' * (- len(s) % 4)).encode(), b"-_").decode()

0 commit comments

Comments
 (0)