https://github.com/fabian-thomas/odesli-cli
CLI client for the Odesli/Songlink API.
https://github.com/fabian-thomas/odesli-cli
cli odesli songlink
Last synced: 5 months ago
JSON representation
CLI client for the Odesli/Songlink API.
- Host: GitHub
- URL: https://github.com/fabian-thomas/odesli-cli
- Owner: fabian-thomas
- License: mit
- Created: 2021-10-13T21:36:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-02T16:40:03.000Z (over 4 years ago)
- Last Synced: 2025-10-11T09:00:00.272Z (8 months ago)
- Topics: cli, odesli, songlink
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# odesli-cli
CLI client for the Odesli/Songlink API.
This project uses [python-odesli](https://github.com/fabian-thomas/python-odesli) for the API calls.
## Installation
```bash
pip install odesli-cli
```
### From source
Install the PyPI package `build`:
```bash
pip install build
```
Then (from the root of the repo):
```bash
python -m build
pip install dist/*.whl
```
## Sample usages:
### Get information on a song by it's url
```bash
odesli-cli '{URL}' all
```
### Convert current Spotify track to Tidal link and copy it to the X clipboard (Linux only)
```bash
current_spotify="$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep xesam:url | awk '{print $2}')"
odesli-cli "$current_spotify" --provider tidal link | xclip -selection clipboard
```
### Open Tidal, Spotify, etc. links directly in the Spotify app (The coolest one, Linux only)
For this functionality one needs to hack a bit more. I have it all set up with my Linux dofiles, so trust me, it works.
Just some key points to make it work:
- Create a shell script that can handle all sorts of http(s) links and set it as the mime default.
- Match Tidal, etc. links, convert them with this tool and play them with `qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "{URI}"`.
- Match Spotify links and play them directly with above command (note that you need to convert the url to a uri in both cases).
If you need additional information don't hesitate to contact me via mail. I haven't tried the dbus command for playing with the Tidal or Deezer apps, but it may work for them in the same fashion.