# Upload Photos and Video on Insta\n # pip install instabot\n\n from instabot import Bot\n\n def Upload_Photo(img):\n robot = Bot()\n robot.login(username=”user”, password=”pass”)\n robot.upload_photo(img, caption=”Medium Article”)\n print(“Photo Uploaded”)\n\n def Upload_Video(video):\n robot = Bot()\n robot.login(username=”user”, password=”pass”)\n robot.upload_video(video, caption=”Medium Article”)\n print(“Video Uploaded”)\n\n def Upload_Story(img):\n robot = Bot()\n robot.login(username=”user”, password=”pass”)\n robot.upload_story(img, caption=”Medium Article”)\n print(“Story Photos Uploaded”)\n\n Upload_Photo(“img.jpg”)\n Upload_Video(“video.mp4”)\n <\/div>\n
\u4f7f\u7528\u6b64\u81ea\u52a8\u5316\u811a\u672c\u4e3a\u4f60\u7684\u89c6\u9891\u6dfb\u52a0\u6c34\u5370\uff0c\u8be5\u811a\u672c\u4f7f\u7528 Moviepy\uff0c\u8fd9\u662f\u4e00\u4e2a\u65b9\u4fbf\u7684\u89c6\u9891\u7f16\u8f91\u6a21\u5757\u3002\u5728\u4e0b\u9762\u7684\u811a\u672c\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5982\u4f55\u6dfb\u52a0\u6c34\u5370\u5e76\u4e14\u53ef\u4ee5\u81ea\u7531\u4f7f\u7528\u5b83\u3002<\/p>\n
# Video Watermark with Python\n # pip install moviepy\n\n from moviepy.editor import *\n clip = VideoFileClip(“myvideo.mp4”, audio=True)\n width,height = clip.size\n text = TextClip(“WaterMark”, font=Arial, color=white, fontsize=28)\n\n set_color = text.on_color(size=(clip.w + text.w, text.h-10), color=(0,0,0), pos=(6,center), col_opacity=0.6)\n set_textPos = set_color.set_pos( lambda pos: (max(width\/30,int(width-0.5* width* pos)),max(5*height\/6,int(100* pos))) )\n\n Output = CompositeVideoClip([clip, set_textPos])\n Output.duration = clip.duration\n Output.write_videofile(“output.mp4”, fps=30, codec=libx264)\n <\/div>\n
— EOF —<\/p>\n\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"
\u82f1\u6587\uff1ahttps:\/\/python.plainenglish.io\/10-python-scripts-to-automate-your-d… <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1906","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1906"}],"collection":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/comments?post=1906"}],"version-history":[{"count":1,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1906\/revisions"}],"predecessor-version":[{"id":1907,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/posts\/1906\/revisions\/1907"}],"wp:attachment":[{"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/media?parent=1906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/categories?post=1906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gyxwsjdxh.com\/wp-json\/wp\/v2\/tags?post=1906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}