我試圖上傳本地驅動器,但有些東西它不是通過蟒蛇的視頻上傳到了Facebook從本地驅動器
import requests
import json
accesstoken = '-----------------'
desc = 'This is test'
titl = 'Testing Video'
vidfbpath = '/tempvideos/0xjwseCVUlU.mp4'
source = open(vidfbpath, 'rb')
# need binary rep of this, not sure if this would do it
fburl = 'https://graph-video.facebook.com/v2.0/1098719680172720/videos?access_token='+str(accesstoken)
# put it all together to post to facebook
m = {'description': desc,
'title': titl,
'source': vidfbpath,}
r = requests.post(fburl, data=m).text
fb_res = json.loads(r)
輸出返回InsecurePlatformWarning的請求後上傳文件的視頻:一個真正的SSLContext對象不可用。這可以防止urllib3正確配置SSL,並可能導致某些SSL連接失敗。有關更多信息,請參閱https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning。 InsecurePlatformWarning
您是否嘗試了參考文獻中包含的建議? – mhawke