Python; Upload Video to Facebook with Youtube URL
You can upload direct video links to your Facebook profile and then watch them with the Facebook package. If you are looking for a way to upload your videos to YouTube, you can use this method to upload your videos directly from the link and then upload your videos to YouTube.
You can upload the direct video link to your Facebook profile using the Python script that I gave you after receiving access_token. You have 2 options for this, or
Upload Video to Facebook with Url – Python
1-qpython I created in Facebok.if you want to get a token at a time via the club application, I need to add you to the application, so let me know your Facebook ID.
Go to this link to get token
You will then be redirected to the forum home page, but token will appear in the address line
Your token.”.access_tocken=” with “&expires..”it is the code that remains between, you copy it and write it in quotes in the code that I gave you.
Two – Developer.facebook.com you can access support&tools via graphapi by giving yourself “public_actions, user_videos, user_photos” permissions. This may also ask you to open an application, but you will have to do the same thing each time.
After receiving the token and recording the code, you will run the code and you will already receive the code for questions such as video description and title, then the video ID and “upload completed, 1-2 minutes later will be reflected in your profile.”when you receive notification that the installation has occurred, it will be reflected in your profile after you wait a while.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | #qpy:console access_token = "" import platform import subprocess import os, sys if platform.platform().startswith("Linux"): try: import requests except: arg="pip install requests" os.system(sys.executable+" "+sys.prefix+"/bin/"+arg) os.execv(sys.executable, ['python'] + sys.argv) try: from requests_toolbelt import MultipartEncoder except: arg="pip install requests_toolbelt" os.system(sys.executable+" "+sys.prefix+"/bin/"+arg) os.execv(sys.executable, ['python'] + sys.argv) else: try: import requests except: subprocess.call(["python","-m","pip","install","requests"]) import requests try: from requests_toolbelt import MultipartEncoder except: subprocess.call(["python","-m","pip","install","requests_toolbelt"]) from requests_toolbelt import MultipartEncoder if platform.platform().startswith("Linux"): try : import androidhelper droid = androidhelper.Android() video_url = droid.dialogGetInput('Facebook Video Url', 'Link girin:', droid.getClipboard().result).result except: video_url = raw_input("link gir: ") else: from Tkinter import * import ttk root = Tk() root.title("Your Link") root.resizable(width=FALSE, height=FALSE) pgen = 500 pyuks = 100 ekrangen = root.winfo_screenwidth() x = (ekrangen - pgen) / 2 root.geometry("%dx%d+%d+%d"%(pgen, pyuks, x, 200)) def clp(event = None): global video_url video_url = entry.get() root.destroy() entry = Entry(root, width=80) entry.pack(pady=15) ttk.Style().configure("prk.TButton", padding=6, relief="flat", background="#EBE6E6", foreground="#347D2B", font=("DejaVuSans", 11, "bold")) tara = ttk.Button(root, text="Tamam", style='prk.TButton', command=clp, width=22) tara.pack() entry.insert(0, root.clipboard_get()) root.bind("<Return>", clp) mainloop() def put_video(video_url, page_id, access_token,description, title): video_file_name=title local_video_file=video_url path = "{0}/videos".format(page_id) fb_url = "https://graph-video.facebook.com/{0}?access_token={1}".format( path, access_token) print fb_url m = MultipartEncoder( fields={'description': description, 'title': title, 'comment':'postvideo', 'file_url': video_url } ) r = requests.post(fb_url, headers={'Content-Type': m.content_type}, data=m) if r.status_code == 200: j_res = r.json() facebook_video_id = j_res.get('id') print ("facebook_video_id = {0}".format(facebook_video_id)) print ("uploaddone, after 1,2 min will show ur profile") else: print ("Facebook upload error: {0}".format(r.text)) print video_url page_id = "me" description = raw_input("Video descp: ") title = raw_input("Video tittle: ") put_video(video_url, page_id, access_token, description, title) |
Note: there is a requirement to install facebook in 5 minutes. So the video should be installed in 5 minutes, but this does not mean that the length of the video will be 5 minutes. The Inter-Server upload speeds are much faster than ours, and 1GB of video can be uploaded in 1 min.
интересует четвертая неделя беременности подробно. https://doorhan-nw.ru/ калькулятор стоимости промышленных ворот. https://www.kalogroup.com.au/