From c2d185bfdfb31dc59bead54d9897b3d8294f7e70 Mon Sep 17 00:00:00 2001 From: antonl05 Date: Sat, 29 Jan 2022 18:04:28 +0530 Subject: [PATCH] * convert some assets/json --- assets/bollywood.json | 1 + assets/classical.json | 8 +++++ assets/country.json | 42 +++++++++++++------------ assets/electronic.json | 44 +++++++++++++------------- assets/hits.json | 45 +++++++++++++++------------ assets/jazz.json | 39 ++++++++++++----------- assets/metal.json | 48 +++++++++++++++++------------ assets/news.json | 70 ++++++++++++++++++++++-------------------- assets/prot.json | 7 +++-- src/term.nim | 23 +++----------- 10 files changed, 172 insertions(+), 155 deletions(-) diff --git a/assets/bollywood.json b/assets/bollywood.json index 38711f4..ce6b252 100644 --- a/assets/bollywood.json +++ b/assets/bollywood.json @@ -2,6 +2,7 @@ "pnimrp": [ "Bombay Beats India Radio", "http://205.164.62.15:8017", + "Desi Music Mix", "http://desimusicmix.com:8000/HQ" ] diff --git a/assets/classical.json b/assets/classical.json index 0241821..3a3e47b 100644 --- a/assets/classical.json +++ b/assets/classical.json @@ -2,20 +2,28 @@ "pnimrp": [ "Pure Classic Ireland", "http://206.217.201.136:8036", + "Venice Classic Radio Italia", "http://109.123.116.202:8010/stream", + "WKSU 3 Classical", "http://66.225.205.8:8030", + "Ancient FM", "http://simplexstream.com:8058", + "Audiophile Baroque", "http://213.251.157.145:8016", + "Classical WETA", "http://38.100.128.106:8000", + "La Fenice Channel", "http://178.32.140.82:9690", + "M2 Classic", "http://sun.m2stream.fr:9000", + "Musik Klassic", "http://193.34.51.12:80" ] diff --git a/assets/country.json b/assets/country.json index 77ed49a..7287578 100644 --- a/assets/country.json +++ b/assets/country.json @@ -1,22 +1,24 @@ { - "Name1": "Absolutely Country Hits Radio", - "Name2": "Always Country", - "Name3": "Big R Radio - Country Gold", - "Name4": "Americana Boogie Radio", - "Name5": "Bluegrass Mix", - "Name6": "Country Music 24", - "Name7": "Country Radio Switzerland", - "Name8": "", - "Name9": "", - "Name10": "", - "link1": "http://185.33.22.15:7800", - "link2": "http://208.85.240.89:80", - "link3": "http://107.155.126.42:8230", - "link4": "http://us1.internet-radio.com:8182/live", - "link5": "http://192.81.248.194:8072/stream", - "link6": "http://countrymusic24.powerstream.de:9000", - "link7": "http://212.48.126.146:8000", - "link8": "", - "link9": "", - "link10": "" + "pnimrp": [ + "Absolutely Country Hits Radio", + "http://185.33.22.15:7800", + + "Always Country", + "http://208.85.240.89:80", + + "Big R Radio - Country Gold", + "http://107.155.126.42:8230", + + "Americana Boogie Radio", + "http://us1.internet-radio.com:8182/live", + + "Bluegrass Mix", + "http://192.81.248.194:8072/stream", + + "Country Music 24", + "http://countrymusic24.powerstream.de:9000", + + "Country Radio Switzerland", + "http://212.48.126.146:8000" + ] } diff --git a/assets/electronic.json b/assets/electronic.json index cbfedcf..020f92b 100644 --- a/assets/electronic.json +++ b/assets/electronic.json @@ -1,22 +1,24 @@ { - "Name1": "Ambient Sleeping Pill", - "Name2": "Ibiza Global Radio", - "Name3": "Radio Seven", - "Name4": "Antenne Bayern Chillout", - "Name5": "Frisky", - "Name6": "Nirvana Radio", - "Name7": "Puls Radio", - "Name8": "", - "Name9": "", - "Name10": "", - "link1": "http://50.7.96.138:8235/stream", - "link2": "http://37.59.254.25:8024", - "link3": "http://188.65.152.205:80", - "link4": "http://mp3channels.webradio.antenne.de:80/chillout", - "link5": "http://stream.friskyradio.com:8000/frisky_mp3_hi", - "link6": "http://91.121.134.15:9106", - "link7": "http://212.83.185.51:80", - "link8": "", - "link9": "", - "link10": "" -} + "pnimrp": [ + "Ambient Sleeping Pill", + "http://50.7.96.138:8235/stream", + + "Ibiza Global Radio", + "http://37.59.254.25:8024", + + "Radio Seven", + "http://188.65.152.205:80", + + "Antenne Bayern Chillout", + "http://mp3channels.webradio.antenne.de:80/chillout", + + "Frisky", + "http://stream.friskyradio.com:8000/frisky_mp3_hi", + + "Nirvana Radio", + "http://91.121.134.15:9106", + + "Puls Radio", + "http://212.83.185.51:80" + ] +} \ No newline at end of file diff --git a/assets/hits.json b/assets/hits.json index 171b21c..ea55dc2 100644 --- a/assets/hits.json +++ b/assets/hits.json @@ -1,22 +1,27 @@ { - "Name1": "ANTENNE BAYERN Top 40", - "Name2": "Yes! 91.2", - "Name3": "ChartHits FM", - "Name4": "Dublins KISS", - "Name5": "Hit Station FM", - "Name6": "Megahit Radio", - "Name7": "Raute Music", - "Name8": "Venus FM", - "Name9": "", - "Name10": "", - "link1": "http://mp3channels.webradio.antenne.de:80/top-40", - "link2": "http://46.4.65.194:8039", - "link3": "http://95.141.24.3:80", - "link4": "http://uk4.internet-radio.com:15476", - "link5": "http://46.163.124.61:8450", - "link6": "http://87.118.122.45:30710", - "link7": "http://193.34.51.67:80", - "link8": "http://s3.onweb.gr:8808", - "link9": "", - "link10": "" + "pnimrp": [ + "ANTENNE BAYERN Top 40", + "http://mp3channels.webradio.antenne.de:80/top-40", + + "Yes! 91.2", + "http://46.4.65.194:8039", + + "ChartHits FM", + "http://95.141.24.3:80", + + "Dublins KISS", + "http://uk4.internet-radio.com:15476", + + "Hit Station FM", + "http://46.163.124.61:8450", + + "Megahit Radio", + "http://87.118.122.45:30710", + + "Raute Music", + "http://193.34.51.67:80", + + "Venus FM", + "http://s3.onweb.gr:8808" + ] } diff --git a/assets/jazz.json b/assets/jazz.json index 6be43be..e0e0f85 100644 --- a/assets/jazz.json +++ b/assets/jazz.json @@ -1,22 +1,21 @@ { - "Name1": "Bay Smooth Jazz Radio", - "Name2": "The Jazz Groove", - "Name3": "Best Smooth Jazz", - "Name4": "Big Blue Swing", - "Name5": "Public Domain Jazz", - "Name6": "SmoothJazz Global Radio", - "Name7": "", - "Name8": "", - "Name9": "", - "Name10": "", - "link1": "http://185.33.22.15:9010", - "link2": "http://199.180.72.2:8015", - "link3": "http://64.95.243.43:8002", - "link4": "http://www.bigblueswing.com:8002", - "link5": "http://relay.publicdomainradio.org:80/classical.mp3", - "link6": "https://smoothjazz.cdnstream1.com/2585_128.mp3", - "link7": "", - "lino8": "", - "link9": "", - "link10": "" + "pnimrp": [ + "Bay Smooth Jazz Radio", + "http://185.33.22.15:9010", + + "The Jazz Groove", + "http://199.180.72.2:8015", + + "Best Smooth Jazz", + "http://64.95.243.43:8002", + + "Big Blue Swing", + "http://www.bigblueswing.com:8002", + + "Public Domain Classical Jazz", + "http://relay.publicdomainradio.org:80/classical.mp3", + + "SmoothJazz Global Radio", + "https://smoothjazz.cdnstream1.com/2585_128.mp3" + ] } diff --git a/assets/metal.json b/assets/metal.json index fa21385..7eb7e84 100644 --- a/assets/metal.json +++ b/assets/metal.json @@ -1,22 +1,30 @@ { - "Name1": "idobi Howl", - "Name2": "Metal Only", - "Name3": "STAR FM From Hell", - "Name4": "Aardschok", - "Name5": "Big R Radio", - "Name6": "Braingell Radio", - "Name7": "KNAC", - "Name8": "Metal Express Radio", - "Name9": "Radio Gothic", - "Name10": "", - "link1": "http://69.46.88.27:80", - "link2": "http://178.77.127.105:4400", - "link3": "http://80.237.153.93:7000", - "link4": "http://178.18.137.248:80", - "link5": "http://107.155.111.234:18310", - "link6": "http://206.217.213.16:8010", - "link7": "http://s5.voscast.com:7346", - "link8": "http://66.90.104.41:8248", - "link9": "http://ca.radio-streamhosting.com:8006", - "link10": "" + "pnimrp": [ + "Idobi Howl", + "http://69.46.88.27:80", + + "Metal Only", + "http://178.77.127.105:4400", + + "STAR FM From Hell", + "http://80.237.153.93:7000", + + "Aardschok", + "http://178.18.137.248:80", + + "Big R Radio", + "http://107.155.111.234:18310", + + "Braingell Radio", + "http://206.217.213.16:8010", + + "KNAC", + "http://s5.voscast.com:7346", + + "Metal Express Radio", + "http://66.90.104.41:8248", + + "Radio Gothic", + "http://ca.radio-streamhosting.com:8006" + ] } diff --git a/assets/news.json b/assets/news.json index 65eaa24..455d366 100644 --- a/assets/news.json +++ b/assets/news.json @@ -1,34 +1,38 @@ { - "Name1": "Air Progressive", - "Name2": "BBC", - "Name3": "CBC", - "Name4": "GLT News & Ideas", - "Name5": "NPR", - "Name6": "Newstalk 106-108", - "Name7": "RFI", - "Name8": "Sputnik", - "Name9": "The Source", - "Name10": "WKSU News", - "Name11": "detour TALK", - "Name12": "Freethought Radio", - "Name13": "Infowars", - "Name14": "KSFC", - "Name15": "Radio Newark", - "Name16": "Talk 790", - "link1": "http://airprogressive.org:8000/stream", - "link2": "http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-einws", - "link3": "http://3153.live.streamtheworld.com:80/CBC_R1_MCT_L_SC", - "link4": "http://wgltradio.ilstu.edu:8000/wgltmain.mp3", - "link5": "http://nprdmp-live01-mp3.akacast.akamaistream.net/7/998/364916/v1/npr.akacast.akamaistream.net/nprdmp_live01_mp3", - "link6": "http://vice02.iad.xpc-mii.net:80/communicorp/Newstalk_high", - "link7": "http://stream.rfi.fr/2588/rfi_en_anglais/rfianglais.mp3", - "link8": "http://audio1.video.ria.ru:80/voiceeng", - "link9": "http://stream.wmnf.org:8000/wmnf_hd3", - "link10": "http://66.225.205.8:8020", - "link11": "http://104.250.149.218:7300", - "link12": "http://212.48.126.146:9110", - "link13": "http://50.7.79.22:80", - "link14": "http://173.192.70.138:8710", - "link15": "http://98.114.57.7:8000", - "link16": "http://208.85.240.2:8310" -} + "pnimrp": [ + + "Name1": "Air Progressive", + "Name2": "BBC", + "Name3": "CBC", + "Name4": "GLT News & Ideas", + "Name5": "NPR", + "Name6": "Newstalk 106-108", + "Name7": "RFI", + "Name8": "Sputnik", + "Name9": "The Source", + "Name10": "WKSU News", + "Name11": "detour TALK", + "Name12": "Freethought Radio", + "Name13": "Infowars", + "Name14": "KSFC", + "Name15": "Radio Newark", + "Name16": "Talk 790", + + "link1": "http://airprogressive.org:8000/stream", + "link2": "http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-einws", + "link3": "http://3153.live.streamtheworld.com:80/CBC_R1_MCT_L_SC", + "link4": "http://wgltradio.ilstu.edu:8000/wgltmain.mp3", + "link5": "http://nprdmp-live01-mp3.akacast.akamaistream.net/7/998/364916/v1/npr.akacast.akamaistream.net/nprdmp_live01_mp3", + "link6": "http://vice02.iad.xpc-mii.net:80/communicorp/Newstalk_high", + "link7": "http://stream.rfi.fr/2588/rfi_en_anglais/rfianglais.mp3", + "link8": "http://audio1.video.ria.ru:80/voiceeng", + "link9": "http://stream.wmnf.org:8000/wmnf_hd3", + "link10": "http://66.225.205.8:8020", + "link11": "http://104.250.149.218:7300", + "link12": "http://212.48.126.146:9110", + "link13": "http://50.7.79.22:80", + "link14": "http://173.192.70.138:8710", + "link15": "http://98.114.57.7:8000", + "link16": "http://208.85.240.2:8310" + ] +} \ No newline at end of file diff --git a/assets/prot.json b/assets/prot.json index 9f24e54..9ba9d21 100644 --- a/assets/prot.json +++ b/assets/prot.json @@ -1,5 +1,6 @@ { "pnimrp": [ - "" - ] -} + + + ] +} \ No newline at end of file diff --git a/src/term.nim b/src/term.nim index 2f1676f..0d8ef7b 100644 --- a/src/term.nim +++ b/src/term.nim @@ -6,8 +6,8 @@ proc clear* = setCursorPos 0,0 proc error*(str:string) = - styledEcho fgRed, "Error: ", str - quit QuitFailure + styledEcho fgRed, "Error: ", str + quit QuitFailure proc sayBye(str: string; auth = "Human"; line = -1) = if auth == "": @@ -19,7 +19,7 @@ proc sayBye(str: string; auth = "Human"; line = -1) = setCursorXPos 15 styledEcho fgGreen, "—", auth -proc parseJ(x:string):JsonNode = +proc parseJ(x: string): JsonNode = parseJson readFile fmt"assets/{x}.json" proc parseJArray(file: string): seq[string] = @@ -32,20 +32,7 @@ proc exitEcho* = showCursor() echo "" randomize() -#[ case rand 1..6: - of 1: sayBye "When I Die, Keep Playing The Records" - of 2: sayBye "Where words fail, music speaks", "Hans Christian Andersen" - of 3: sayBye "Country music is three chords and truth", "Harlan Howard" - of 4: - sayBye "There are two ways of refuge from misery — music and cats", - "Albert Schweitzer" - of 5: sayBye "Music is a safe kind of high", "Jimi Hendrix" - of 6: - sayBye "You enjoy music when you're happy, you understand lyrics when you're sad", - "Frank Ocean" - else: discard -]# var seq = parseJArray "qoute" #jimiHendrixHarlandHowardBug @@ -63,7 +50,7 @@ proc exitEcho* = echo fmt"occupied mem: {getOccupiedMem() / 1024} kB" quit() -proc say*(txt:string) = +proc say*(txt: string) = styledEcho fgYellow,txt proc sayPos*(x:int,a:string; echo = true) = @@ -116,7 +103,7 @@ proc exit(ctx:ptr handle, isPaused: bool) = terminateDestroy ctx exitEcho() -template cE(s:cint) = checkError s +template cE(s: cint) = checkError s proc init(parm:string,ctx: ptr handle) = let file = allocCStringArray ["loadfile", parm] #couldbe file,link,playlistfile