{"id":13907962,"url":"https://github.com/happyleavesaoc/python-firetv","last_synced_at":"2025-04-06T12:08:06.129Z","repository":{"id":57429739,"uuid":"43840119","full_name":"happyleavesaoc/python-firetv","owner":"happyleavesaoc","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-16T18:47:35.000Z","size":110,"stargazers_count":186,"open_issues_count":11,"forks_count":38,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-30T11:08:55.005Z","etag":null,"topics":["adb","firetv","python2"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/happyleavesaoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-07T19:32:26.000Z","updated_at":"2025-03-27T13:44:29.000Z","dependencies_parsed_at":"2022-08-26T02:42:24.538Z","dependency_job_id":null,"html_url":"https://github.com/happyleavesaoc/python-firetv","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyleavesaoc%2Fpython-firetv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyleavesaoc%2Fpython-firetv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyleavesaoc%2Fpython-firetv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happyleavesaoc%2Fpython-firetv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/happyleavesaoc","download_url":"https://codeload.github.com/happyleavesaoc/python-firetv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478321,"owners_count":20945266,"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":["adb","firetv","python2"],"created_at":"2024-08-06T23:02:21.289Z","updated_at":"2025-04-06T12:08:06.112Z","avatar_url":"https://github.com/happyleavesaoc.png","language":"Python","readme":"# python-firetv\n\n`firetv` is a Python 2 and 3 package that provides state information and some control of an Amazon Fire TV device over a network. This is achieved via ADB, so therefore requires [ADB Debugging](https://developer.amazon.com/docs/fire-tv/connecting-adb-to-device.html) to be turned on. It includes `firetv-server`, an HTTP server to facilitate RESTful access to configured devices.\n\n## Installation\n\nInstall the package using the command:\n\n`pip install firetv`\n\nIf you want the HTTP server component installed as a script, use:\n\n`pip install firetv[firetv-server]`\n\n**NOTE:** You may need to install the following ADB dependencies via your package manager:\n\n* with `apt-get`: `swig libssl-dev python-dev libusb-1.0-0`\n* with `yum`: `swig openssl-devel python-devel libusbx-devel`\n\n## Server\n\nTo run the server when installed as a script:\n\n`firetv-server`\n\nIf you want to set a default Amazon Fire TV device:\n\n`firetv-server -d X.X.X.X:5555`\n\nIf you want to run on a port other than `5556`:\n\n`firetv-server -p XXXX`\n\n### systemd\n\nCopy the `firetv.service` file to `/etc/systemd/system/`. Modify the `ExecStart` path and arguments as necessary.\n\n```bash\nsystemctl enable firetv.service  # Enable on boot\nsystemctl start firetv.service   # Start server\nsystemctl stop firetv.service    # Stop server\n```\n\n### Persistence\nTo store multiple Amazon Fire TV devices persistent, you can load a yaml config file:\n`firetv-server -c some/config/file.yaml`\n\nThe config file has to be in the following format:\n```yaml\ndevices:\n  sleepingroom:\n    host: 192.168.0.13:5555\n  livingroom:\n    host: 192.168.0.16:5555\n```\n\n*Note: If you use -d and -c option together you must not name one of the devices in config file `default` or give one of the devices the same host as in -d option.*\n\n### Routes\n\nAll routes return JSON.\n\n- `GET /devices/list` (list all registered devices and state)\n- `GET /devices/connect/\u003cdevice_id\u003e` (force connection attempt)\n- `GET /devices/state/\u003cdevice_id\u003e` (return state)\n- `GET /devices/action/\u003cdevice_id\u003e/\u003caction_id\u003e` (request action)\n- `GET /devices/\u003cdevice_id\u003e/apps/running` (return running user apps)\n- `GET /devices/\u003cdevice_id\u003e/apps/\u003capp_id\u003e/start` (start an app)\n- `GET /devices/\u003cdevice_id\u003e/apps/\u003capp_id\u003e/stop` (stop an app)\n- `GET /devices/\u003cdevice_id\u003e/apps/\u003capp_id\u003e/state` (check app state)\n- `GET /devices/\u003cdevice_id\u003e/apps/state/\u003capp_id\u003e` (check app state, deprecated format)\n- `POST /devices/add` (see below)\n\n#### Add A Device\n\nIf you use the `-d` option, the specified device is added automatically with the device identifier `default`. If you want to add further devices, or don't want to use the command line option for the initial device, use the `POST /devices/add` route. The device identifier can be any string meaningful to you, matching [`[-\\w]`](https://docs.python.org/2/library/re.html) (any alphanumeric character, plus `-`).\n\nPOST JSON in the following format with the HTTP header `Content-Type: application/json`:\n```json\n{\n  \"device_id\": \"\u003cyour_device_id\u003e\",\n  \"host\": \"\u003caddress\u003e:\u003cport\u003e\"\n}\n```\n\n## Features\n\n`firetv` can detect device state and issue a number of actions. It can also get the running state of user apps.\n\n### Detected States\n\n- `off` (TV screen is dark)\n- `standby` (standard UI is active - not apps)\n- `idle` (screen saver is active)\n- `play` (video is playing)\n- `pause` (video is paused)\n- `disconnected` (can't communicate with device)\n\n### Actions\n\n- `turn_on` (turn on the device, showing the UI on screen)\n- `turn_off` (turn off the device, screen goes dark)\n- `home` (emulate Home button)\n- `media_play_pause` (emulate Play/Pause button)\n- `media_play` (simulate Play button)\n- `media_pause` (simulate Pause button)\n- `media_next` (emulate Fast-Forward button)\n- `media_previous` (emulate Rewind button)\n- `volume_up` (raise volume)\n- `volume_down` (lower volume)\n\n### Apps\n\n- `GET /devices/\u003cdevice_id\u003e/apps/running`\n- `/devices/\u003cdevice_id\u003e/apps/state/\u003capp_id\u003e`\n- `/devices/\u003cdevice_id\u003e/apps/\u003capp_id\u003e/state`\n\napp_id can be anything from a single word, e.g. 'netflix' or the full package name, e.g. com.netflix.ninja\n\nYou can start or stop an app with the following commands:\n\n- `GET /devices/\u003cdevice_id\u003e/apps/\u003capp_id\u003e/start` \n- `GET /devices/\u003cdevice_id\u003e/apps/\u003capp_id\u003e/stop` \n\napp_id must be a package name, e.g. org.xbmc.kodi or com.netflix.ninja\n\n## Contribution\n\nThis package does not fully exploit the potential of ADB access to Amazon Fire TV devices, and lacks some robustness. Contributions are welcome.\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappyleavesaoc%2Fpython-firetv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappyleavesaoc%2Fpython-firetv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappyleavesaoc%2Fpython-firetv/lists"}