Play radio stream in TVHeadend

Can you enter the following ito your terminal and post the response:

locale charmap

Post url you used in script so I can replicate. Obviously I didn’t add any error handling :slight_smile:

URL Examples I tried:
https://tunein.com/radio/Dublin-r100911/
https://tunein.com/radio/Ireland-r101252/

In addition, the results were inconsistent … sometimes getting a larger list than others.

@zang74
$ locale charmap
UTF-8

EDIT:
https://tunein.com/radio/London-r100780/
I tried London a few minutes ago and all was as expected … it provided a list of stations that failed and no error output!

Failed URLs/streams: 
        Blast Reloaded
        BOB fm Hertfordshire & Home Counties
        Create and Craft
        Eagle Oldies
        FRL
        London Greek Radio
        Naija FM UK
        Pirate Oldies (Plymouth)
        Premier Praise
        Rinse FM
        RT UK

I changed one thing and now file is created from both url’s without error.

http://vpeter.libreelec.tv/tmp/tuneinradio_without_selenium.py

As I said, this is a simple script. It doesn’t stress-test well. In my original creation of it, my IP was actually temporarily blocked from TuneIn; I believe servers thought I was pegging the site too much. If you’re using the script a lot in a short period of time, something similar may be happening to you; TuneIn or the stream hosts may be taking offence to frequent pings. I originally had a random free proxy routine in there, but it created as many problems as it fixed. Free proxies are unreliable at best.

As @vpeter mentioned, there’s not much in the way of error handling in there, with the exception of parsing out links that return a 400 (bad request) error.

In the case of the UnicodeDecodeError you’re having, it’s more than likely because I didn’t add any character decoding/encoding in the script, forgetting that there are still people out there who’d prefer to send out everything in ASCII as opposed to UTF-8. Why? Because they like punishing themsevles? I don’t know. But basically, the site that’s failing out on you is probably sending something ASCII encoded and the lack of reencoding or error handling is causing it to fail spectacularly.

Do you know what station its failing on (and can supply a link for testing)?

zang74, you have 2 url’s few post above.

I noticed that logos are set only for /local url. I made some changes but for some reason I can’t get correct page returned to get valid url for stations. Will try later again.

http://vpeter.libreelec.tv/tmp/tuneinradio_without_selenium_logos_test.py

I was looking for specific station names to narrow things down as it’s likely one of the Gaelic titles causing problems. UTF-8 ones should be fine, but ISO-8859-1 accents will likely throw an error. I’ll check for myself though.

In my selenium version, I added the five second pause before getting the page contents in order to account for the images. They’re called by javascript, and so if an immediate dump is done, they don’t all populate. I’ve tested this with regional urls as well.

You’re getting an error, or it’s giving you an incorrect page? I find the TuneIn site to be wonky in general; it often requires a (non-headless) browser reload in order to fully display.

Through the selenium version, I’m not getting a python error:

https://tunein.com/radio/Dublin-r100911/:

pi@CronPi:~/crons$ ./testradio.py
/usr/local/lib/python3.5/dist-packages/selenium/webdriver/phantomjs/webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
  warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
Found 103.2 Dublin City FM, adding it to playlist!
Found 87.6 Chill FM, adding it to playlist!
Found 8Radio, adding it to playlist!
Found All 80s, adding it to playlist!
Found CharityRadio, adding it to playlist!
Found Christmas FM, adding it to playlist!
Found Classic Hits 4FM, adding it to playlist!
Found DDM Radio Ireland, adding it to playlist!
Found Dublin's 98FM, adding it to playlist!
Found Dublin's Q 102 FM, adding it to playlist!
Found Dublin South FM, adding it to playlist!
Found East Coast FM, adding it to playlist!
Found Emerald Radio, adding it to playlist!
Found FM104, adding it to playlist!
Found iRadio Northeast & Midlands, adding it to playlist!
Found Kfm Radio, adding it to playlist!
Found Liffey Sound FM, adding it to playlist!
Found Louth Meath FM, adding it to playlist!
Found NearFM, adding it to playlist!
Found News Talk, adding it to playlist!
Found Non-Stop 90's, adding it to playlist!
Found Phoenix FM, adding it to playlist!
Found Power FM, adding it to playlist!
Found Raidió na Life 106.4FM, adding it to playlist!
Found RTÉ 2fm, adding it to playlist!
Found RTÉ 2XM, adding it to playlist!
Found RTÉ Gold, adding it to playlist!
Found RTÉ Junior, adding it to playlist!
Found RTÉ Lyric FM, adding it to playlist!
Found RTÉ Pulse, adding it to playlist!
Found RTÉ Radio 1, adding it to playlist!
Found RTÉ Radio 1 Extra, adding it to playlist!
Found RTÉ Raidió na Gaeltachta, adding it to playlist!
Found Saint Ita's Hospital Radio, adding it to playlist!
Found SPIN 1038, adding it to playlist!
Found Spirit Radio, adding it to playlist!
Found Sunshine 106.8, adding it to playlist!
Found Tallaght FM, adding it to playlist!
Found The Zone, adding it to playlist!
Found Today FM, adding it to playlist!
Found Together FM, adding it to playlist!
Found UCB Ireland, adding it to playlist!
Found West Dublin Access Radio, adding it to playlist!
Found Xfm Dublin, adding it to playlist!
Found YAG102.5FM, adding it to playlist!

------------------------------------

Failed URLs/streams:
	Belfield FM
	Event FM
	Province 5 TV
	Radio Nova 100
	RTÉ News Now

https://tunein.com/radio/Ireland-r101252/:

pi@CronPi:~/crons$ ./testradio.py
/usr/local/lib/python3.5/dist-packages/selenium/webdriver/phantomjs/webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
  warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
Found 103.2 Dublin City FM, adding it to playlist!
Found 87.6 Chill FM, adding it to playlist!
Found C103 North, adding it to playlist!
Found CharityRadio, adding it to playlist!
Found Claremorris Community Radio, adding it to playlist!
Found Connemara Community Radio, adding it to playlist!
Found Cork City Community Radio, adding it to playlist!
Found CUH fm Hospital Radio, adding it to playlist!
Found DDM Radio Ireland, adding it to playlist!
Found Dublin South FM, adding it to playlist!
Found Dundalk FM, adding it to playlist!
Found Kiss FM Ireland, adding it to playlist!
Found NearFM, adding it to playlist!
Found News Talk, adding it to playlist!
Found Non-Stop 90's, adding it to playlist!
Found Raidió na Life 106.4FM, adding it to playlist!
Found The Zone, adding it to playlist!
Found UCC 98.3, adding it to playlist!

------------------------------------

Failed URLs/streams:
	Community Radio Youghal
	WRFM 98.2

and their respective results:

#EXTM3U

# ======================
# TuneIn Radio Playlist
# ======================

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s9123q.png" tvg-id="103.2 Dublin City FM" group-title="MyRadio" radio="true",103.2 Dublin City FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://31.14.40.241:18091/dcfm -vn -acodec libmp3lame -metadata service_provider=103.2DUBLINCITYFM -metadata service_name=103.2DUBLINCITYFM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s229919/images/logoq.png?t=1" tvg-id="87.6 Chill FM" group-title="MyRadio" radio="true",87.6 Chill FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://s4.myradiostream.com:4062/ -vn -acodec libmp3lame -metadata service_provider=87.6CHILLFM -metadata service_name=87.6CHILLFM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s162354q.png" tvg-id="8Radio" group-title="MyRadio" radio="true",8Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://ca.rcast.net:8012/ -vn -acodec libmp3lame -metadata service_provider=8RADIO94.3 -metadata service_name=8RADIO94.3 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s94781/images/logoq.png?t=151819" tvg-id="All 80s" group-title="MyRadio" radio="true",All 80s
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://91.121.113.129:8035/ -vn -acodec libmp3lame -metadata service_provider=ALL80S -metadata service_name=ALL80S -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s224391/images/logoq.png?t=152596" tvg-id="CharityRadio" group-title="MyRadio" radio="true",CharityRadio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://37.187.79.93:8640/ -vn -acodec libmp3lame -metadata service_provider=CHARITYRADIO88.1 -metadata service_name=CHARITYRADIO88.1 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s117270q.png" tvg-id="Christmas FM" group-title="MyRadio" radio="true",Christmas FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://31.14.40.241:9766/ -vn -acodec libmp3lame -metadata service_provider=CHRISTMASFM94.3 -metadata service_name=CHRISTMASFM94.3 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s100452q.png" tvg-id="Classic Hits 4FM" group-title="MyRadio" radio="true",Classic Hits 4FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://sirius.shoutca.st:8166/stream -vn -acodec libmp3lame -metadata service_provider=CLASSICHITS4FM94.9 -metadata service_name=CLASSICHITS4FM94.9 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s161453/images/logoq.jpg?t=152467" tvg-id="DDM Radio Ireland" group-title="MyRadio" radio="true",DDM Radio Ireland
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://109.255.44.249:8000/ -vn -acodec libmp3lame -metadata service_provider=DDMRADIOIRELAND99.4 -metadata service_name=DDMRADIOIRELAND99.4 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s6493q.png" tvg-id="Dublin's 98FM" group-title="MyRadio" radio="true",Dublin's 98FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.audioxi.com/98 -vn -acodec libmp3lame -metadata service_provider=DUBLIN'S98FM98.1 -metadata service_name=DUBLIN'S98FM98.1 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s15119/images/logoq.png" tvg-id="Dublin's Q 102 FM" group-title="MyRadio" radio="true",Dublin's Q 102 FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i https://gbradio.cdn.tibus.net/q102MP3128 -vn -acodec libmp3lame -metadata service_provider=DUBLIN'SQ102FM102.2 -metadata service_name=DUBLIN'SQ102FM102.2 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s135815/images/logoq.jpg?t=152570" tvg-id="Dublin South FM" group-title="MyRadio" radio="true",Dublin South FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://pollux.shoutca.st:8853/live -vn -acodec libmp3lame -metadata service_provider=DUBLINSOUTHFM93.9 -metadata service_name=DUBLINSOUTHFM93.9 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s10895q.png" tvg-id="East Coast FM" group-title="MyRadio" radio="true",East Coast FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://sirius.shoutca.st:8461/ -vn -acodec libmp3lame -metadata service_provider=EASTCOASTFM103.0 -metadata service_name=EASTCOASTFM103.0 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s134578/images/logoq.jpg?t=154807" tvg-id="Emerald Radio" group-title="MyRadio" radio="true",Emerald Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://europa.shoutca.st:8980/stream -vn -acodec libmp3lame -metadata service_provider=EMERALDRADIO93.3 -metadata service_name=EMERALDRADIO93.3 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s25895q.png" tvg-id="FM104" group-title="MyRadio" radio="true",FM104
pipe:///usr/bin/ffmpeg -loglevel fatal -i https://gbradio.cdn.tibus.net/fm104MP3128 -vn -acodec libmp3lame -metadata service_provider=FM104104.4 -metadata service_name=FM104104.4 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s87409q.png" tvg-id="iRadio Northeast & Midlands" group-title="MyRadio" radio="true",iRadio Northeast & Midlands
pipe:///usr/bin/ffmpeg -loglevel fatal -i https://stream.audioxi.com/IRADNE -vn -acodec libmp3lame -metadata service_provider=IRADIONORTHEAST&MIDLANDS104.7 -metadata service_name=IRADIONORTHEAST&MIDLANDS104.7 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s80451/images/logoq.jpg" tvg-id="Kfm Radio" group-title="MyRadio" radio="true",Kfm Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://cty.gocaster.net:8000/kfm_web -vn -acodec libmp3lame -metadata service_provider=KFMRADIO97.6 -metadata service_name=KFMRADIO97.6 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s117947/images/logoq.jpg?t=636222" tvg-id="Liffey Sound FM" group-title="MyRadio" radio="true",Liffey Sound FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.liffeysoundfm.ie:8000/ -vn -acodec libmp3lame -metadata service_provider=LIFFEYSOUNDFM96.4 -metadata service_name=LIFFEYSOUNDFM96.4 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s15105/images/logoq.jpg" tvg-id="Louth Meath FM" group-title="MyRadio" radio="true",Louth Meath FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://webradio.radiomonitor.com/stream/LMFM -vn -acodec libmp3lame -metadata service_provider=LOUTHMEATHFM95.8 -metadata service_name=LOUTHMEATHFM95.8 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s46967/images/logoq.jpg?t=154227" tvg-id="NearFM" group-title="MyRadio" radio="true",NearFM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://proxima.shoutca.st:8114/ -vn -acodec libmp3lame -metadata service_provider=NEARFM90.3 -metadata service_name=NEARFM90.3 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15123q.png" tvg-id="News Talk" group-title="MyRadio" radio="true",News Talk
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.audioxi.com/NT -vn -acodec libmp3lame -metadata service_provider=NEWSTALK106.0 -metadata service_name=NEWSTALK106.0 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s266116q.png" tvg-id="Non-Stop 90's" group-title="MyRadio" radio="true",Non-Stop 90's
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://1071.bitcast.eu:8000/audio -vn -acodec libmp3lame -metadata service_provider=NON-STOP90'S107.1 -metadata service_name=NON-STOP90'S107.1 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s148315q.png" tvg-id="Phoenix FM" group-title="MyRadio" radio="true",Phoenix FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://5.63.151.52:7054/ -vn -acodec libmp3lame -metadata service_provider=PHOENIXFM92.5 -metadata service_name=PHOENIXFM92.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s15116/images/logoq.jpg?t=636371" tvg-id="Power FM" group-title="MyRadio" radio="true",Power FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://war.powerfm.org:8000/powerfm.mp3 -vn -acodec libmp3lame -metadata service_provider=POWERFM99.5 -metadata service_name=POWERFM99.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15124q.png" tvg-id="Raidió na Life 106.4FM" group-title="MyRadio" radio="true",Raidió na Life 106.4FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://beryl.streamguys.com:5010/live -vn -acodec libmp3lame -metadata service_provider=RAIDIÓNALIFE106.4FM -metadata service_name=RAIDIÓNALIFE106.4FM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15065q.png" tvg-id="RTÉ 2fm" group-title="MyRadio" radio="true",RTÉ 2fm
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/2fm.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉ2FM90.7 -metadata service_name=RTÉ2FM90.7 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s66887q.png" tvg-id="RTÉ 2XM" group-title="MyRadio" radio="true",RTÉ 2XM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/2xm.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉ2XM -metadata service_name=RTÉ2XM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s66886q.png" tvg-id="RTÉ Gold" group-title="MyRadio" radio="true",RTÉ Gold
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/gold.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉGOLD -metadata service_name=RTÉGOLD -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s66889q.png" tvg-id="RTÉ Junior" group-title="MyRadio" radio="true",RTÉ Junior
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/junior.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉJUNIOR -metadata service_name=RTÉJUNIOR -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s24914q.png" tvg-id="RTÉ Lyric FM" group-title="MyRadio" radio="true",RTÉ Lyric FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/lyric.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉLYRICFM96.7 -metadata service_name=RTÉLYRICFM96.7 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s86575q.png" tvg-id="RTÉ Pulse" group-title="MyRadio" radio="true",RTÉ Pulse
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/pulse.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉPULSE -metadata service_name=RTÉPULSE -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s15066/images/logoq.jpg?t=1" tvg-id="RTÉ Radio 1" group-title="MyRadio" radio="true",RTÉ Radio 1
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://icecast2.rte.ie/radio1 -vn -acodec libmp3lame -metadata service_provider=RTÉRADIO188.5 -metadata service_name=RTÉRADIO188.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s70136q.png" tvg-id="RTÉ Radio 1 Extra" group-title="MyRadio" radio="true",RTÉ Radio 1 Extra
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/radio1extra.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉRADIO1EXTRA -metadata service_name=RTÉRADIO1EXTRA -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s25665q.png" tvg-id="RTÉ Raidió na Gaeltachta" group-title="MyRadio" radio="true",RTÉ Raidió na Gaeltachta
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://av.rasset.ie/av/live/radio/playlist/rnag.m3u -vn -acodec libmp3lame -metadata service_provider=RTÉRAIDIÓNAGAELTACHTA92.9 -metadata service_name=RTÉRAIDIÓNAGAELTACHTA92.9 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15113q.png" tvg-id="Saint Ita's Hospital Radio" group-title="MyRadio" radio="true",Saint Ita's Hospital Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://uk2.streamingpulse.com:8042/stream -vn -acodec libmp3lame -metadata service_provider=SAINTITA'SHOSPITALRADIO89.5 -metadata service_name=SAINTITA'SHOSPITALRADIO89.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s6530q.png" tvg-id="SPIN 1038" group-title="MyRadio" radio="true",SPIN 1038
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.audioxi.com/SP -vn -acodec libmp3lame -metadata service_provider=SPIN1038103.8 -metadata service_name=SPIN1038103.8 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s122304/images/logoq.jpg" tvg-id="Spirit Radio" group-title="MyRadio" radio="true",Spirit Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://st2.webradioworld.net/tunein.php/spiritradio01/playlist.pls -vn -acodec libmp3lame -metadata service_provider=SPIRITRADIO89.9 -metadata service_name=SPIRITRADIO89.9 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s67859/images/logoq.png" tvg-id="Sunshine 106.8" group-title="MyRadio" radio="true",Sunshine 106.8
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://sirius.shoutca.st:8291/stream -vn -acodec libmp3lame -metadata service_provider=SUNSHINE106.8 -metadata service_name=SUNSHINE106.8 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s46969q.png" tvg-id="Tallaght FM" group-title="MyRadio" radio="true",Tallaght FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://majestic.wavestreamer.com:7424/listen.pls?sid=1 -vn -acodec libmp3lame -metadata service_provider=TALLAGHTFM99.1 -metadata service_name=TALLAGHTFM99.1 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s47835q.png" tvg-id="The Zone" group-title="MyRadio" radio="true",The Zone
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://uk1.internet-radio.com:8355/ -vn -acodec libmp3lame -metadata service_provider=THEZONE102.5 -metadata service_name=THEZONE102.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s15099/images/logoq.jpg" tvg-id="Today FM" group-title="MyRadio" radio="true",Today FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.audioxi.com/TD -vn -acodec libmp3lame -metadata service_provider=TODAYFM101.8 -metadata service_name=TODAYFM101.8 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s246982/images/logoq.jpg" tvg-id="Together FM" group-title="MyRadio" radio="true",Together FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://andromeda.shoutcast.st:8216/ -vn -acodec libmp3lame -metadata service_provider=TOGETHERFM -metadata service_name=TOGETHERFM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s119399/images/logoq.png" tvg-id="UCB Ireland" group-title="MyRadio" radio="true",UCB Ireland
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://31.14.40.241:18095/ucbireland -vn -acodec libmp3lame -metadata service_provider=UCBIRELAND -metadata service_name=UCBIRELAND -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s167500q.png" tvg-id="West Dublin Access Radio" group-title="MyRadio" radio="true",West Dublin Access Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://85.25.106.172:80 -vn -acodec libmp3lame -metadata service_provider=WESTDUBLINACCESSRADIO96.0 -metadata service_name=WESTDUBLINACCESSRADIO96.0 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s16729q.png" tvg-id="Xfm Dublin" group-title="MyRadio" radio="true",Xfm Dublin
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://69.167.190.234:8888/ -vn -acodec libmp3lame -metadata service_provider=XFMDUBLIN107.9 -metadata service_name=XFMDUBLIN107.9 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s260338q.png" tvg-id="YAG102.5FM" group-title="MyRadio" radio="true",YAG102.5FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://216.55.131.213:9974 -vn -acodec libmp3lame -metadata service_provider=YAG102.5FM -metadata service_name=YAG102.5FM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTM3U

# ======================
# TuneIn Radio Playlist
# ======================

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s9123q.png" tvg-id="103.2 Dublin City FM" group-title="MyRadio" radio="true",103.2 Dublin City FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://31.14.40.241:18091/dcfm -vn -acodec libmp3lame -metadata service_provider=103.2DUBLINCITYFM -metadata service_name=103.2DUBLINCITYFM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s229919/images/logoq.png?t=1" tvg-id="87.6 Chill FM" group-title="MyRadio" radio="true",87.6 Chill FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://s4.myradiostream.com:4062/ -vn -acodec libmp3lame -metadata service_provider=87.6CHILLFM -metadata service_name=87.6CHILLFM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s107786/images/logoq.png" tvg-id="C103 North" group-title="MyRadio" radio="true",C103 North
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://wg.cdn.tibus.net/C103 -vn -acodec libmp3lame -metadata service_provider=C103NORTH102.6 -metadata service_name=C103NORTH102.6 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s224391/images/logoq.png?t=152596" tvg-id="CharityRadio" group-title="MyRadio" radio="true",CharityRadio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://37.187.79.93:8640/ -vn -acodec libmp3lame -metadata service_provider=CHARITYRADIO88.1 -metadata service_name=CHARITYRADIO88.1 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s67849q.png" tvg-id="Claremorris Community Radio" group-title="MyRadio" radio="true",Claremorris Community Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://majestic.wavestreamer.com:7983 -vn -acodec libmp3lame -metadata service_provider=CLAREMORRISCOMMUNITYRADIO94.6 -metadata service_name=CLAREMORRISCOMMUNITYRADIO94.6 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s1327q.png" tvg-id="Connemara Community Radio" group-title="MyRadio" radio="true",Connemara Community Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://78.129.196.32:21000/relay -vn -acodec libmp3lame -metadata service_provider=CONNEMARACOMMUNITYRADIO87.8 -metadata service_name=CONNEMARACOMMUNITYRADIO87.8 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s165077q.png" tvg-id="Cork City Community Radio" group-title="MyRadio" radio="true",Cork City Community Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.cr.ie:8014 -vn -acodec libmp3lame -metadata service_provider=CORKCITYCOMMUNITYRADIO100.5 -metadata service_name=CORKCITYCOMMUNITYRADIO100.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s230824q.png" tvg-id="CUH fm Hospital Radio" group-title="MyRadio" radio="true",CUH fm Hospital Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://148.163.81.10:8010/ -vn -acodec libmp3lame -metadata service_provider=CUHFMHOSPITALRADIO102.0 -metadata service_name=CUHFMHOSPITALRADIO102.0 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s161453/images/logoq.jpg?t=152467" tvg-id="DDM Radio Ireland" group-title="MyRadio" radio="true",DDM Radio Ireland
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://109.255.44.249:8000/ -vn -acodec libmp3lame -metadata service_provider=DDMRADIOIRELAND99.4 -metadata service_name=DDMRADIOIRELAND99.4 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s135815/images/logoq.jpg?t=152570" tvg-id="Dublin South FM" group-title="MyRadio" radio="true",Dublin South FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://pollux.shoutca.st:8853/live -vn -acodec libmp3lame -metadata service_provider=DUBLINSOUTHFM93.9 -metadata service_name=DUBLINSOUTHFM93.9 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s46965/images/logoq.jpg?t=636237" tvg-id="Dundalk FM" group-title="MyRadio" radio="true",Dundalk FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://80.249.249.245:8000 -vn -acodec libmp3lame -metadata service_provider=DUNDALKFM100.0 -metadata service_name=DUNDALKFM100.0 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s6008q.png" tvg-id="Kiss FM Ireland" group-title="MyRadio" radio="true",Kiss FM Ireland
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://agnes.torontocast.com:8124/stream -vn -acodec libmp3lame -metadata service_provider=KISSFMIRELAND102.7 -metadata service_name=KISSFMIRELAND102.7 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-profiles.tunein.com/s46967/images/logoq.jpg?t=154227" tvg-id="NearFM" group-title="MyRadio" radio="true",NearFM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://proxima.shoutca.st:8114/ -vn -acodec libmp3lame -metadata service_provider=NEARFM90.3 -metadata service_name=NEARFM90.3 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15123q.png" tvg-id="News Talk" group-title="MyRadio" radio="true",News Talk
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://stream.audioxi.com/NT -vn -acodec libmp3lame -metadata service_provider=NEWSTALK106.0 -metadata service_name=NEWSTALK106.0 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s266116q.png" tvg-id="Non-Stop 90's" group-title="MyRadio" radio="true",Non-Stop 90's
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://1071.bitcast.eu:8000/audio -vn -acodec libmp3lame -metadata service_provider=NON-STOP90'S107.1 -metadata service_name=NON-STOP90'S107.1 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15124q.png" tvg-id="Raidió na Life 106.4FM" group-title="MyRadio" radio="true",Raidió na Life 106.4FM
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://beryl.streamguys.com:5010/live -vn -acodec libmp3lame -metadata service_provider=RAIDIÓNALIFE106.4FM -metadata service_name=RAIDIÓNALIFE106.4FM -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s47835q.png" tvg-id="The Zone" group-title="MyRadio" radio="true",The Zone
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://uk1.internet-radio.com:8355/ -vn -acodec libmp3lame -metadata service_provider=THEZONE102.5 -metadata service_name=THEZONE102.5 -f mpegts -mpegts_service_type digital_radio pipe:1

#EXTINF:-1 tvg-logo="https://cdn-radiotime-logos.tunein.com/s15067q.png" tvg-id="UCC 98.3" group-title="MyRadio" radio="true",UCC 98.3
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://143.239.169.110:8000/listen -vn -acodec libmp3lame -metadata service_provider=UCC98.3 -metadata service_name=UCC98.3 -f mpegts -mpegts_service_type digital_radio pipe:1

EDIT: If I had to guess, the json method isn’t handing encoding well. :confused:

@JohnBoyz : As PhantomJS isn’t available on PCLOS, and the json method seems to be throwing errors, I’ve created a Chrome-friendly version. Try installing chromedriver and seeing if this works for you.

I’ve tested on my OdroidC2 (using chromium) and it works just fine. I’ve tested both Irish links with no problem.

EDIT: IF by chance chromedriver isn’t in your package manager, you should just be able to download and install manually. Make sure to pick a version number that matches the version of chrome on your system.

https://chromedriver.storage.googleapis.com/index.html

Thanks guys for all the work.
I do not see chromedriver in the repos.

There is a lot to work through so I will attempt to test each since my last post.
It might take a little time … a bit busy today.

Regards.

Using this script all seemed to work correctly for both Dublin and Ireland (I didn’t check London).
But there were different results from a browser which I try to detail below

Dublin:
Failed URLs/streams:
Belfield FM Not found using browser
Event FM Plays in browser
Heartbeat FM Plays in browser
Province 5 TV Fails to play in browser
Radio Nova 100 Plays in browser
RTÉ News Now Fails to play in browser

Ireland:
Failed URLs/streams:
Community Radio Youghal Plays in browser

I am providing the above info in case you might want to look for your own reasons, but I am really happy with the result. Thank you.

The failed stations are listed above and accessible from the two links provided earlier, so I think that covers what you need.

Simple the script might be, but the results are what counts … and they are good :slight_smile:

I got response

403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

Will try again in a day or two. Or I will change public ip in case I’m blocked.

From what i see there is possibility to make a working script with just fetching data (no need to render it).

Yeah, hit the tunein servers too many times and it assumes you’re the most pathetic ddos attack in human history and blocks your IP for a day. Proxies work.

I really think though it’s gotta be rendered to get those images. :confused:
That said, I’m generally dismayed by the poor quality of icons used by streaming services, so I just make my own anyhow.

My v2: http://vpeter.libreelec.tv/tmp/tuneinradio_without_selenium_v2.py
From quick look it seems to be working.

1 Like

@vpeter

I just checked using V2 …
This time it picked up all the London stations - 145 of them
Previous version had missed 11
The time of checking is different so that just might make a small difference, but I think not.

I checked Ireland and got no Failed either … and the one previously failed station was not listed . I have not investigated why.
Community Radio Youghal which played in Browser yesterday

Lastly I checked Dublin … no failed streams.
All 6 stations that were Failed yesterday are listed in V2.

The only negative I found is the time it now takes to generate a long list such as London area due to the 10 second delay between stations.

Thanks again :wink:

EDIT:

Is this correct syntax? … example …

#EXTINF:-1 tvg-logo=“https://cdn-radiotime-logos.tunein.com/s103141q.png” tvg-id=“Athlone Community Radio” group-title=“MyRadio” radio=“true”,Athlone Community Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i < !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> -vn -acodec libmp3lame -metadata service_provider=ATHLONECOMMUNITYRADIO88.4 -metadata service_name=ATHLONECOMMUNITYRADIO88.4 -f mpegts -mpegts_service_type digital_radio pipe:1

I guess I should explain my question in the edit above.

I have a previous .m3u file with a few stations in it, and the entries take the following form

#EXTINF:-1 tvh-chnum="1",Sunshine Radio
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://195.56.193.129:8100 -vn -acodec libmp3lame -metadata service_provider=Sunshine -metadata service_name=SunshineFM -tune zerolatency -f mpegts -mpegts_service_type digital_radio pipe:1

So the entries I now see with < !DOCTYPE html PUBLIC… are strange to me.
In addition no services are found.

Thanks.

It means the script has been used too much in too short a time:

Avoid running the script too much or this happens. After a day or so, it’ll be back to normal. TuneIn’s just overly aggressive at protecting themselves from scraper bots. If you’re running it as a cronjob, maybe just do it once or twice a week, or only if a stream fails on a regular basis.

1 Like

Adding: The “<!DOCTYPE…” statement is because it’s trying to send you an Error 403 (forbidden) page as a response.

Thanks for the explanation … was wondering about that “<!DOCTYPE…”

I will leave it for a day or so and see if I can get a correct radio station list then.

Thanks to you both for the help with this.