GoProCamera.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:gopro-py-api 作者: KonradIT 项目源码 文件源码
def pair(self):
        #This is a pairing procedure needed for HERO4 and HERO5 cameras. When those type GoPro camera are purchased the GoPro Mobile app needs an authentication code when pairing the camera to a mobile device for the first time. 
        #The code is useless afterwards. This function will pair your GoPro to the machine without the need of using the mobile app -- at all.
        print("Make sure your GoPro camera is in pairing mode!\nGo to settings > Wifi > PAIR > GoProApp to start pairing.\nThen connect to it, the ssid name should be GOPRO-XXXX/GPXXXXX/GOPRO-BP-XXXX and the password is goprohero")
        code=str(input("Enter pairing code: "))
        context = ssl._create_unverified_context()
        ssl._create_default_https_context = ssl._create_unverified_context
        response_raw = urllib.request.urlopen('https://10.5.5.9/gpPair?c=start&pin=' + code + '&mode=0', context=context).read().decode('utf8')
        print(response_raw)
        response_raw = urllib.request.urlopen('https://10.5.5.9/gpPair?c=finish&pin=' + code + '&mode=0', context=context).read().decode('utf8')
        print(response_raw)
        wifi_ssid=input("Enter your desired camera wifi ssid name: ")
        wifi_pass=input("Enter new wifi password: ")
        self.gpControlCommand("wireless/ap/ssid?ssid=" + wifi_ssid + "&pw=" + wifi_pass)
        print("Connect now!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号