Example #1
0
 def __init__(self, station_json):
     self.id = generic.generate_stationid_with_prefix(get_json_attr(station_json, 'stationuuid'), ID_PREFIX)
     self.name = get_json_attr(station_json, 'name')
     self.url = get_json_attr(station_json, 'url')
     self.icon = get_json_attr(station_json, 'favicon')
     self.tags = get_json_attr(station_json, 'tags').split(',')
     self.countrycode = get_json_attr(station_json, 'countrycode')
     self.language = get_json_attr(station_json, 'language')
     self.votes = get_json_attr(station_json, 'votes')
     self.codec = get_json_attr(station_json, 'codec')
     self.bitrate = get_json_attr(station_json, 'bitrate')
Example #2
0
 def __init__(self, station_json):
     uid = get_json_attr(station_json, 'stationuuid')
     if (COMPRESS_UUID):
         uid = base64.urlsafe_b64encode(uuid.UUID(uid).bytes).decode()
     self.id = generic.generate_stationid_with_prefix(uid, ID_PREFIX)
     self.name = get_json_attr(station_json, 'name')
     self.url = get_json_attr(station_json, 'url')
     self.icon = get_json_attr(station_json, 'favicon')
     self.tags = get_json_attr(station_json, 'tags').split(',')
     self.countrycode = get_json_attr(station_json, 'countrycode')
     self.language = get_json_attr(station_json, 'language')
     self.votes = get_json_attr(station_json, 'votes')
     self.codec = get_json_attr(station_json, 'codec')
     self.bitrate = get_json_attr(station_json, 'bitrate')
Example #3
0
 def __init__(self, uid, name, url, category):
     self.id = generic.generate_stationid_with_prefix(uid, ID_PREFIX)
     self.name = name
     self.url = url
     self.tag = category
     self.icon = None
Example #4
0
 def to_vtuner(self):
     tid = generic.get_checksum(self.id)
     id_registry[tid] = self.id
     return vtuner.Station(generic.generate_stationid_with_prefix(tid, ID_PREFIX), self.name, ', '.join(self.tags), self.url, self.icon,
                           self.tags[0], self.countrycode, self.codec, self.bitrate, None)