mirror of
https://github.com/ovosimpatico/xtream2m3u.git
synced 2026-01-15 08:22:56 -03:00
39 lines
968 B
Python
39 lines
968 B
Python
"""Xtream2M3U - Xtream Codes API to M3U converter
|
|
|
|
This is the main entry point for the application.
|
|
Run with: python run.py [--port PORT]
|
|
"""
|
|
import argparse
|
|
import logging
|
|
|
|
from app import create_app
|
|
from app.utils import setup_custom_dns
|
|
|
|
# Configure logging
|
|
logging.basicConfig(level=logging.INFO)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def main():
|
|
"""Main entry point for the application"""
|
|
# Parse command line arguments
|
|
parser = argparse.ArgumentParser(description="Run the Xtream2M3U Flask app.")
|
|
parser.add_argument(
|
|
"--port", type=int, default=5000, help="Port number to run the app on (default: 5000)"
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
# Initialize custom DNS resolver
|
|
setup_custom_dns()
|
|
|
|
# Create the Flask app
|
|
app = create_app()
|
|
|
|
# Run the app
|
|
logger.info(f"Starting Xtream2M3U server on port {args.port}")
|
|
app.run(debug=True, host="0.0.0.0", port=args.port)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|