From ab69f0281d079f8ef431e2e21985ba58e5c5d50c Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 8 Jan 2021 23:26:15 +0800 Subject: [PATCH] support send more than 9 photos or videos --- rssbot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rssbot.py b/rssbot.py index 5fe3c8b..d5f7cb4 100644 --- a/rssbot.py +++ b/rssbot.py @@ -196,6 +196,9 @@ class main: ind = 0 di['media'] = [] for i in content['imgList']: + if ind % 9 == 0 and ind != 0: + re = self._request('sendMediaGroup', 'post', json=di) + di['media'] = [] di2 = {'type': 'photo', 'media': i} if ind == 0: di2['caption'] = text.tostr() @@ -203,6 +206,9 @@ class main: di['media'].append(di2) ind = ind + 1 for i in content['videoList']: + if ind % 9 == 0 and ind != 0: + re = self._request('sendMediaGroup', 'post', json=di) + di['media'] = [] di2 = {'type': 'video', 'media': i['src'], 'supports_streaming': True} if 'poster' in i and i['poster'] is not None and i['poster'] != '':