Пример #1
0
  def do_it(self):
    file_path = self.file_info['path']

    if self.__is_video():
      avi_cmd(file_path)

      return { 'avi': file_path}
    elif self.__is_mp3():
      audio_cmd(file_path)

      return { 'mp3': 1 }
    else:
      return { 'false': 0 }
Пример #2
0
def radio():
  radios = {
      'FM-TheChilloutLounge': 'http://64.71.184.99:8010/',
      'JFRRadio': 'http://uk1.internet-radio.com:15074/',
      'RockyFM': 'http://tuner.rockyfm.de:80/',
      'RockRadio1.Com': 'http://91.121.201.88:8000/'
      }

  if request.method == 'POST':
    name = request.args.get('name')
    url = request.args.get('url')

    if name != None:
      if radios.has_key(name):
        audio_cmd(radios[name])
      else:
        return invalid_radio_station()
    elif url != None:
      audio_cmd(url)
    else:
      return invalid_radio_params()

  return jsonify(radios)