一种MPlayer接口,用于收听流媒体广播。
radiop的Python项目详细描述
用于MPlayer的命令行前端,设计用于在线收听 广播很简单。
主页:http://www.guyrutenberg.com/radiopy
功能
- Allows you to easily play your favorite online radio stations.
- Adding new stations to radio.py is very simple.
- Record radio streams.
- Sleep and Wake-Up features.
- Search TuneIn for new stations.
安装
要安装radio.py,请使用pip:
pip install radiopy
最新的开发版本可通过git从SourceForge:
pip install git+http://git.code.sf.net/p/radiopy/code
有关详细信息,请参见pip documentation。
用法
usage: radio.py [OPTIONS] station_name positional arguments: station_name Station name optional arguments: -h, --help show this help message and exit -s MIN, --sleep MIN go to sleep after MIN minutes -w MIN, --wake-up MIN wake up and start playing after MIN minutes -l, --list show a list of known radio stations and their homepage -c SIZE, --cache SIZE set the size of the cache in KBytes [default: 320] -r FILE, --record FILE record the stream as mp3 and save it to FILE --random let radio.py select a random station for you -v, --verbose Verbose mode. Multiple -v options increase the verbosity -q, --quiet Quiet mode. Multiple -q options decrease the verbosity. --version show program's version number and exit
倾听
要收听电台,只需将其名称传递给radio.py:
radio.py BBC World Service
可以使用--list标志查看受支持的列表。另外,radio.py 将在给定未知电台时搜索tunein。
起床睡觉
您可以使用--wake-up和--sleep使radio.py开始播放 在指定的分钟数之后,并在指定的分钟数之后自行关闭 相应的分钟数:
radio.py --wake-up 30 BBC World Service radio.py --sleep 60 BBC World Service
录制
radio.py还支持将流记录到文件:
radio.py --record news BBC World Service
这会将原始流转储到名为news的文件中。的确切版本 文件取决于确切的流。使用的转储流可以使用 mplayer。以后可以使用avconv(或ffmpeg)转换 将流转储为任何适合您的格式。
此选项还可以与--sleep和--wake-up标志组合使用 为录音计时。
文件
radio.py附带一个内置的电台列表。如果要添加新电台 (或者覆盖现有的),您可以将它们添加到 配置)或~/.radiopy(每个用户)。格式为:
[BBC World Service News] home: http://bbcworldservice.com/ stream: http://www.bbc.co.uk/worldservice/meta/tx/nb/live/ennws.pls