tweepy

Twitter stream API gives JSONDecodeError(“Expecting value”, s, err.value) from None

北城余情 提交于 2020-12-16 04:56:45
问题 I am using the stream API of Twitter (through tweepy) to collect tweets matching certain criteria, but when I use json.loads() to parse the created jsonl file I get this following error: File "twitter_time_series.py", line 19, in <module> tweet = json.loads(line) File "C:\Program Files\Anaconda3\lib\json\__init__.py", line 319, in loads return _default_decoder.decode(s) File "C:\Program Files\Anaconda3\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end())

How do I async on_status from tweepy?

自古美人都是妖i 提交于 2020-12-13 06:30:13
问题 The error I'm getting is: RuntimeWarning: coroutine 'StdOutListener.on_status' was never awaited if self.on_status(status) is False: RuntimeWarning: Enable tracemalloc to get the object allocation traceback My stdOutListener looks like this: class StdOutListener(StreamListener): async def on_status(self, status): channel = await bot.get_channel(64970710814) await channel.send(status.text) I understand that I need to get on_status called async'd, but how do I do this? I've tried awaiting most

How do I async on_status from tweepy?

て烟熏妆下的殇ゞ 提交于 2020-12-13 06:29:40
问题 The error I'm getting is: RuntimeWarning: coroutine 'StdOutListener.on_status' was never awaited if self.on_status(status) is False: RuntimeWarning: Enable tracemalloc to get the object allocation traceback My stdOutListener looks like this: class StdOutListener(StreamListener): async def on_status(self, status): channel = await bot.get_channel(64970710814) await channel.send(status.text) I understand that I need to get on_status called async'd, but how do I do this? I've tried awaiting most

Tweet mp4 files with tweepy

吃可爱长大的小学妹 提交于 2020-08-23 10:52:51
问题 Hey I'd like to tweet a mp4 file generated using ffmpeg to twitter. However it seems that there's no real native way to do this with the official tweepy. When tried with the api.update_with_media(filename, message) method, you'll get an error, unsupported file 'video/mp4' So first I saw a discussion where this github project was linked: Github link But after testing out the code, the app crashs after the first INIT phase. So next I saw this: Github pull request thread And on that thread it