Title: Help: privacy control and PTZ setting · Issue #6 · ageof/MyDlink-API-Python · GitHub
Open Graph Title: Help: privacy control and PTZ setting · Issue #6 · ageof/MyDlink-API-Python
X Title: Help: privacy control and PTZ setting · Issue #6 · ageof/MyDlink-API-Python
Description: Hello and thanks for this good start for querying/setting data on Dlink cameras I'm trying to modify the code to fetch the privacy settings and eventually set the PTZ. I was able to see which function was called by F12-ing the mydlink.co...
Open Graph Description: Hello and thanks for this good start for querying/setting data on Dlink cameras I'm trying to modify the code to fetch the privacy settings and eventually set the PTZ. I was able to see which funct...
X Description: Hello and thanks for this good start for querying/setting data on Dlink cameras I'm trying to modify the code to fetch the privacy settings and eventually set the PTZ. I was able to see which f...
Opengraph URL: https://github.com/ageof/MyDlink-API-Python/issues/6
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Help: privacy control and PTZ setting","articleBody":"Hello and thanks for this good start for querying/setting data on Dlink cameras\r\n\r\nI'm trying to modify the code to fetch the privacy settings and eventually set the PTZ. I was able to see which function was called by F12-ing the mydlink.com website and playing a little with controls.\r\n\r\nFirst of all, I'm able to log in and get my camera standard info (device list and device info) with no problem thanks to the provided example. But when I call the control function I get a privilege error...\r\n\r\n {'error': {'message': 'Client doesnt have privilege.', 'code': 31}}\r\n\r\nI've found that to control and get the privacy settings and even play with PTZ, the entry point is\r\n\r\n POST /v2/device/control?acces_token=ACCESSTOKEN\r\n\r\n(note the `v2`, if I put `me` in place I get another same error `{'error': {'message': 'Client doesnt have privilege.', 'code': 31, 'type': 'Device'}}`)\r\n\r\nAnd then embed the JSON to the POST body to query the info\r\n \r\n {\"data\":{\"mydlink_id\":\"1234\",\"uid\":0,\"idx\":0,\"ctrl_id\":513}}\r\n\r\nOr add a value to set the privacy\r\n\r\n {\"data\": {\"mydlink_id\": \"1234\", \"uid\": 0, \"idx\": 0, \"ctrl_id\": 513, \"value\": {\"value\": 2}}}\r\n\r\nOr PTZ\r\n\r\n {\"data\": {\"mydlink_id\": \"1234\", \"uid\": 0, \"idx\": 0, \"ctrl_id\": 26, \"value\": {\"p\": 165, \"t\": 12, \"z\": 0}}}\r\n\r\nUnfortuately I'm getting the error above, and not when I query the device list and info...\r\n\r\nI'm SOOOO close of finding this, if you find anything that might help me a little thank you in advance!\r\n\r\nExample of implementation of the get privacy function\r\n\r\n def get_device_privacy(self, mydlink_id:str) -\u003e json:\r\n\t\tdevice_privacy_url = \"https://{openapi}/v2/device/control?access_token={access_token}\".format(\r\n\t\t\topenapi=self.login_params.get('api_site')[0],\r\n\t\t\taccess_token=self.login_params.get('access_token')[0]\r\n\t\t)\r\n\t\t\t\t\r\n\t\tjson_object = {}\r\n\t\tjson_object['mydlink_id'] = mydlink_id\r\n\t\tjson_object['uid'] = 0\r\n\t\tjson_object['idx'] = 0\r\n\t\tjson_object['ctrl_id'] = 513\r\n\r\n\t\tjson_object_final = {}\r\n\t\tjson_object_final['data'] = json_object\r\n\t\t\t\t\r\n\t\tresponse = self.url_utils.get_request(url=device_privacy_url, type=self.url_utils.TYPE_POST,\r\n\t\t\t\t\t\t\t\t\t\t\t input_json=json_object_final)\r\n\r\n\t\tdevice_privacy_json = Url.parse(response.content.decode('utf8'))\r\n\t\tprint(device_privacy_json)\r\n\t\treturn device_privacy_json['data']","author":{"url":"https://github.com/Goufalite","@type":"Person","name":"Goufalite"},"datePublished":"2021-07-18T22:07:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/6/MyDlink-API-Python/issues/6"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a76a45f6-4a5a-7158-b518-f29eb1ae8a24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D85A:237A75:839D0E:B09B89:6A61859B |
| html-safe-nonce | 07621c2bd777e2da690673cdbb9cff832d99b32ee78440f2e621b3af3b66304b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODVBOjIzN0E3NTo4MzlEMEU6QjA5Qjg5OjZBNjE4NTlCIiwidmlzaXRvcl9pZCI6IjQxNDYyODk4MDY0Njg1NDc5OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d74fc79ec4692aaf1662cb661cd915676d5e3de478c370940bf0549ef5a51d58 |
| hovercard-subject-tag | issue:947126632 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ageof/MyDlink-API-Python/6/issue_layout |
| twitter:image | https://opengraph.githubassets.com/090dff054769e29bbd2560e0e7655f44f97e26baaddc6e2b3a52cb60b5ac335a/ageof/MyDlink-API-Python/issues/6 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/090dff054769e29bbd2560e0e7655f44f97e26baaddc6e2b3a52cb60b5ac335a/ageof/MyDlink-API-Python/issues/6 |
| og:image:alt | Hello and thanks for this good start for querying/setting data on Dlink cameras I'm trying to modify the code to fetch the privacy settings and eventually set the PTZ. I was able to see which funct... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Goufalite |
| hostname | github.com |
| expected-hostname | github.com |
| None | c28c2f6607f2aacbd934868d997038895c9780d08babfe918550d73773326f4c |
| turbo-cache-control | no-preview |
| go-import | github.com/ageof/MyDlink-API-Python git https://github.com/ageof/MyDlink-API-Python.git |
| octolytics-dimension-user_id | 29753283 |
| octolytics-dimension-user_login | ageof |
| octolytics-dimension-repository_id | 218527078 |
| octolytics-dimension-repository_nwo | ageof/MyDlink-API-Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 218527078 |
| octolytics-dimension-repository_network_root_nwo | ageof/MyDlink-API-Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cd05235d52ffb3318513d883a56c87a121015c8b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width