{"id":18104479,"url":"https://github.com/zogoo/preview_images","last_synced_at":"2025-04-06T06:16:38.870Z","repository":{"id":115121325,"uuid":"179842995","full_name":"Zogoo/preview_images","owner":"Zogoo","description":"Ruby script that allows you to concurrently download images from multiple camera.","archived":false,"fork":false,"pushed_at":"2019-04-11T13:36:37.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T11:51:30.817Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zogoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-06T14:24:13.000Z","updated_at":"2022-02-15T03:31:32.000Z","dependencies_parsed_at":"2023-04-24T15:17:46.165Z","dependency_job_id":null,"html_url":"https://github.com/Zogoo/preview_images","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zogoo%2Fpreview_images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zogoo%2Fpreview_images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zogoo%2Fpreview_images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zogoo%2Fpreview_images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zogoo","download_url":"https://codeload.github.com/Zogoo/preview_images/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441057,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-10-31T22:14:56.939Z","updated_at":"2025-04-06T06:16:38.846Z","avatar_url":"https://github.com/Zogoo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Access cameras and get preview images from camera\n\n[![Build Status](https://travis-ci.org/Zogoo/preview_images.png)](https://travis-ci.org/Zogoo/preview_images.png)\n\nEEN have cool api for control and manage cameras.\nhttps://apidocs.eagleeyenetworks.com/apidocs\n\nFirst you need to register your user and get api key. Everything is well explained in the document.\n\nWith this repo contain ruby script which is retrieve images from camera.\n\n##### Steps for retrieve images\n\nYou can easily test with CURL with following commands.\nNote: Commands are well explained in the document if you need more info please take a look at it.\n\n1. Get token\ncurl -X POST https://login.eagleeyenetworks.com/g/aaa/authenticate -d '{\"username\": \"\", \"password\": \"\"}' -H \"content-type: application/json\" -H \"Authentication: [api key]\"\n\n2. Get auth_key from cookie and active_brand_subdomain, camera_access from body\nauth_key: will be used next requests\nactive_brand_subdomain: for performance\ncamera_access: to get camera\ncurl -D - -X POST https://login.eagleeyenetworks.com/g/aaa/authorize -d '{\"token\": \"\"}' -H \"content-type: application/json\"\n\n3. Get available cameras and pick one of them. Camera Id (id) from body\ncurl --request GET https://[active_brand_subdomain].eagleeyenetworks.com/g/device/list -H \"Authentication: [api key]\" --cookie \"auth_key=[AUTH_KEY]\"\n\n4. Get preview images from camera\ncurl -X GET https://[active_brand_subdomain].eagleeyenetworks.com/asset/asset/image.jpeg -d \"id=[CAMERA_ID]\" -d \"timestamp=now\" -d \"asset_class=pre\" -H \"Authentication: [api key]\" --cookie \"auth_key=[AUTH_KEY]\" -G -v\n\n##### How to use ruby script\n\n###### 1. Setup env variable\n\nCreate your own .env variable and setup following information\n\n```\n  PROTOCOL=https\n  DEFAULT_SUBDOMAIN=login\n  HOST=eagleeyenetworks.com\n  USER_NAME=\u003cusername\u003e\n  PASSWORD=\u003cpassword\u003e\n  API_KEY=\n  CONCURENCY_LIMIT=5\n  LOG_FILE_NAME='faraday.log'\n```\n\n###### 2. Execute ruby script\n\nOpen your command line execute ruby and you will get images in output folder\n\n```\n ./image.rb\n```\n\n###### 3. Get results\n\nYou can find images from `./output` folder\n\nOr if you want to just see sample result please take a look `./output/sample`\n\n##### TODO\n\n1. Image request sometimes failing 400 or 401 error\nHTTP is not stable enough protocol so we need to retry at least 3 times.\n\n3. Corner case for test cases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzogoo%2Fpreview_images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzogoo%2Fpreview_images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzogoo%2Fpreview_images/lists"}