{"id":15007344,"url":"https://github.com/towsifkafi/dbus-media-http-api","last_synced_at":"2026-03-17T13:32:24.953Z","repository":{"id":219623207,"uuid":"749320960","full_name":"towsifkafi/dbus-media-http-api","owner":"towsifkafi","description":"A HTTP API interfacing with the host's DBus to manage and relay media player information using the Mris MediaPlayer2 protocol.","archived":false,"fork":false,"pushed_at":"2024-01-28T08:21:20.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T13:08:16.824Z","etag":null,"topics":["dbus","golang","http-api","linux-desktop","mpris"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/towsifkafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-28T08:21:17.000Z","updated_at":"2024-01-28T08:38:07.000Z","dependencies_parsed_at":"2024-01-28T19:43:26.869Z","dependency_job_id":null,"html_url":"https://github.com/towsifkafi/dbus-media-http-api","commit_stats":null,"previous_names":["towsifkafi/dbus-media-http-api","towsif12/dbus-media-http-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/towsifkafi/dbus-media-http-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towsifkafi%2Fdbus-media-http-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towsifkafi%2Fdbus-media-http-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towsifkafi%2Fdbus-media-http-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towsifkafi%2Fdbus-media-http-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/towsifkafi","download_url":"https://codeload.github.com/towsifkafi/dbus-media-http-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towsifkafi%2Fdbus-media-http-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28030909,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dbus","golang","http-api","linux-desktop","mpris"],"created_at":"2024-09-24T19:08:55.137Z","updated_at":"2025-12-25T14:00:43.059Z","avatar_url":"https://github.com/towsifkafi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DBus Mris MediaPlayer HTTP API\n\nThis HTTP API connects to the host's DBus to retrieve current media information. It exposes an endpoint where this information can be accessed, and various methods can be executed.\n\n## Endpoints\n\n\u003cdetails open\u003e\n    \u003csummary\u003e\u003ccode\u003eGET\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/get\u003c/b\u003e\u003c/code\u003e \u003ccode\u003eReturns a list of all available Mris MediaPlayer2 objects.\u003c/code\u003e\u003c/summary\u003e\n\n#### Response\n```json\n{\n  \"error\": false,\n  \"result\": [\n    {\n      \"service\": \"org.mpris.MediaPlayer2.APPLICATION\",\n      \"mpris:artUrl\": \"BASE64 DATA\",\n      \"mpris:length\": 1230,\n      \"mpris:trackid\": \"TRACK ID\",\n      \"playback_status\": \"Playing\",\n      \"position\": 1230,\n      \"volume\": 1,\n      \"xesam:album\": \"\",\n      \"xesam:artist\": [\n        \"ARTIST\"\n      ],\n      \"xesam:title\": \"TITLE\"\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n    \u003csummary\u003e\u003ccode\u003eGET\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/{action}/{service}\u003c/b\u003e\u003c/code\u003e \u003ccode\u003eTriggers a specified action in the provided service.\u003c/code\u003e\u003c/summary\u003e\n\n#### Valid actions: \n* `playpause`\n* `play`\n* `pause`\n* `stop`\n* `next`\n* `previous`\n\n##### Response\n```json\n{\"error\": false, \"message\": \"ACTION executed successfully\"}\n```\n\n\u003c/details\u003e\n\n\u003e [!NOTE]\n\u003e If you have `AUTH=true` and `AUTH_KEY=KEY` set in your .env file, you will need to add an `Authorization` header with the authentication key to your requests.\n\n\n## Usage\nTo run this HTTP API, you need a Linux machine with DBus installed. This project integrates with the DBus Mris Media Player for media player interaction. You will also need to compile this project.\n\nTo compile and run this project, follow these commands:\n```bash\ngit clone https://github.com/Towsif12/dbus-media-http-api.git\ncd dbus-media-http-api\n\ngo build -o dbus-media-api ./src\nchmod +x dbus-media-api\n\n./dbus-media-api\n``` \n\nOptionally, you can use a `.env` file to configure the port, authentication, and authentication key:\n```\nPORT=10004\nAUTH=true\nAUTH_KEY=key123\n```\n\n## Development\nThe development process is similar to the usage instructions. Start by cloning the repository, and then you can modify the code in the `src/` directory.\n\nTo run the project during development, use the following command:\n```sh\ngo run ./src\n```\n\nFeel free to submit a Pull Request (PR) or post an issue if you encounter any bugs or errors.\n\n## Sources\nThese links were helpful resources throughout the development of this project:\n- https://www.baeldung.com/linux/dbus\n- https://github.com/godbus/dbus/\n- https://github.com/joho/godotenv\n- https://tutorialedge.net/golang/creating-restful-api-with-golang/\n- https://specifications.freedesktop.org/mpris-spec/2.2/Player_Interface.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftowsifkafi%2Fdbus-media-http-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftowsifkafi%2Fdbus-media-http-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftowsifkafi%2Fdbus-media-http-api/lists"}