Skip to content

Instantly share code, notes, and snippets.

@nick3499
Created January 29, 2020 17:47
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nick3499/ae22f8640c0b28cc8a3b9c73e3a69546 to your computer and use it in GitHub Desktop.
Save nick3499/ae22f8640c0b28cc8a3b9c73e3a69546 to your computer and use it in GitHub Desktop.
Python 3: Radio Streams VLC: csv.reader(), subprocess.run()
:::::::.. :::. :::::::-. ::: ...
;;;;``;;;; ;;`;; ;;, `';,;;; .;;;;;;;.
[[[,/[[[' ,[[ '[[, `[[ [[[[[,[[ \[[,
$$$$$$c c$$$cc$$$c $$, $$$$$$$$, $$$
888b "88bo,888 888,888_,o8P'888"888,_ _,88P
MMMM "W" YMM ""` MMMMP"` MMM "YMMMMMP"
#! /snap/bin/pypy3
'''`radio_streams_vlc` displays a list of Internet radio stations along with
numbers for users to make selections. Press "h" for help.'''
from csv import reader
from subprocess import run
def station_selection():
'''`station_selection()` method displays a list of Internet radio stations
from a CSV database, and prompts the user make a selection.'''
cyan = '\x1b[38;2;72;201;176m' # format text RGB: 72, 201, 176
yelo = '\x1b[38;2;244;208;63m'
orng = '\x1b[38;2;220;118;51m'
reset = '\x1b[0m' # reset to default
urls = {} # number selection: station URL
with open('ascii_radio.txt', 'r') as ascii_art:
[print(f'{cyan}{line[:-1]}{reset}') for line in ascii_art] # ASCII art
with open('stations.csv', 'r') as _file:
_reader = reader(_file) # csv reader object
for number, record in enumerate(_reader, 1):
print(f'{cyan}{number:>2}{reset} {yelo}{record[0]:}{reset} \
{orng}{record[1]}{reset}') # print radio station list
urls[number] = record[2] # append number with URL to dictionary
station_num = int(input('Enter station number: ')) # input station number
# pass CLI args to VLC media player, including radion station URL
run(['/snap/bin/vlc', '--intf', 'ncurses', urls[station_num]], check=True)
if __name__ == '__main__':
station_selection()
DEF CON Radio [SomaFM] Mid-tempo Downtempo Chillout ChillStep ElectroSoul Ambient http://ice2.somafm.com/defcon-128-aac
Black Rock FM [SomaFM] DarkAmbient DesertElectronic http://ice2.somafm.com/brfm-128-aac
Drone Zone [SomaFM] Ambient Space http://ice4.somafm.com/dronezone-128-aac
SF 10-33 [SomaFM] Ambient | Police Dispatch http://ice4.somafm.com/sf1033-128-aac
Deep Space One [SomaFM] Ambient Space http://ice2.somafm.com/deepspaceone-128-aac
Mission Control [SomaFM] Ambient | space flight chatter http://ice4.somafm.com/missioncontrol-128-aac
Space Station Soma [SomaFM] Downtempo http://ice3.somafm.com/spacestation-128-mp3
Groove Salad [SomaFM] Ambient Downtempo http://ice4.somafm.com/groovesalad-128-aac
Groove Salad Classic [SomaFM] Downtempo Chillout http://ice4.somafm.com/gsclassic-128-aac
Mixing of Particulate Solids Ambient Experimental http://147.175.61.55:8000
Ambi103 DarkAmbient ChillOut Downtempo http://173.208.177.90:16576
FmDomPMR ChillOut Ambient PsyChill http://130.185.144.199:18832
SleepBot Env. Broadcast Ambient http://sc13.shoutcaststreaming.us:8194
Dark Ambient DarkAmbient http://95.211.3.65:8835
Ambient Fantasy [DI] Ambient http://5.39.71.159:8193
Cosmic Waves Ambient http://cosmicwaves.ru:8000
Relaxing Radio Ambient http://149.56.195.94:8660
Infinite Space Ambient Downtempo http://198.24.145.146:9654
Echoes of BLUEMARS Ambient http://streams.echoesofbluemars.org/bluemars.m3u
Cryosleep: Echoes of BLUEMARS Ambient http://streams.echoesofbluemars.org:8000/cryosleep
Dark Ambient Radio Germany http://s3.viastreaming.net:8835/
PsyradioFM Chillout Goa Ambient http://streamer.psyradio.org:8020/chillout
Verdure Russia | deep ambient | idm http://air.verdure.net:8881
Systrum Sistum: SSR1 Drone Ambient | Australia http://systrum.net:8000/Systrum-Channel1
9128 Live Ambient Techno Electronica http://streams.radio.co:80/s0aa1e6f4a/listen
Ultima Thule Ambient http://www.ultimathule.info/audio_programmes2019/UT_1298_56k.mp3
Space Travel Radio Lounge Ambient Space | Germany http://136.243.156.30:1701/stream/2/
ChromaNova Ambient | Germany http://176.31.123.212:8192
Slow Focus: NTS Relaxing Drone Ambient | London https://stream-mixtape-geo.ntslive.net/mixtape
Sleep Radio Stream Ambient | New Zealand http://149.56.234.138:8169
Seven Rays [laut.fm] New Age Chillout Ambient | Ukraine http://7rays.stream.laut.fm/7rays
Radio Record Chillout Ambient | Russia http://air.radiorecord.ru:8102/chil_320
Radio Provodach Chillout Ambient | Russia http://station.waveradio.org/provodach
Chillout Zone Drone Ambient Downtempo Lounge Chillout http://5.189.142.165:2304/stream
Radio Dimensione Relax Chillout Lounge Ambient | Italy http://tachyon.shoutca.st:8919/stream
Radio Caprice Drone Ambient | Russia http://79.111.119.111:8002/droneambient
Planet Ambi Ambient | Swiss http://philae.shoutca.st:9019
ChillTrax Chillout Downtempo Ambient http://station.chilltrax.com
Ambient Radio Ambient Chillout Meditation Lounge NewAge http://uk2.internet-radio.com:31491
Ambient Radio: Party Vibe Ambient Chillout http://94.130.238.52:8056/stream
Ambiesphere Ambient Chillout http://uk5.internet-radio.com:8347
Nirvana Meditation Ambient Chillout | Poland http://81.219.54.6:8004
Vibration Zen Relax Ambient | Swiss http://91.121.38.100:8220
Chillout Essentials [MixLive.ie] Ambient Chillout Downtempo | Ireland http://198.24.145.146:9998
Sven Radio Ambient Chillout NewAge | TechHouse EDM http://51.255.127.128:8012
Soar Walk Radio Ambient http://188.165.192.5:8193
Indie Int. Lounge Network Lounge Chillout Ambient http://206.190.130.182:8188
LFOD: Pi Radio Chillout Trap Chillstep Ambient http://radio.lfod.online:3140/mpd
Relaxing Radio Ambient http://149.56.195.94:8660
Serene Ambient Chillout Downtempo http://192.99.17.12:4950
Radio Cykx Ambient Classical Alternative http://104.238.193.114:7073
DeepSpaceChill: Radio InfoWeb Chillout EDM | New York http://stream.radioinfoweb.net:8000/chill
Radio Schizoid Psychdelic Chillout Ambient http://94.130.113.214:8000/chill
Slowmodo Rain Ambient http://149.202.79.68:8139
UVB-76 Ambient | Russia http://uk3-pn.mixstream.net:8370
Pink Noise Radio Chillout Ambient Noise | UK http://uk1.internet-radio.com:8004
intraNature Meditation Ambient Nature http://192.240.102.198:14244
@nick3499
Copy link
Author

MIT License:

Copyright 2020 nick3499

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@nick3499
Copy link
Author

nick3499 commented Jan 29, 2020

feel free to drop a comment [or suggestion, or criticism, etc]

@vdo
Copy link

vdo commented Mar 11, 2021

thank you for the list! I will definitely check it out

@vdo
Copy link

vdo commented Mar 11, 2021

I exported the list to m3u with:
cat ambient_stations.csv | awk -F "," '{ print "\#EXTINF:-1,"$1}"\\n"{print $3}' > ambient_stations.m3u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment