Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用InstaBot模块将视频上载到Instagram_Python_Python 3.x_Video_Instagram_Google Photos Api - Fatal编程技术网

Python 使用InstaBot模块将视频上载到Instagram

Python 使用InstaBot模块将视频上载到Instagram,python,python-3.x,video,instagram,google-photos-api,Python,Python 3.x,Video,Instagram,Google Photos Api,我目前正在开发一个机器人,它可以从我的谷歌照片上传一个随机媒体项目,并使用InstaBot和谷歌照片API将其上传到Instagram。上传图片没问题,但当尝试上传视频时,机器人会说 yolo.mp4已成功上传 但当我去检查Instagram账户看它是否上传时,它就不起作用了。不确定问题是在InstaBot模块中还是在Google Photos API中。任何关于上传视频的帮助都会有所帮助 以下是处理视频文件的代码片段: elif holy_mimeType == 'video'

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

yolo.mp4已成功上传
但当我去检查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