我的代码存在一个问题,无论我如何尝试,每次我回复一条推文时,它都只是作为定期状态更新发布在我的时间轴上。
这是代码片段
class StreamListener(tweepy.StreamListener):
def on_status(self, status):
tweetid = status.id
tweetnouser = status.text.replace("@CarlWheezerBot", "")
username = '@'+status.user.screen_name
user_tweet = gTTS(text=tweetnouser, lang='en', slow=False)
# Saving the converted audio
user_tweet.save("useraudio/text2speech.mp3")
# importing the audio and getting the audio all mashed up
text2speech = AudioFileClip("useraudio/text2speech.mp3")
videoclip = VideoFileClip("original_video/original_cut.mp4")
editedAudio = videoclip.audio
# splicing the original audio with the text2speech
compiledAudio = CompositeAudioClip([editedAudio.set_duration(3.8), text2speech.set_start(3.8)])
videoclip.audio = compiledAudio
# saving the completed video fie
videoclip.write_videofile("user_video/edited.mp4", audio_codec='aac')
upload_result = api.media_upload("user_video/edited.mp4")
api.update_status( status='@CarlWheezerBot',in_reply_to_status_id=[tweetid], media_ids=[upload_result.media_id_string], auto_populate_reply_metadata=True)
我也尝试过使用任何状态,以及使用status.id_str。似乎没有任何工作。,我也没有元数据参数就完成了它。我正在逐字逐句地跟着文档。
好的。给以后阅读的每个人
用这个 in_reply_to_status_id=tweetid
不要使用方括号。现在一切正常
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句