b0c29f0582
* use flask for easier url handling and tidyness * create radio-browser.info and vtuner api classes * add support for more vtuner logic (logos, info messages, search, buttons, etc.) * use radio-browser.info index and search * prepare for python packaging
23 lines
848 B
Python
Executable file
23 lines
848 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
import logging
|
|
|
|
from ycast import server
|
|
|
|
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO)
|
|
|
|
|
|
def launch_server():
|
|
parser = argparse.ArgumentParser(description='vTuner API emulation')
|
|
parser.add_argument('-c', action='store', dest='config', help='Station configuration', default=None)
|
|
parser.add_argument('-l', action='store', dest='address', help='Listen address', default='0.0.0.0')
|
|
parser.add_argument('-p', action='store', dest='port', type=int, help='Listen port', default=80)
|
|
arguments = parser.parse_args()
|
|
logging.info("YCast server starting on %s:%s" % (arguments.address, arguments.port))
|
|
server.run(arguments.config, arguments.address, arguments.port)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
launch_server()
|