ms3fgx / somafm Goto Github PK
View Code? Open in Web Editor NEWA simple Python 3.x terminal interface for streaming SomaFM
License: GNU General Public License v3.0
A simple Python 3.x terminal interface for streaming SomaFM
License: GNU General Public License v3.0
I've cloned the repository, installed the both dependencies for python3:
$ pip3 show requests
Name: requests
Version: 2.22.0
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org/
Author: Kenneth Reitz
Author-email: [email protected]
License: Apache 2.0
Location: /usr/local/lib/python3.7/site-packages
Requires: idna, urllib3, chardet, certifi
Required-by:
and
$ pip3 show colorama
Name: colorama
Version: 0.4.1
Summary: Cross-platform colored terminal text.
Home-page: https://github.com/tartley/colorama
Author: Jonathan Hartley
Author-email: [email protected]
License: BSD
Location: /usr/local/lib/python3.7/site-packages
Requires:
Required-by:
There is an mplayer installed via brew also:
$ brew info mplayer
mplayer: stable 1.4 (bottled), HEAD
UNIX movie player
https://mplayerhq.hu/
/usr/local/Cellar/mplayer/1.4 (11 files, 29.2MB) *
Poured from bottle on 2019-10-11 at 10:14:39
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mplayer.rb
==> Dependencies
Build: pkg-config :heavy_check_mark:, yasm โ
Required: fontconfig :heavy_check_mark:, freetype :heavy_check_mark:, libcaca :heavy_check_mark:
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 1,381 (30 days), 4,483 (90 days), 26,054 (365 days)
install_on_request: 1,059 (30 days), 3,706 (90 days), 20,953 (365 days)
build_error: 0 (30 days)
I was able to obtain a list of the channels via ./somafm.py --list
, but if I start it without arguments or with a specific channels selected I'm getting:
Loading stream...OK
-------------------------------
Playback stopped after 00:00:00
Some other SomaFM CLI clients have an option to hit a keyboard shortcut, which would then save the song name to a saved_songs.txt file, for example.
If I find some time I will try to dig in and learn some more Python to see if I could do this myself; but figured would add it in case you wanted any ideas.
Thanks a bunch for the library!
Hi,
thank you for somafm
! I noticed it defaults to use http streams as opposed to https, I tested the same urls with https and they work fine for me. I believe it'd be fine to switch to https overall, what do you think ?
Hi,
I'm unsure how to get this to work once installed using pip in windows.
Is this supported?
(new to linux & new to python <-- just to set a context)
Considering a fresh install of Debian 11 on an amd64 box (non-gui), installing somafm via pip works - opening the app works and it makes music (mplayer and mpv are installed from previous endeavors). :)
I am having one issue and one possible feature request:
on a ctl-c, to quit the script, it errors as depicted here: https://i.imgur.com/kK40B2S.png
BTW, SSH client (putty) requires a 'reset' as chars are making it to the server but not echoed in the terminal after the error.
Also, the error orphans /tmp/soma.pid, requiring a manual rm of same before script runs again. https://i.imgur.com/XszcEGv.png
[FR?} Is it possible to have the script continue to run when it is forced to the background?
If I ctl-z to do other things in the ssh session, the player ceases to make music until I foreground it again.
If I try to force it background/subshell on launch with the & control operator, it keeps quiet, sadly.
If these are easily resolved, please advise salient details. Thanks, in advance.
~MHz
We have changed the channels.json file to return http: links when called via http:// and https:// links when called via https://somafm.com./channels.json
Rather than re-writing URLs to http for players that don't support https, I would suggest just fetching the http channels.json and maybe offer a configuration flag to enable or disable https.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.