American Truck Simulator – Find & Import Radio Stream URLs

American Truck Simulator – Find & Import Radio Stream URLs 1 - wpgameplay.com
American Truck Simulator – Find & Import Radio Stream URLs 1 - wpgameplay.com

Guide for American Truck Simulator – Find & Import Radio Stream URLs

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.

 

Introduction

I made a fairly popular guide, which adds a couple of 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, listen to local files with the in-game radio, 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.

 

 

  • The number is a unique stream id number used by the game to organize the list.
  • URL is the direct link.
  • The name is an in-game description of the station.
  • The genre can be changed for organizing preferences.
  • Language is for broadcast language.
  • Bitrate. The game does not autodetect this. You can set it to any number or leave it blank.
  • A favorite is boolean, 0, or 1.

 

Utilities and Tools

  • Chrome, Firefox, or another web browser with a developer console. Press F12 to open this.
  • To actively transcribe a stream (see below), you will need a VLC media player. VLC is a great way to test listen to streams before importing them to the game and 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 Kiss 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 the 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, using 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 stream’s quality) 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 introduction section’s format, 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 kevo.io – http://kevo.io to fix this.

Here is an example URL of a 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—clickstream 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. Clickstream.
8 (first time only). Your firewall might prompt you 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 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. www.iheart.com – https://www.iheart.com/live/1025-the-bull-3089/.

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.

i.imgur.com – https://i.imgur.com/uSex82p.png. This is the playlist file that initialized the connection. Suppose you click this file, i.imgur.com – https://i.imgur.com/8lcTnnu.png. 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 the last image):

#EXTM3U #EXT-X-STREAM-INF:BANDWIDTH=49000,CODECS="mp4a.40.5" https://c4.prod.playlists.ihrhls.com:443/3089/playlist.m3u8?listeningSessionID=BigStringHere
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 a 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).

https://c4.prod.playlists.ihrhls.com:443/3089/playlist.m3u8
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. All you need to format your own link is press play on the station and identify which iHeart server the station lives on (c1, c2, c3, c4).

https://<SERVER>.prod.playlists.ihrhls.com:443/<STATION_ID>/playlist.m3u8

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 the radio. Press “update from the 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 it 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 interfaces. 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.

wiki.videolan.org - https://ice64.securenetsystems.net/WCKA and command line examples wiki.videolan.org - https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/.

vlc “quot;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.

By Gabe Valentine

Thanks for checking our blog. I hope the information you found about American Truck Simulator – Find & Import Radio Stream URLs helped you somehow. If you believe we forget to add something or update the post with more information, please let us know via comment below! See you soon!


Be the first to comment

Leave a Reply

Your email address will not be published.


*