微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 InstaBot 模块将视频上传到 Instagram

如何解决使用 InstaBot 模块将视频上传到 Instagram

我目前正在开发一个机器人,它从我的谷歌照片上传随机媒体项目,并使用 InstaBot 和谷歌照片 API 将其上传到 Instagram。上传图片没问题,但是当尝试上传视频时,机器人说

yolo.mp4 has successfully been uploaded 但是当我去检查 Instagram 帐户以查看它是否已上传时,它不起作用。不确定问题是出在 InstaBot 模块还是出在 Google Photos API 中。任何有关视频上传的帮助都会有所帮助。

这是处理视频文件代码片段:

        elif holy_mimeType == 'video':
            audit_log.write(
                f'-------{feature3}-------\nUploaded Video from Google Photos at {datetime.datetime.time(datetime.datetime.Now()).strftime("%H:%M:%s")} ({holy_productUrl})\n')

            download_file(holy_image+'=dv',r'.\ImageBin',"yolo.mp4")
            cap = f"""Hi! If this is the first time you are seeing these types of posts,read my bio for more info
                            This is an automatic account which uploads a media Item from @{other_user} 's Google Photos!


                            This Video was shot on: {feature3} GMT and had a 1 in {len(Base_URL_list)} Chance of being uploaded
                            ---- HASHTAGS ----
                            {base_hashtags}{daily_hashtags[today]}"""
            upload_video_to_instagram(r'.\ImageBin\yolo.mp4',cap)
            if os.path.isfile(r'.\ImageBin\yolo.mp4.REMOVE_ME'):
                os.remove(r'.\ImageBin\yolo.mp4.REMOVE_ME')

关于在 sniplet 中使用的变量的一些信息:

1.holymimiType - From dataframe of all modia items and tells the type of media
2.audit_log - is a .txt file just so i can see which image is being uploaded afterwards with link
3.download_file is a function which downloads the file from URL

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。