Created
          July 30, 2023 21:50 
        
      - 
      
- 
        Save ethanpil/c92990b55e67e0072f72c73f7c25d19a to your computer and use it in GitHub Desktop. 
Revisions
- 
        ethanpil created this gist Jul 30, 2023 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ #!/bin/sh #How to play a web stream on mopidy from command line (Linux) using CURL. #Can also adjust moplidy playback volume if needed #Clear current tracklist. Will also stop playback curl -X POST -H Content-Type:application/json -d '{ "method": "core.tracklist.clear", "jsonrpc": "2.0", "id": 1 }' http://localhost:6680/mopidy/rpc #Add URL of stream to tracklist curl -X POST -H Content-Type:application/json -d '{ "method": "core.tracklist.add", "jsonrpc": "2.0", "params": { "uris": ["https://broadcast.myurl.com/radio.mp3"] }, "id": 1 }' http://localhost:6680/mopidy/rpc #Adjust volume if necessary curl -X POST -H Content-Type:application/json -d '{ "method": "core.mixer.set_volume", "jsonrpc": "2.0", "params": { "volume": 25 }, "id": 1 }' http://localhost:6680/mopidy/rpc #Play the new tracklist curl -X POST -H Content-Type:application/json -d '{ "method": "core.playback.play", "jsonrpc": "2.0", "id": 1 }' http://localhost:6680/mopidy/rpc