Euro Truck Simulator 2

Euro Truck Simulator 2

53 ratings
Find & Import Radio Stream URLs (& Local Files!)
By Gabe Valentine
This guide teaches you how to find & use radio stream URLs to add custom radio stations (allowing you to listen to your favorite local stations in-game), combine the default radio stations from ETS2 & ATS, and how to play local files in-game.
3
   
Award
Favorite
Favorited
Unfavorite
Introduction
I made a fairly popular guide which adds a couple hundred real U.S. radio stations to the game. This guide will teach you how to find and use radio stream URLs to program custom radio stations for your truck, allowing you to listen to your favorite local stations in-game. It also covers how to use codecs that the game does not support, how to listen to local files with the in-game radio, how to merge the default radio stations from ETS2 with the default stations from ATS, and how to automate local transcoding with the CLI.

If you're interested in something ready-to-use, check out my other guide: Real US Radio, 200+ Stations.

Almost every radio station has an online stream and you can import such a URL by editing the live_streams.sii file located in ~\Users\YOU\Documents\Euro Truck Simulator 2 or ~\Documents\American Truck Simulator.

There several files types you will encounter:
  • .MP3: You're probably familiar with this commonly used music file format. It is also used for basic live radio streams. This is the native file type which will work in-game.
  • .AAC or MP4A: One of the two main file formats used for live radio streams but will not work with the game's radio. These are the codecs used in HTTP Live Streaming (HLS). There is a workaround that will allow you to use this file type in-game.
  • .M3U or M3U8: This is multimedia playlist format that forms the basis of HLS and Dynamic Adaptive Streaming over HTTP (DASH). They can be single or multi entry and each entry will point to a stream. The file is written in plain text and can be opened with notepad++ or notepad. The 8 suffix denotes that the file is encoded in UTF-8; files encoded this way may also include directives and comments prefaced by a hash/pound (#) such as track information.

    Every link in live_streams.sii should be formatted like this:

    stream_data[Number]: "URL|Name|Genre|Language|Bitrate|Favorite"

    • Number is unique stream id number, used by the game to organize the list.
    • URL is the direct link.
    • Name is in-game description of station.
    • Genre can be changed for organizing preferences.
    • Language is for broadcast language.
    • Bitrate. This is not autodetected by the game. You can set it to any number or leave it blank.
    • Favorite is boolean, 0 or 1.
Utilities and Tools
  • Chrome, Firefox, or another web browser with developer console. Press F12 to open this.
  • To actively transcribe a stream (see below) you will need VLC media player. VLC is a great way to test listen to streams before you import them to the game, and also a fantastic day-to-day media player. https://www.videolan.org/vlc/
  • (optional) URL Snooper 2 is a program used to analyze your computer's network traffic "to help users locate the urls of audio and video files so that they can be recorded." This can help with websites that obfuscate their media URLs. http://www.donationcoder.com/software/mouser/popular-apps/url-snooper
Finding and Importing URLs
The first step is to look at the stream on the official website. Many stations in the U.S. use iHeartRadio, such as Kiis FM 102.7 Los Angeles. iHeartRadio always uses the .aac/mp4a format and cannot be used with ETS2 or ATS. There is a workaround in the next section covering how to use .aac streams.

The example station I will use is FM Aspen 102.3 Buenos Aires. The official website for this station is fmaspen.com. This station's stream can be obtained using only your web browser. You will not need VLC or URLsnooper.

Navigate to the media player of the site and press F12 in your web browser to open developer console (ctrl+shift+J also works) and select the "Network" tab. Press play and you should see the media URLs in the network traffic console. The media file playing at player.fmaspen.com is http://18183.live.streamtheworld.com/ASPENAAC.aac.

Since this stream is .aac it cannot be used with the game. We need an .mp3 file.

The next step is to look for sites that rebroadcast this station. Head to a search engine looking for "apsen 102.3 stream." Test each site's stream, continuing to use the network monitor to see the stream's file format. The first .mp3 file on my search results was from streema.com at http://20283.live.streamtheworld.com/ASPEN.mp3. There is also an mp3 stream from radio.net at http://20833.live.streamtheworld.com/ASPEN.mp3.

The quality seems about the same on these. Both use a lower sample rate and bitrate (which lowers the quality of the stream) than the official website's .aac stream. This may be the quality that Aspen provides to these sites or they may be transcoding the file at a lower quality.

Copy the URL and format your stream_data entry following the format in the introduction section, then add it to your live_streams.sii file. If you copy this entry, replace the ??? with the next number in your current file.
stream_data[???]: "http://20283.live.streamtheworld.com/ASPEN.mp3|FM Aspen 102.3 Buenos Aires|80s|ES|64|0"
Using MP4A / AAC files (or local files) in-game
If you add an AAC stream to your live_streams file, it won't work. However, I picked up a trick from Kevin O'Connor[kevo.io] to fix this.

Here is an example URL of an mp4a stream (102.7 KIIS FM, Los Angeles):
http://c2icyelb.prod.playlists.ihrhls.com/185_icy


1. Test the stream. Open VLC, press ctrl+N, paste the stream URL, and play.
2. We will locally transcode this stream. Press ctrl+S.
3. Here you can see that VLC can transcode and stream several types of sources: local files, disc, network, or capture device. Select network. If the URL is not already there, paste it. Click stream to open the stream output wizard. Click next.
4. In the new destination drop-down, select HTTP. Click add.
5. Leave default, this will use localhost port 8080. If you have used port 8080 then choose another. Click next.
6. Active transcoding must be selected on this screen. Change profile to audio - mp3. Click next.
7. Click stream.
8 (first time only). Your firewall might prompt you then to allow VLC. If it doesn't, verify that VLC has been allowed through your firewall.

VLC will begin playing but you will not hear any audio through your speakers/headset. Instead, the local mp3 stream can now be accessed at http://localhost:8080. That is what we add to live_streams.sii, replacing the ??? with the next number in your current file.

You can verify audio is playing by opening a second instance of VLC, press ctrl+N, and enter the network URL (http://localhost:8080). You will hear the audio that is being transcoded by the first instance of VLC.

stream_data[???]: "http://localhost:8080|102.7 KIIS FM Los Angeles|Pop|EN|128|0"

Now you can open the game and play your station. You'll need to leave VLC open while you play.
Working with .m3u or playlist.m3u8 files (iHeart) - Updated 10 Sep. 2019
iHeart obfuscates their streams, making it somewhat more difficult to obtain a file for local transcoding. This section will cover where to find this file and some of its key components. The stream will be organized and split into chunks contained in .m3u8 files.

For this example I will be using WDXB 102.5 FM of Birmingham. Here is the iHeart URL to listen to the station[www.iheart.com].

Open the "Network" tab of the developer tools (F12), and play the station. As soon as the station's audio begins, you can stop the stream. Sort the files by name. There are "playlist.m3u8?listeningSessionID=BigStringHere" files. More of these will appear the longer we listen to the station. These are the chunks or parts of the stream. You can click these and see that they point to the subdomain "cdn-chunks.prod". Each chunk is an AAC/MP4a file. We don't need these.

We are looking for the file named "playlist.m3u8?init_id=NumbersAndStuff"[i.imgur.com]. This is the playlist file that initialized the connection. If you click this file, you will see a link to the station stream and the port in use[i.imgur.com]. If you enter the highlighted URL, you will download a file that can be played in VLC and contains the following if opened in Notepad++ (bottom part of last image):


This file points to "c4.prod.playlists" and the URL includes a port (443) in addition to the station identifier (3089). We can tell that this is an mp4a stream from the track information directive where it says codecs="mp4a.40.5". This is the file we can use for local transcoding. Copy everything up to the question mark and follow the instructions in the section above (Using MP4A files in-game).


Now that we understand the naming structure, it becomes easy to grab new links for transcoding. The station identifier is listed all over the place, including the URL of the station. The port is always 443 for iHeart. So all you need to format your own link is to press play on the station and identify which iHeart server the station lives on (c1, c2, c3, c4).

Merging default stations from ATS and ETS2
You can combine all the default stations into one live_streams.sii file and use it in both games. You will need to own and install both games.

1. Run each game and select radio. Press "update from internet."
2. Navigate to the ~\Documents\Euro Truck Simulator 2 folder and open live_streams.sii.
3. Copy everything from "stream_data[0]" down to the last station (don't copy the curly brackets at the end of the file).
4. Navigate to ~\Documents\American Truck Simulator and open the live_streams.sii file there.
5. Paste above "stream_data[0]" then head to the end of the list. Rename everything in sequential order. If the last number you pasted was 235, the "stream_data[0]" below it will become 236. Do this for all 38 default ATS stations then save the file.
6. Copy the live_streams.sii file from the ~\Documents\American Truck Simulator into ~\Documents\Euro Truck Simulator 2 and replace when prompted.
(Advanced Users) Using CLI to start local transcoding.
This is only for users who are comfortable using Command Prompt or other command line interface. This section will allow you to start streams using a single command.

For this tutorial I will be using WCKA 810AM / 94.3FM Alabama. The stream can be accessed at this URL. This is INPUT.


First, open the command line. You can do this by pressing windows+R and typing "cmd" or a shortcut can be found in the Start Menu under "Windows System" folder.

Navigate to your VLC installation folder. The default path is below.

cd C:\Program Files\VideoLAN\VLC

Next, open VLC by typing "vlc". Follow the instructions under "Using MP4A / AAC files in-game" up to step 6. The last screen of the Stream Output Wizard provides a generated stream output string which you will copy. Here is the string we get for WCKA.

:sout=#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=mp3,dst=:8080/} :no-sout-all :sout-keep

Unfortunately, in the current release of VLC, this string is not expressed in the way Command Prompt is expecting so we will need to fix it before it can be used. Paste the string into your preferred text editor for a moment and close VLC.

Below is the desired formatting. VLC's documentation is not user friendly, very complete, or up-to-date. However, more information on using VLC with the CLI can be found here[wiki.videolan.org] and command line examples can be found here[wiki.videolan.org].

vlc "INPUT" --sout "#transcode{STREAM SETTINGS}:http{mux=CODEC,dst=:OUTPUTPORT}" :no-sout-all :sout-keep

Here is the completed command to transcode WCKA to mp3 and output to localhost port 8080. Compare this to the generated output string.

vlc "https://ice64.securenetsystems.net/WCKA" --sout "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100,scodec=none}:http{mux=mp3,dst=:8080}" :no-sout-all :sout-keep

Copy your formatted command and paste to Command Prompt (make sure you are in VLC's installation directory). When you run the command, VLC should open and begin streaming.

Open a new VLC window and test your stream. Any errors will be displayed under "messages" (ctrl+M) or in a pop-up error window. If you receive an error that VLC media player could not start because "either the command line options were invalid or no plugins were found" this means you have an error in your command expression.
Enjoy!
Please post any questions you have in the comments. I use these questions to add additional tutorials for situations that the guide doesn't yet cover. Your questions may help other users and will help me improve on this resource.

Thanks for viewing this guide, if it is helpful to you please rate thumbs up.
41 Comments
fashuto Feb 5 @ 11:17am 
I was unable to add UrbanaPlay Radio from Argentina...
Gabe Valentine  [author] Jan 7 @ 3:17pm 
@peterhackejunior3 You can search for a version of that station in mpeg/mp3 format or you can locally transcode the link in VLC using the instructions in "Using MP4A / AAC files (or local files) in-game"
Gabe Valentine  [author] Jan 7 @ 3:14pm 
@peterhackejunior3 AAC streams don't work with the game.

@lyjo Follow instructions of "Working with .m3u or playlist.m3u8 files". Try to find the playlist file and open it in a text editor to see more information.
peterhackejunior3 Jan 7 @ 12:26pm 
Hello, I dont know if there are still active people here but i need help. I have been trying to get this radio: https://ice5.securenetsystems.net/KNBT?playSessionID=962E469C-D372-BE3B-0BB56C16B7CE8560 (Radio KNBT) working. I have tried my best but I can't get it to work for me. :(
Lyjo Fachman Sep 16, 2022 @ 12:33am 
@ThePanzafahra I've tried everything with Yle radios, they just don't work. I think its because m3u8 files are split into 'chunks' and when linking to any of them, they miss other 'chunks' for playback. If you ever find a way to get Yle working, let us know.
DevilTriggerPecan May 22, 2022 @ 7:37am 
Gabe. Guide ain't working for WEBN or for WKQQ. They're BOTH on IHeartRadio, and I am having ZERO luck with this. Some help? Thanks.
Jamsponge Dec 25, 2021 @ 5:03pm 
I've found a stream that uses .mpga to stream... does anyone have any idea if it's possible to use this?
Purpi Aug 7, 2021 @ 8:50pm 
thank you so much! I've wanted my favorite local station in game for years and now I finally have it
BrightonRock May 4, 2021 @ 9:31am 
Thanks very much for this. I used your CLI guide and made different batch files for each of the streams I want to listen to and works perfectly!

Top work!
Slice Jan 17, 2021 @ 6:37am 
Do we need to have ports open? Because I cant make it work and my ISP wont allow me to open ports.