I am currently working on a bot which uploads a random media item from my google photos and uploads it to Instagram using InstaBot and the Google Photos API. Uploading pictures is fine, but when trying to upload video the bot says
yolo.mp4 has successfully been uploaded
But when I go to check the Instagram account to see if it uploaded, it doesn't work. Not sure if the problem is in the InstaBot module or in the Google Photos API. Any help regarding the video getting uploaded will help.
Here is the code sniplet which deals with the video files:
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')
Some information about the variables being used in the 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