{"id":20604051,"url":"https://github.com/tschaefer/tv","last_synced_at":"2025-08-25T05:09:49.361Z","repository":{"id":144928443,"uuid":"74204009","full_name":"tschaefer/tv","owner":"tschaefer","description":":tv: REST API service for the awesome OMXPlayer and MPV.","archived":false,"fork":false,"pushed_at":"2016-12-02T21:45:17.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T02:13:09.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tschaefer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-19T11:19:20.000Z","updated_at":"2020-03-16T18:45:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1818c7f-7ad3-4262-9d52-f566f194faea","html_url":"https://github.com/tschaefer/tv","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/tschaefer%2Ftv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Ftv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Ftv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Ftv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tschaefer","download_url":"https://codeload.github.com/tschaefer/tv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242250234,"owners_count":20096890,"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":[],"created_at":"2024-11-16T09:20:18.366Z","updated_at":"2025-03-06T16:46:25.867Z","avatar_url":"https://github.com/tschaefer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tv\n\nREST API service for the awesome OMXPlayer and MPV.\n\n## Installation\n\nInstall package, scripts and systemd unit file.\n\n    $ sudo cp omx.sh /usr/local/bin/omx.sh\n    $ sudo cp mpv.sh /usr/local/bin/mpv.sh\n    $ sudo cp tv.service /etc/systemd/system/tv.service\n    $ sudo systemctl enable tv.service\n    $ sudo python setup.py install\n\n## Usage\n\nStart REST API service.\n\n    $ sudo systemctl start tv.service\n\n## REST API\n\nDocumentation is subdivided in REST API endpoints. Every endpoint is prefixed by\nfollowing base URL:\n\n    /tv/api/v1.0/\n\nEvery endpoint allows only `POST` requests and has one mandatory field `action`\nand two further fields `data` and `options`.\n\nRequest\n\n    {\n      \"action\": \"start\",\n      \"endpoint\": \"playback\",\n      \"options\": \"local\",\n      \"data\": \"https://www.youtube.com/watch?v=IAISUDbjXj0\"\n    }\n\nThe service will answer with a suitable HTTP status code and a JSON fragment.\n\nResponse *ok* 202\n\n    {\n      \"action\": \"start\",\n      \"endpoint\": \"playback\",\n      \"player\": \"omxplayer dfea8c9\\n\"\n    }\n\nResponse *error* 404\n\n    {\n      \"endpoint\": \"playback\",\n      \"error\": \"bad action\",\n      \"player\": \"omxplayer dfea8c9\\n\"\n    }\n\n### Playback\n\n| Action    | Data               | Options       | Description                       |\n| --------- | ------------------ | ------------- | --------------------------------- |\n| **start** | URI to media file  | live or local | Start player and play media file. |\n| **stop**  | *none*             | *none*        | Stop playback and player.         |\n| **play**  | *none*             | *none*        | Play / pause playback.            |\n| **pause** | *none*             | *none*        | Play / pause playback             |\n\n`live` sets the OMXPlayer options `--live --timeout=20 --adev hdmi`. `local`\nsets the OMXPlayer options `--adev hdmi`.\n\n#### Example\n\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"start\", \"data\": \"http://tinyurl.com/hv5y29q\"}' http://localhost:8090/tv/api/v1.0/playback\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"stop\" }' http://localhost:8090/tv/api/v1.0/playback\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"play\" }' http://localhost:8090/tv/api/v1.0/playback\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"pause\" }' http://localhost:8090/tv/api/v1.0/playback\n\n### Volume\n\n| Action   | Data   | Options | Description      |\n| -------- | ------ | ------- | ---------------- |\n| **up**   | *none* | *none*  | Increase volume. |\n| **down** | *none* | *none*  | Decrease volume. |\n\n#### Example\n\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"up\" }' http://localhost:8090/tv/api/v1.0/volume\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"down\" }' http://localhost:8090/tv/api/v1.0/volume\n\n### Seek\n\n| Action   | Data   | Options | Description    |\n| -------- | ------ | ------- | -------------- |\n| **fwd**  | *none* | *none*  | Seek forward.  |\n| **back** | *none* | *none*  | Seek backword. |\n\n#### Example\n\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"fwd\" }' http://localhost:8090/tv/api/v1.0/seek\n    $ curl -i -H \"Content-Type: application/json\" -X POST -d '{\"action\": \"back\" }' http://localhost:8090/tv/api/v1.0/seek\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschaefer%2Ftv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftschaefer%2Ftv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschaefer%2Ftv/lists"}