{"id":15722975,"url":"https://github.com/bkbilly/dbus_mediaplayer","last_synced_at":"2025-08-25T08:19:03.233Z","repository":{"id":250476109,"uuid":"834587327","full_name":"bkbilly/dbus_mediaplayer","owner":"bkbilly","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-07T12:38:31.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T23:36:05.197Z","etag":null,"topics":[],"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/bkbilly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"bkbilly","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.me/bkbillybk"]}},"created_at":"2024-07-27T18:12:40.000Z","updated_at":"2024-08-09T02:19:42.000Z","dependencies_parsed_at":"2024-10-24T17:36:03.182Z","dependency_job_id":"1c61e56e-b058-4f56-9efa-71e69e819c16","html_url":"https://github.com/bkbilly/dbus_mediaplayer","commit_stats":null,"previous_names":["bkbilly/dbus_mediaplayer"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2Fdbus_mediaplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2Fdbus_mediaplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2Fdbus_mediaplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2Fdbus_mediaplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkbilly","download_url":"https://codeload.github.com/bkbilly/dbus_mediaplayer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276096,"owners_count":20912287,"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-10-03T22:09:52.646Z","updated_at":"2025-08-25T08:19:03.218Z","avatar_url":"https://github.com/bkbilly.png","language":"Python","funding_links":["https://github.com/sponsors/bkbilly","https://www.paypal.me/bkbillybk"],"categories":[],"sub_categories":[],"readme":"# DBus MediaPlayer\n\n[![PyPI](https://img.shields.io/pypi/v/dbus-mediaplayer.svg)](https://pypi.python.org/pypi/dbus-mediaplayer)\n![Python versions](https://img.shields.io/pypi/pyversions/dbus-mediaplayer.svg)\n![License](https://img.shields.io/pypi/l/dbus-mediaplayer.svg)\n\nThe `dbus-mediaplayer` library empowers Python applications to interact with media players on your system through the D-Bus communication protocol. This enables you to retrieve metadata (like song titles and artists), control playback (play, pause, next, etc.), and potentially even access features specific to certain media players.\n\n\n## Key Features\n\n* **Media Player Discovery:** Enumerate available media players on your system.\n* **Metadata Access:** Retrieve current song information (title, artist, album, etc.).\n* **Playback Control:** Play, Pause, Skip tracks, Volume, Position.\n* **Real-time Updates:** Utilizes callback functions to provide instant notifications of media player state changes, ensuring your application stays up-to-date.\n\n## Requirements\n\n* Python 3.7 or later\n* `jeepney` library\n\n## Installation\n\nInstall the library using pip:\n\n```bash\npip install dbus-mediaplayer\n```\n\n\n## Usage\n\nThis library offers two primary usage approaches:\n\n\n### Programmatic Control\n\nImport the DBusMediaPlayers class from your Python code:\n\n```python\nfrom dbus_mediaplayer import DBusMediaPlayers\n\ndef callback(players):\n    # Handle the list of media player objects here\n    print(players)\n\n# Create an instance of the class\nmedia_player = DBusMediaPlayers(callback)\n\n# Control media playback (replace \"PlayPause\" with desired methods like \"Play\", \"Pause\", \"Next\", etc.)\nmedia_player.control_media(\"PlayPause\")\n\n# Keep the app running\nwhile True:\n    time.sleep(1)\n```\n\n\n### Command-Line Interaction (Optional)\n\nIf you prefer a quick way to view information or control playback, you can potentially execute the dbus-mediaplayer script directly. For more extensive programmatic control, I would recommend using the library within your Python code.\nThe script supports the following optional arguments for media control:\n\n#### Status (Default):\nIf no argument is provided, the script defaults to retrieving media player information.\n```bash\ndbus-mediaplayer get-info\n```\n\n#### Volume Control:\nYou can set the volume level (between 0.0 and 1.0).\n```bash\ndbus-mediaplayer control --volume 0.5   # Sets volume to 50%\n```\n\n#### Set Media Position:\nAdjust the playback position in seconds.\n```bash\ndbus-mediaplayer control --position 120  # Sets position to 2 minutes\n```\n\n#### Playback Control:\nPerform media control actions: Play, Pause, PlayPause, Stop, Next, Previous.\n``` bash\ndbus-mediaplayer command Pause  # Pauses playback\ndbus-mediaplayer command Play   # Plays playback\n```\n\nThis flexible command-line approach offers a straightforward way to control media playback directly from the terminal.\n\n\n## Inspiration\nThis library was inspired by the MPRIS2 library, which utilizes the `dbus-python` library. However, `dbus-mediaplayer` aims to offer a more widely deployable solution, removing reliance on external dependencies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkbilly%2Fdbus_mediaplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkbilly%2Fdbus_mediaplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkbilly%2Fdbus_mediaplayer/lists"}