import json
import requests
from api_auth import APICredentials, APIParams

class GetEnhancedStatsMultipleLiveStreams:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Get the enhanced statistics for multiple live streams.
        """
        self._get_enhanced_stats_multiple_live_streams()

    def _get_enhanced_stats_multiple_live_streams(self):
        url = "{}{}".format(self.host, "/api/v4/monitoring/stream_stats_enhanced")

        stream_ids = ['114n9q6a847ieldd8bb8dbf67afef96b', 'k30y636fa2f143eb95c7a41d96d581c4', 'n2fj4f8knf83nf81347fh12347fhjwse']
        # Replace with the IDs for the desired live channel(s) and live event(s).

        headers = {'Content-Type': 'application/json'}

        response = requests.post(
            url, params=APIParams(APICredentials()).get_params({}), json={"stream_ids": json.dumps(stream_ids)}, headers=headers 
        )

        print(response.json())

GetEnhancedStatsMultipleLiveStreams().run()