@@ -130,6 +130,17 @@ def get_station_by_station_id(self, station_id, resolve_playlists=True, force_ht
130130 stations = (station , )
131131 return self .__format_stations_v2 (stations )[0 ]
132132
133+ def internal_resolver (self , station , ):
134+ if station .get ('is_custom' , False ):
135+ stream_url = station ['stream_url' ]
136+ else :
137+ stream_url = station ['streamUrl' ]
138+
139+ if self .__check_paylist (stream_url ):
140+ return self .__resolve_playlist (station )
141+ else :
142+ return station
143+
133144 def get_top_stations (self , sizeperpage , pageindex ):
134145 self .log (('get_top_stations started with '
135146 'sizeperpage=%s, pageindex=%s' ) % (
@@ -250,7 +261,13 @@ def __resolve_playlist(self, station):
250261 self .log ('__resolve_playlist started with station=%s'
251262 % station ['id' ])
252263 servers = []
253- stream_url = station ['streamUrl' ]
264+
265+ # Check if it is a custom station
266+ if station .get ('is_custom' , False ):
267+ stream_url = station ['stream_url' ]
268+ else :
269+ stream_url = station ['streamUrl' ]
270+
254271 if stream_url .lower ().endswith ('m3u' ):
255272 response = self .__urlopen (stream_url )
256273 self .log ('__resolve_playlist found .m3u file' )
0 commit comments