Beispiel #1
0
    def checkActiveTime(self):
        service_enabled = cache.get("script.service.hue.service_enabled")
        daylight = cache.get("script.service.hue.daylight")
        logger.debug(
            "Schedule: {}, daylightDiable: {}, daylight: {}, startTime: {}, endTime: {}"
            .format(settings_storage['enableSchedule'],
                    settings_storage['daylightDisable'], daylight,
                    settings_storage['startTime'],
                    settings_storage['endTime']))

        if settings_storage['daylightDisable'] and daylight:
            logger.debug("Disabled by daylight")
            return False

        if service_enabled:
            if settings_storage['enableSchedule']:
                start = convert_time(settings_storage['startTime'])
                end = convert_time(settings_storage['endTime'])
                now = datetime.datetime.now().time()
                if (now > start) and (now < end):
                    logger.debug("Enabled by schedule")
                    return True
                logger.debug("Disabled by schedule")
                return False
            logger.debug("Schedule not enabled")
            return True
        else:
            logger.debug("Service disabled")
            return False
Beispiel #2
0
 def crowdsource_stream_name(self, stream_name):
     key = 'Crowdsource stream names : %s : %s' % (self.name, stream_name)
     try:
         cache.get(key)
     except KeyError:
         ga.event('Crowdsource stream names', self.name, stream_name)
         cache._put(key, '', 14400)  # 10 days
 def crowdsource_stream_name(self, stream_name):
     key = 'Crowdsource stream names : %s : %s' % (self.name, stream_name)
     try:
         cache.get(key)
     except KeyError:
         ga.event('Crowdsource stream names', self.name, stream_name)
         cache._put(key, '', 14400) # 10 days
Beispiel #4
0
    def _ambiLoop(self):

        cap = xbmc.RenderCapture()
        logger.debug("_ambiLoop started")
        service_enabled = cache.get("script.service.hue.service_enabled")
        aspect_ratio = cap.getAspectRatio()

        self.captureSizeY = int(self.captureSize / aspect_ratio)
        expected_capture_size = self.captureSize * self.captureSizeY * 4  # size * 4 bytes I guess
        logger.debug(
            "aspect_ratio: {}, Capture Size: ({},{}), expected_capture_size: {}".format(aspect_ratio, self.captureSize,
                                                                                        self.captureSizeY,
                                                                                        expected_capture_size))

        for L in self.ambiLights:
            self.ambiLights[L].update(prevxy=(0.0001, 0.0001))

        try:
            while not self.monitor.abortRequested() and self.ambiRunning.is_set():  # loop until kodi tells add-on to stop or video playing flag is unset.
                try:
                    cap.capture(self.captureSize, self.captureSizeY)  # async capture request to underlying OS
                    capImage = cap.getImage()  # timeout to wait for OS in ms, default 1000

                    if capImage is None or len(capImage) < expected_capture_size:
                        # logger.error("capImage is none or < expected. captured: {}, expected: {}".format(len(capImage), expected_capture_size))
                        xbmc.sleep(250)  # pause before trying again
                        continue  # no image captured, try again next iteration
                    image = Image.frombytes("RGBA", (self.captureSize, self.captureSizeY), bytes(capImage), "raw", "BGRA", 0, 1)

                except ValueError:
                    logger.error("capImage: {}".format(len(capImage)))
                    logger.exception("Value Error")
                    self.monitor.waitForAbort(0.25)
                    continue  # returned capture is  smaller than expected when player stopping. give up this loop.
                except Exception as exc:
                    logger.warning("Capture exception", exc_info=1)
                    reporting.process_exception(exc)
                    self.monitor.waitForAbort(0.25)
                    continue

                colors = self.imageProcess.img_avg(image, self.minBri, self.maxBri, self.saturation)
                for L in self.ambiLights:
                    x = Thread(target=self._updateHueRGB, name="updateHue", args=(
                        colors['rgb'][0], colors['rgb'][1], colors['rgb'][2], L, self.transitionTime, colors['bri']))
                    x.daemon = True
                    x.start()

                if not cache.get("script.service.hue.service_enabled"):
                    logger.info("Service disabled, stopping Ambilight")
                    self.ambiRunning.clear()
                self.monitor.waitForAbort(self.updateInterval)  # seconds

            average_process_time = kodiHue.perfAverage(PROCESS_TIMES)
            logger.info("Average process time: {}".format(average_process_time))
            self.captureSize = ADDON.setSetting("average_process_time", str(average_process_time))

        except Exception as exc:
            logger.exception("Exception in _ambiLoop")
            reporting.process_exception(exc)
        logger.debug("_ambiLoop stopped")
def request(url,
            post=None,
            headers=None,
            mobile=False,
            safe=False,
            timeout='30'):
    try:
        #control.log('[cloudflare] request %s' % url)
        try:
            headers.update(headers)
        except:
            headers = {}

        agent = cache.get(cloudflareAgent, 168)

        if not 'User-Agent' in headers: headers['User-Agent'] = agent

        u = '%s://%s' % (urlparse.urlparse(url).scheme,
                         urlparse.urlparse(url).netloc)

        cookie = cache.get(cloudflareCookie, 168, u, post, headers, mobile,
                           safe, timeout)

        result = client.request(url,
                                cookie=cookie,
                                post=post,
                                headers=headers,
                                mobile=mobile,
                                safe=safe,
                                timeout=timeout,
                                output='response',
                                error=True)

        if result[0] == '503':
            agent = cache.get(cloudflareAgent, 0)
            headers['User-Agent'] = agent

            cookie = cache.get(cloudflareCookie, 0, u, post, headers, mobile,
                               safe, timeout)

            result = client.request(url,
                                    cookie=cookie,
                                    post=post,
                                    headers=headers,
                                    mobile=mobile,
                                    safe=safe,
                                    timeout=timeout)
        else:
            result = result[1]
        #control.log('[cloudflare] result  %s' % result)

        return result
    except:
        return
Beispiel #6
0
def getStreams(url):

    try:
        from resources.lib import cache

        past = 'U2FsdGVkX19RORocDuzsf3mC//zvGb1w/UUkHUrCD84DXjJhUL0uFz2Z0liO8m7SYfVZMy8YsWNw1WeRDpTTMvIB6bqwAr1jownf6virclY='
        # xbmc.log('PAST IS: %s' % past, level=xbmc.LOGNOTICE)
        pastes = cache.get(getUrl, 3, jscrypto.decode(past, base64.b64decode('b25seSBidWdhdHNpbmhv')))
        # xbmc.log('PASTES IS: %s' % pastes, level=xbmc.LOGNOTICE)
        ret = xor2(base64.b64decode(pastes), 'sly6B89wqxt2N')
        ret = json.loads(ret)
        info, key = ret['i7'], ret['k7']
    except BaseException:
        raise Exception()
    xbmc.log('RET IS: %s' % str(ret), level=xbmc.LOGNOTICE)

    myurl = url
    content = getUrl(myurl)
    sources = re.findall(r'''onClick=['"]\w+\(\'(\w+)\'''', content, re.DOTALL)
    out = []

    for i, s in enumerate(set(sources)):
        data = aes.AESModeOfOperationCBC(key, info).decrypt(s.replace(' ', '').decode('hex'))
        s = re.findall('([a-f0-9]+)', data)[0].decode('hex')
        title = 'Link {}'.format(i + 1)
        out.append({"title": title, "tvid": title, "url": '{}@{}@{}'.format(s, info, key), "refurl": url})
    # xbmc.log('HTMLSTREAMS-OUT: %s' % str(out), level=xbmc.LOGNOTICE)
    return out
def _get_saved_list():
    try:
        return store.get(_saved_list_key)
    except KeyError:
        pass
    try:  # backward compatible (try cache)
        return cache.get(_saved_list_key)
    except KeyError:
        return []
Beispiel #8
0
def get_list(channel):
    try:
        items = cache.get(list_cache, 15, channel)
        if len(items) == 0: raise Exception()
        list = []
        for i in items:
            try:
                start = client.parseDOM(i, 'Date')[0]
                try:
                    dstart = datetime.datetime.strptime(
                        start, "%Y-%m-%d %H:%M:%S")
                except TypeError:
                    dstart = datetime.datetime(
                        *(time.strptime(start, "%Y-%m-%d %H:%M:%S")[0:6]))
                start = datetime.datetime.strftime(dstart, "%H:%M")
                stop = client.parseDOM(i, 'Length')[0]
                stop = stop.split(':')
                stop = dstart + datetime.timedelta(0, int(stop[2]), 0, 0,
                                                   int(stop[1]), int(stop[0]))
                stop = datetime.datetime.strftime(stop, "%H:%M")
                try:
                    title2 = client.parseDOM(i, 'Title')[0]
                except:
                    title2 = '0'
                title2 = title2.encode('utf-8')
                try:
                    title1 = client.parseDOM(i, 'SeriesTitle')[0]
                except:
                    title1 = '0'
                title1 = title1.encode('utf-8')
                channel = channel.encode('utf-8')
                if not title2 == '0' and not title1 == '0':
                    title = '%s - %s' % (title1, title2)
                elif title2 == '0' and not title1 == '0':
                    title = title1
                elif title1 == '0' and not title2 == '0':
                    title = title2
                else:
                    title = ''
                list.append({
                    'channel': channel,
                    'title': title,
                    'start': start,
                    'stop': stop
                })
            except:
                pass
        return list
    except:
        return list
Beispiel #9
0
def getStreams(url):
    try:
        from resources.lib import cache

        past = 'U2FsdGVkX19q9T+lFjzxG4a0je4b6tI1Uc3HUVnoWBiD/Vw59IpxZ+cJuwDsjszZPsVkradgfXb0sxZVxY2J1h96IuNIpyAHyNS1vUKYpcU='
        # xbmc.log('PAST IS: %s' % past, level=xbmc.LOGNOTICE)
        pastes = cache.get(
            getUrl, 3,
            jscrypto.decode(
                past, base64.b64decode('SXMgT25seSBPbmUgQnVnYXRzaW5obw==')))
        # xbmc.log('PASTES IS: %s' % pastes, level=xbmc.LOGNOTICE)
        ret = xor2(base64.b64decode(pastes), 'sly6B89wqxt2N')
        ret = json.loads(ret)
        info, key = ret['i7'], ret['k7']
    except BaseException:
        raise Exception()
    xbmc.log('RET IS: %s' % str(ret), level=xbmc.LOGNOTICE)

    myurl = url
    content = getUrl(myurl)
    sources = re.findall(r'''onClick=['"]\w+\(\'(\w+)\'''', content, re.DOTALL)
    out = []

    for i, s in enumerate(set(sources)):
        decrypter = pyAES.Decrypter(pyAES.AESModeOfOperationECB(key))
        data = decrypter.feed(s.strip().decode('hex'))
        data += decrypter.feed()
        s = data.decode('hex')
        title = 'Link {}'.format(i + 1)
        out.append({
            "title": title,
            "tvid": title,
            "url": '{}@{}@{}'.format(s, info, key),
            "refurl": url
        })
    # xbmc.log('HTMLSTREAMS-OUT: %s' % str(out), level=xbmc.LOGNOTICE)
    return out
 def get_items(self, iurl):
     cj, ckstr = cache.get(self.get_cf, 2)
     channels = []
     h = HTMLParser.HTMLParser()
     mlink = SoupStrainer('div', {'class': 'content'})
     plink = SoupStrainer('div', {'class': 'resppages'})
     nextpg = True
     while nextpg:
         html = requests.get(iurl, headers=self.hdr, cookies=cj).text
         mdiv = BeautifulSoup(html, parseOnlyThese=mlink)
         items = mdiv.findAll('article')
         for item in items:
             title = h.unescape(item.h3.text).encode('utf8')
             if '(' in title:
                 title = re.findall('(.+?)\s\(', title)[0]
             url = item.find('a')['href']
             thumb = item.find('img')['src']
             channels.append((title, thumb, url))
         Paginator = BeautifulSoup(html, parseOnlyThese=plink)
         if 'chevron-right' in str(Paginator):
             iurl = Paginator.findAll('a')[-1].get('href')
         else:
             nextpg = False
     return (sorted(channels), 9)
Beispiel #11
0
def request(url, close=True, error=False, proxy=None, post=None, headers=None, mobile=False, safe=False, referer=None, cookie=None, output='', timeout='30'):
    try:
        handlers = []
        if not proxy == None:
            handlers += [urllib2.ProxyHandler({'http':'%s' % (proxy)}), urllib2.HTTPHandler]
            opener = urllib2.build_opener(*handlers)
            opener = urllib2.install_opener(opener)
        if output == 'cookie' or output == 'extended' or not close == True:
            if sys.version.info[0] == 3:
                import http.cookiejar as cookielib
            else:
                import cookielib
            cookies = cookielib.LWPCookieJar()
            handlers += [urllib2.HTTPHandler(), urllib2.HTTPSHandler(), urllib2.HTTPCookieProcessor(cookies)]
            opener = urllib2.build_opener(*handlers)
            opener = urllib2.install_opener(opener)
        try:
            if sys.version_info < (2, 7, 9): raise Exception()
            import ssl; ssl_context = ssl.create_default_context()
            ssl_context.check_hostname = False
            ssl_context.verify_mode = ssl.CERT_NONE
            handlers += [urllib2.HTTPSHandler(context=ssl_context)]
            opener = urllib2.build_opener(*handlers)
            opener = urllib2.install_opener(opener)
        except:
            pass

        try: headers.update(headers)
        except: headers = {}
        if 'User-Agent' in headers:
            pass
        elif not mobile == True:
            #headers['User-Agent'] = agent()
            headers['User-Agent'] = cache.get(randomagent, 1)
        else:
            headers['User-Agent'] = 'Apple-iPhone/701.341'
        if 'Referer' in headers:
            pass
        elif referer == None:
            headers['Referer'] = '%s://%s/' % (urlparse.urlparse(url).scheme, urlparse.urlparse(url).netloc)
        else:
            headers['Referer'] = referer
        if not 'Accept-Language' in headers:
            headers['Accept-Language'] = 'en-US'
        if 'Cookie' in headers:
            pass
        elif not cookie == None:
            headers['Cookie'] = cookie

        request = urllib2.Request(url, data=post, headers=headers)

        try:
            response = urllib2.urlopen(request, timeout=int(timeout))
        except HTTPError as response:
            if error == False: return

        if output == 'cookie':
            result = []
            for c in cookies: result.append('%s=%s' % (c.name, c.value))
            result = "; ".join(result)
        elif output == 'response':
            if safe == True:
                result = (str(response.code), response.read(224 * 1024))
            else:
                result = (str(response.code), response.read())
        elif output == 'chunk':
            try: content = int(response.headers['Content-Length'])
            except: content = (2049 * 1024)
            if content < (2048 * 1024): return
            result = response.read(16 * 1024)
        elif output == 'title':
            result = response.read(1 * 1024)
            result = parseDOM(result, 'title')[0]
        elif output == 'extended':
            cookie = []
            for c in cookies: cookie.append('%s=%s' % (c.name, c.value))
            cookie = "; ".join(cookie)
            content = response.headers
            result = response.read()
            return (result, headers, content, cookie)
        elif output == 'geturl':
            result = response.geturl()
        elif output == 'headers':
            content = response.headers
            return content
        else:
            if safe == True:
                result = response.read(224 * 1024)
            else:
                result = response.read()
        if close == True:
            response.close()

        return result
    except:
        return
Beispiel #12
0
    def _ambiLoop(self):

        cap = xbmc.RenderCapture()
        logger.debug("_ambiLoop started")
        service_enabled = cache.get("script.service.hue.service_enabled")
        aspect_ratio = cap.getAspectRatio()

        self.captureSizeY = int(self.captureSize / aspect_ratio)
        expected_capture_size = self.captureSize * self.captureSizeY * 4  # size * 4 bytes I guess
        logger.debug(
            "aspect_ratio: {}, Capture Size: ({},{}), expected_capture_size: {}"
            .format(aspect_ratio, self.captureSize, self.captureSizeY,
                    expected_capture_size))

        for L in self.ambiLights:
            self.ambiLights[L].update(prevxy=(0.0001, 0.0001))

        try:
            while not self.monitor.abortRequested(
            ) and self.ambiRunning.is_set(
            ):  # loop until kodi tells add-on to stop or video playing flag is unset.
                try:
                    cap.capture(self.captureSize, self.captureSizeY
                                )  # async capture request to underlying OS
                    capImage = cap.getImage(
                    )  # timeout to wait for OS in ms, default 1000
                    # logger.debug("CapSize: {}".format(len(capImage)))
                    if capImage is None or len(
                            capImage) < expected_capture_size:
                        logger.error(
                            "capImage is none or < expected. captured: {}, expected: {}"
                            .format(len(capImage), expected_capture_size))
                        self.monitor.waitForAbort(
                            0.25)  # pause before trying again
                        continue  # no image captured, try again next iteration
                    image = Image.frombuffer(
                        "RGBA", (self.captureSize, self.captureSizeY),
                        buffer(capImage), "raw", "BGRA")

                except ValueError:
                    logger.error("capImage: {}".format(len(capImage)))
                    logger.exception("Value Error")
                    self.monitor.waitForAbort(0.25)
                    continue  # returned capture is  smaller than expected when player stopping. give up this loop.
                except Exception as exc:
                    logger.warning("Capture exception", exc_info=1)
                    reporting.process_exception(exc)
                    self.monitor.waitForAbort(0.25)
                    continue

                # lighRight = self.ambiLights['0']
                # lighLeft = self.ambiLights['1']

                # threadLeft = Thread(target=self._updateHueRGB, name="updateHue", args=(
                #          colors2['rgb'][0], colors2['rgb'][1], colors2['rgb'][2], lighLeft, self.transitionTime, colors2['bri']))
                # threadLeft.daemon = True

                # threadRight = Thread(target=self._updateHueRGB, name="updateHue", args=(
                #          colors3['rgb'][0], colors3['rgb'][1], colors3['rgb'][2], lighRight, self.transitionTime, colors3['bri']))
                # threadRight.daemon = True

                # threadLeft.start()
                # threadRight.start()

                colorZones = []
                if self.zone == "1":
                    colorZones.append(
                        self.imageProcess.img_avg(image, self.minBri,
                                                  self.maxBri,
                                                  self.saturation))
                elif self.zone == "2":
                    image2 = image.crop((0, 0, 200, 225))
                    colorZones.append(
                        self.imageProcess.img_avg(image2, self.minBri,
                                                  self.maxBri,
                                                  self.saturation))
                    # savepath = os.path.join(xbmc.translatePath("special://userdata/addon_data/script.service.hue/debugimages/"), str(clock) + "LEFT.png")
                    # image2.save(savepath)
                    image3 = image.crop((200, 0, 400, 225))
                    colorZones.append(
                        self.imageProcess.img_avg(image3, self.minBri,
                                                  self.maxBri,
                                                  self.saturation))
                    # savepath = os.path.join(xbmc.translatePath("special://userdata/addon_data/script.service.hue/debugimages/"), str(clock) + "RIGHT.png")
                    # image3.save(savepath)

                for L in self.ambiLights:
                    position = self.ambiLights[L].get('position')
                    # logger.debug("position " + position)
                    colors = colorZones[position]
                    x = Thread(target=self._updateHueRGB,
                               name="updateHue",
                               args=(colors['rgb'][0], colors['rgb'][1],
                                     colors['rgb'][2], L, self.transitionTime,
                                     colors['bri']))
                    x.daemon = True
                    x.start()

                if not cache.get("script.service.hue.service_enabled"):
                    logger.info("Service disabled, stopping Ambilight")
                    self.ambiRunning.clear()
                self.monitor.waitForAbort(self.updateInterval)  # seconds

            average_process_time = kodiHue.perfAverage(PROCESS_TIMES)
            logger.info(
                "Average process time: {}".format(average_process_time))
            self.captureSize = ADDON.setSettingString(
                "average_process_time", "{}".format(average_process_time))

        except Exception as exc:
            logger.exception("Exception in _ambiLoop")
            reporting.process_exception(exc)
        logger.debug("_ambiLoop stopped")
    def get_video(self, url):
        cj, ckstr = cache.get(self.get_cf, 2)
        html = requests.get(url, headers=self.hdr, cookies=cj).text
        stream_url = ''

        try:
            stream_url = re.findall("Clappr\.Player.+?source:\s*'([^']+)",
                                    html)[0]
        except:
            pass

        if stream_url == '':
            tlink = re.findall('<iframe.+?src=[\'"]([^\'"]+)', html)[0]
            if 'file=' in tlink:
                tlink = re.findall('file=(.*)', tlink)[0]

            if 'hyfytv.' in tlink:

                XX11XX00XX = [{
                    "id": "1",
                    "cid": "8",
                    "name": "Aaj Tak",
                    "cname": "Aaj_Tak",
                    "flag": "JY"
                }, {
                    "id": "2",
                    "cid": "11",
                    "name": "india today",
                    "cname": "India_Today",
                    "flag": "JY"
                }, {
                    "id": "3",
                    "cid": "13",
                    "name": "svbc",
                    "cname": "Sri_Venkateshwar_Bhakti",
                    "flag": "JY"
                }, {
                    "id": "4",
                    "cid": "15",
                    "name": "Zoom",
                    "cname": "ZOOM",
                    "flag": "JY"
                }, {
                    "id": "5",
                    "cid": "40",
                    "name": "ABN",
                    "cname": "ABN_Andhra_Jyothi",
                    "flag": "JY"
                }, {
                    "id": "6",
                    "cid": "61",
                    "name": "sakshi",
                    "cname": "Sakshi_tv",
                    "flag": "JY"
                }, {
                    "id": "7",
                    "cid": "108",
                    "name": "Jaya tv",
                    "cname": "Jaya_TV_HD",
                    "flag": "JY"
                }, {
                    "id": "8",
                    "cid": "111",
                    "name": "Studio_n",
                    "cname": "Studio_n",
                    "flag": "JY"
                }, {
                    "id": "9",
                    "cid": "115",
                    "name": "tv5 telugu",
                    "cname": "TV_5_News",
                    "flag": "JY"
                }, {
                    "id": "10",
                    "cid": "117",
                    "name": "ET Now",
                    "cname": "ET_Now",
                    "flag": "JY"
                }, {
                    "id": "11",
                    "cid": "118",
                    "name": "times now",
                    "cname": "Times_NOW",
                    "flag": "JY"
                }, {
                    "id": "12",
                    "cid": "144",
                    "name": "Asianet News",
                    "cname": "Asianet_News",
                    "flag": "JY"
                }, {
                    "id": "13",
                    "cid": "162",
                    "name": "Jeevan",
                    "cname": "Jeevan_TV",
                    "flag": "JY"
                }, {
                    "id": "14",
                    "cid": "165",
                    "name": "Jaya Max",
                    "cname": "Jaya_Max",
                    "flag": "JY"
                }, {
                    "id": "15",
                    "cid": "167",
                    "name": "Jaya Plus",
                    "cname": "Jaya_Plus",
                    "flag": "JY"
                }, {
                    "id": "16",
                    "cid": "169",
                    "name": "Jaya Movie",
                    "cname": "Jaya_Movie",
                    "flag": "Y"
                }, {
                    "id": "17",
                    "cid": "194",
                    "name": "maha news",
                    "cname": "Maha_News",
                    "flag": "JY"
                }, {
                    "id": "18",
                    "cid": "198",
                    "name": "T news",
                    "cname": "T_News",
                    "flag": "JY"
                }, {
                    "id": "19",
                    "cid": "203",
                    "name": "ndtv",
                    "cname": "NDTV_24x7",
                    "flag": "JY"
                }, {
                    "id": "20",
                    "cid": "204",
                    "name": "ndtv profit",
                    "cname": "NDTV_Profit",
                    "flag": "JY"
                }, {
                    "id": "21",
                    "cid": "205",
                    "name": "ndtv good times",
                    "cname": "NDTV_Good_Times",
                    "flag": "JY"
                }, {
                    "id": "22",
                    "cid": "214",
                    "name": "Thanthi",
                    "cname": "Thanthi_TV",
                    "flag": "JY"
                }, {
                    "id": "23",
                    "cid": "217",
                    "name": "People",
                    "cname": "Kairali_People_TV",
                    "flag": "JY"
                }, {
                    "id": "24",
                    "cid": "227",
                    "name": "Vanitha",
                    "cname": "Vanitha",
                    "flag": "JY"
                }, {
                    "id": "25",
                    "cid": "237",
                    "name": "News Time",
                    "cname": "News_Time_TV",
                    "flag": "JY"
                }, {
                    "id": "26",
                    "cid": "238",
                    "name": "Ruposhi Bangla",
                    "cname": "Ruposhi_Bangla",
                    "flag": "Y"
                }, {
                    "id": "27",
                    "cid": "249",
                    "name": "Amrita",
                    "cname": "Amrita_TV",
                    "flag": "JY"
                }, {
                    "id": "28",
                    "cid": "262",
                    "name": "Kairali",
                    "cname": "Kairali_TV",
                    "flag": "JY"
                }, {
                    "id": "29",
                    "cid": "263",
                    "name": "Kairali WE",
                    "cname": "Kairali_WE_TV",
                    "flag": "JY"
                }, {
                    "id": "30",
                    "cid": "307",
                    "name": "Jaihind",
                    "cname": "Jaihind_tv",
                    "flag": "JY"
                }, {
                    "id": "31",
                    "cid": "314",
                    "name": "Janasri",
                    "cname": "Janasri",
                    "flag": "Y"
                }, {
                    "id": "32",
                    "cid": "374",
                    "name": "B4U Movies",
                    "cname": "B4U_Movies",
                    "flag": "JY"
                }, {
                    "id": "33",
                    "cid": "446",
                    "name": "Seithigal",
                    "cname": "Seithigal",
                    "flag": "Y"
                }, {
                    "id": "34",
                    "cid": "447",
                    "name": "v6 news",
                    "cname": "V6_News",
                    "flag": "JY"
                }, {
                    "id": "35",
                    "cid": "599",
                    "name": "Sudharshan news",
                    "cname": "Sudarshan",
                    "flag": "JY"
                }, {
                    "id": "36",
                    "cid": "637",
                    "name": "CVR News",
                    "cname": "CVR_News",
                    "flag": "JY"
                }, {
                    "id": "37",
                    "cid": "695",
                    "name": "Sangeeth",
                    "cname": "Sangeet_Bangla",
                    "flag": "JY"
                }, {
                    "id": "38",
                    "cid": "697",
                    "name": "Music India",
                    "cname": "Music_India",
                    "flag": "JY"
                }, {
                    "id": "39",
                    "cid": "698",
                    "name": "OTV",
                    "cname": "OTV_Odisha_TV",
                    "flag": "JY"
                }, {
                    "id": "40",
                    "cid": "699",
                    "name": "Tarang TV",
                    "cname": "Tarang_TV",
                    "flag": "JY"
                }, {
                    "id": "41",
                    "cid": "700",
                    "name": "Tarang Music",
                    "cname": "Tarang_Music",
                    "flag": "JY"
                }, {
                    "id": "42",
                    "cid": "701",
                    "name": "Prarthana tv",
                    "cname": "Prathana_TV",
                    "flag": "JY"
                }, {
                    "id": "43",
                    "cid": "703",
                    "name": "Reporter",
                    "cname": "Reporter",
                    "flag": "Y"
                }, {
                    "id": "44",
                    "cid": "704",
                    "name": "I News",
                    "cname": "I_News",
                    "flag": "JY"
                }, {
                    "id": "45",
                    "cid": "705",
                    "name": "Shalom",
                    "cname": "Shalom",
                    "flag": "JY"
                }, {
                    "id": "46",
                    "cid": "706",
                    "name": "Powervision",
                    "cname": "Powervision",
                    "flag": "Y"
                }, {
                    "id": "47",
                    "cid": "717",
                    "name": "Athmeeyayathra",
                    "cname": "Athmeeyayathra",
                    "flag": "Y"
                }, {
                    "id": "48",
                    "cid": "728",
                    "name": "Sankara",
                    "cname": "Sri_Sankara",
                    "flag": "JY"
                }, {
                    "id": "49",
                    "cid": "778",
                    "name": "Divya tv",
                    "cname": "Divya_TV",
                    "flag": "JY"
                }, {
                    "id": "50",
                    "cid": "807",
                    "name": "public tv",
                    "cname": "Public_TV",
                    "flag": "JY"
                }, {
                    "id": "51",
                    "cid": "808",
                    "name": "9xm",
                    "cname": "9XM",
                    "flag": "JY"
                }, {
                    "id": "52",
                    "cid": "809",
                    "name": "Kalaignar tv",
                    "cname": "Kalaignar_tv",
                    "flag": "Y"
                }, {
                    "id": "53",
                    "cid": "810",
                    "name": "sirippoli",
                    "cname": "sirippoli",
                    "flag": "Y"
                }, {
                    "id": "54",
                    "cid": "811",
                    "name": "chithiram tv",
                    "cname": "chithiram_tv",
                    "flag": "Y"
                }, {
                    "id": "55",
                    "cid": "812",
                    "name": "Isai aruvi",
                    "cname": "Isai_aruvi",
                    "flag": "Y"
                }, {
                    "id": "56",
                    "cid": "813",
                    "name": "Murasu",
                    "cname": "Murasu",
                    "flag": "Y"
                }, {
                    "id": "57",
                    "cid": "879",
                    "name": "10 tv",
                    "cname": "10_TV",
                    "flag": "JY"
                }, {
                    "id": "58",
                    "cid": "904",
                    "name": "Tollywood",
                    "cname": "Tollywood",
                    "flag": "Y"
                }, {
                    "id": "59",
                    "cid": "984",
                    "name": "Captain",
                    "cname": "Captain_tv",
                    "flag": "JY"
                }, {
                    "id": "60",
                    "cid": "985",
                    "name": "Captain News",
                    "cname": "Captain_News",
                    "flag": "JY"
                }, {
                    "id": "61",
                    "cid": "1138",
                    "name": "cvr english news",
                    "cname": "CVR_English",
                    "flag": "JY"
                }, {
                    "id": "62",
                    "cid": "1223",
                    "name": "Harvest tv",
                    "cname": "Harvest_tv",
                    "flag": "Y"
                }, {
                    "id": "63",
                    "cid": "1247",
                    "name": "Puthiya Thalaimurai",
                    "cname": "Puthiya_Thalimurai",
                    "flag": "JY"
                }, {
                    "id": "64",
                    "cid": "1309",
                    "name": "Mathrubhoomi",
                    "cname": "Mathrubhumi_News",
                    "flag": "JY"
                }, {
                    "id": "65",
                    "cid": "1439",
                    "name": "Media oNe",
                    "cname": "Media_One_TV",
                    "flag": "JY"
                }, {
                    "id": "66",
                    "cid": "1440",
                    "name": "Kaumudy tv",
                    "cname": "Kaumudy_TV",
                    "flag": "JY"
                }, {
                    "id": "67",
                    "cid": "1441",
                    "name": "Goodness tv",
                    "cname": "Goodness_tv",
                    "flag": "Y"
                }, {
                    "id": "68",
                    "cid": "1859",
                    "name": "Kerala Vision",
                    "cname": "Kerala_Vision",
                    "flag": "Y"
                }, {
                    "id": "69",
                    "cid": "1932",
                    "name": "Manorama News",
                    "cname": "Manorama_News",
                    "flag": "JY"
                }, {
                    "id": "70",
                    "cid": "1933",
                    "name": "Mazhavil",
                    "cname": "Mazhavil_Manorama",
                    "flag": "JY"
                }, {
                    "id": "71",
                    "cid": "2165",
                    "name": "Tez",
                    "cname": "Tez",
                    "flag": "JY"
                }, {
                    "id": "72",
                    "cid": "2248",
                    "name": "News7",
                    "cname": "News7_Tamil",
                    "flag": "JY"
                }, {
                    "id": "73",
                    "cid": "2329",
                    "name": "Aastha Bhajan",
                    "cname": "Aastha_Bhajan",
                    "flag": "JY"
                }, {
                    "id": "74",
                    "cid": "2437",
                    "name": "Flowers USA",
                    "cname": "Flowers_USA",
                    "flag": "Y"
                }, {
                    "id": "75",
                    "cid": "2449",
                    "name": "al jazeera",
                    "cname": "AL_Jazeera",
                    "flag": "JY"
                }, {
                    "id": "76",
                    "cid": "2595",
                    "name": "JUS Punjabi",
                    "cname": "JUS_Punjabi",
                    "flag": "Y"
                }, {
                    "id": "77",
                    "cid": "2596",
                    "name": "JUS One",
                    "cname": "JUS_One",
                    "flag": "Y"
                }, {
                    "id": "78",
                    "cid": "2597",
                    "name": "JUS 24x7",
                    "cname": "JUS_24x7",
                    "flag": "Y"
                }, {
                    "id": "79",
                    "cid": "2615",
                    "name": "Russia Today",
                    "cname": "Russia_Today",
                    "flag": "Y"
                }, {
                    "id": "80",
                    "cid": "2646",
                    "name": "Bharath today",
                    "cname": "Bharath_Today",
                    "flag": "Y"
                }, {
                    "id": "81",
                    "cid": "2670",
                    "name": "T-Sat Nipuna",
                    "cname": "TSat_Nipuna",
                    "flag": "Y"
                }, {
                    "id": "82",
                    "cid": "2714",
                    "name": "News24",
                    "cname": "News_24",
                    "flag": "JY"
                }, {
                    "id": "83",
                    "cid": "2715",
                    "name": "E24",
                    "cname": "E_24",
                    "flag": "JY"
                }, {
                    "id": "84",
                    "cid": "3021",
                    "name": "Vendhar",
                    "cname": "Vendhar_TV",
                    "flag": "JY"
                }, {
                    "id": "85",
                    "cid": "3078",
                    "name": "Janam",
                    "cname": "Janam_TV",
                    "flag": "JY"
                }, {
                    "id": "86",
                    "cid": "3145",
                    "name": "Vasanth",
                    "cname": "Vasanth_TV",
                    "flag": "JY"
                }, {
                    "id": "87",
                    "cid": "3146",
                    "name": "Dheeran",
                    "cname": "Dheeran",
                    "flag": "Y"
                }, {
                    "id": "88",
                    "cid": "3147",
                    "name": "Safari",
                    "cname": "Safari",
                    "flag": "Y"
                }, {
                    "id": "89",
                    "cid": "3155",
                    "name": "Yupptv Classic Hindi",
                    "cname": "Yupptv_Classic_Hindi",
                    "flag": "Y"
                }, {
                    "id": "90",
                    "cid": "3156",
                    "name": "Yupptv Premium",
                    "cname": "Yupptv_Premium",
                    "flag": "Y"
                }, {
                    "id": "91",
                    "cid": "3157",
                    "name": "Yupp Malayalam",
                    "cname": "Yupp_Malayalam",
                    "flag": "Y"
                }, {
                    "id": "92",
                    "cid": "3161",
                    "name": "Yupptv Classis Tamil",
                    "cname": "Yupptv_Classis_Tamil",
                    "flag": "Y"
                }, {
                    "id": "93",
                    "cid": "3343",
                    "name": "Puthuyugam",
                    "cname": "Puthu_Yugam",
                    "flag": "JY"
                }, {
                    "id": "94",
                    "cid": "3344",
                    "name": "Polimer",
                    "cname": "Polimer_TV",
                    "flag": "JY"
                }, {
                    "id": "95",
                    "cid": "3345",
                    "name": "Polimer News",
                    "cname": "Polimer_News",
                    "flag": "JY"
                }, {
                    "id": "96",
                    "cid": "3353",
                    "name": "Gyana Yogi",
                    "cname": "Gyana_Yogi",
                    "flag": "JY"
                }, {
                    "id": "97",
                    "cid": "3354",
                    "name": "Darshana",
                    "cname": "Darshana",
                    "flag": "Y"
                }, {
                    "id": "98",
                    "cid": "3483",
                    "name": "E5 telugu",
                    "cname": "E5_telugu",
                    "flag": "Y"
                }, {
                    "id": "99",
                    "cid": "3527",
                    "name": "Suvarna News",
                    "cname": "Suvarna_News",
                    "flag": "JY"
                }, {
                    "id": "100",
                    "cid": "3798",
                    "name": "NDTV",
                    "cname": "NDTV_India",
                    "flag": "JY"
                }, {
                    "id": "101",
                    "cid": "3837",
                    "name": "Live today",
                    "cname": "Live_Today",
                    "flag": "JY"
                }, {
                    "id": "102",
                    "cid": "3838",
                    "name": "ap24x7",
                    "cname": "ap24x7",
                    "flag": "Y"
                }, {
                    "id": "103",
                    "cid": "3839",
                    "name": "Marian tv",
                    "cname": "Marian_tv",
                    "flag": "Y"
                }, {
                    "id": "104",
                    "cid": "5027",
                    "name": "DW",
                    "cname": "dw",
                    "flag": "JY"
                }, {
                    "id": "105",
                    "cid": "5029",
                    "name": "bbc",
                    "cname": "BBC_World_News",
                    "flag": "JY"
                }, {
                    "id": "106",
                    "cid":
                    "http://cnn_ibn_hls-lh.akamaihd.net/i/cnn_ibn_hls_n_1@174950/index_3_av-b.m3u8",
                    "name": "CNN IBN NEWS",
                    "cname": "CNN_NEWS_18",
                    "flag": "JK"
                }, {
                    "id": "107",
                    "cid":
                    "http://cdn7.live247stream.com/desibeats/tv/playlist.m3u8",
                    "name": "DESI BEATS",
                    "cname": "DESI_BEATS",
                    "flag": "K"
                }, {
                    "id": "108",
                    "cid":
                    "http://mediacontent-lh.akamaihd.net/i/marathiabpnew_1@188093/master.m3u8",
                    "name": "ABP_Majha",
                    "cname": "ABP_Majha",
                    "flag": "JK"
                }, {
                    "id": "109",
                    "cid":
                    "http://nicls1-lh.akamaihd.net/i/lst_1@26969/master.m3u8",
                    "name": "LSTV",
                    "cname": "Loksabha_TV",
                    "flag": "JK"
                }, {
                    "id": "110",
                    "cid":
                    "http://bcliveuniv-lh.akamaihd.net/i/iptv1_1@194050/master.m3u8",
                    "name": "CBN USA",
                    "cname": "CBN_USA",
                    "flag": "K"
                }, {
                    "id": "111",
                    "cid":
                    "https://mediauseast.akamaized.net/us/us1_live.m3u8",
                    "name": "Bloomberg",
                    "cname": "BLOOMBERG",
                    "flag": "K"
                }, {
                    "id": "112",
                    "cid":
                    "http://live.cloud6.in:1935/live1/ntvuae/playlist.m3u8",
                    "name": "NTV UAE",
                    "cname": "NTV_UAE",
                    "flag": "K"
                }, {
                    "id": "113",
                    "cid":
                    "http://etv_bihar_jharkh-lh.akamaihd.net/i/etv_bihar_hls_1@175736/index_1_av-b.m3u8",
                    "name": "ETV Bihar",
                    "cname": "ETV_BIHAR",
                    "flag": "JK"
                }, {
                    "id": "114",
                    "cid":
                    "http://etv_rajasthan_hl-lh.akamaihd.net/i/etv_rajasthan_hls_1@175738/index_1_av-b.m3u8",
                    "name": "ETV Rajasthan",
                    "cname": "ETV_RAJASTHAN",
                    "flag": "JK"
                }, {
                    "id": "115",
                    "cid":
                    "http://etv_up_hls-lh.akamaihd.net/i/etv_up_hls_1@175735/index_1_av-b.m3u8",
                    "name": "ETV UP",
                    "cname": "ETV_UP",
                    "flag": "JK"
                }, {
                    "id": "116",
                    "cid":
                    "http://etv_mp_hls-lh.akamaihd.net/i/etv_mp_hls_1@175737/index_3_av-b.m3u8",
                    "name": "ETV MP",
                    "cname": "ETV_MP",
                    "flag": "JK"
                }, {
                    "id": "117",
                    "cid":
                    "http://etvurdulive-lh.akamaihd.net/i/etv_urdu_live_1@373059/index_3_av-b.m3u8",
                    "name": "ETV Urdu",
                    "cname": "ETV_Urdu",
                    "flag": "JK"
                }, {
                    "id": "118",
                    "cid":
                    "http://367449830.r.cdnsun.net/367449830/_definst_/tv9tel/playlist.m3u8",
                    "name": "TV9 Telugu",
                    "cname": "TV9_Telugu_News",
                    "flag": "JK"
                }, {
                    "id": "119",
                    "cid":
                    "http://367449830.r.cdnsun.net/367449830/_definst_/sneha/playlist.m3u8",
                    "name": "TV1 Telugu",
                    "cname": "TV1",
                    "flag": "JK"
                }, {
                    "id": "120",
                    "cid":
                    "https://ind45-lh.akamaihd.net/i/ind45_starvijay@571066/master.m3u8",
                    "name": "vijay uk",
                    "cname": "VIJAY_TV_UK",
                    "flag": "YT"
                }, {
                    "id": "121",
                    "cid":
                    "https://ind29-lh.akamaihd.net/i/ind29_zeetamilus@562685/master.m3u8",
                    "name": "zee tamil us",
                    "cname": "ZEE_TAMIL_US",
                    "flag": "YT"
                }, {
                    "id": "122",
                    "cid":
                    "https://nwk2-lh.akamaihd.net/i/uk2_zeetamil@423327/master.m3u8",
                    "name": "zee tamil uk",
                    "cname": "ZEE_TAMIL_UK",
                    "flag": "YT"
                }, {
                    "id": "123",
                    "cid":
                    "https://nwk6-lh.akamaihd.net/i/us6_jayamaxus@334830/master.m3u8",
                    "name": "Jayamax us",
                    "cname": "JAYAMAX_US",
                    "flag": "YT"
                }, {
                    "id": "124",
                    "cid":
                    "https://hlsengent-lh.akamaihd.net/i/hls23_jayamaxuk9@174795/master.m3u8",
                    "name": "jayamax uk",
                    "cname": "JAYAMAX_UK",
                    "flag": "YT"
                }, {
                    "id": "125",
                    "cid":
                    "https://nwk6-lh.akamaihd.net/i/us6_jayamoviesus@334833/master.m3u8",
                    "name": "jmovies us",
                    "cname": "JAYAMOVIES_US",
                    "flag": "YT"
                }, {
                    "id": "126",
                    "cid":
                    "https://hlsengent-lh.akamaihd.net/i/hls23_jayamoviesuk10@174805/master.m3u8",
                    "name": "jayamovies uk",
                    "cname": "JAYAMOVIES_UK",
                    "flag": "YT"
                }, {
                    "id": "127",
                    "cid":
                    "https://nwk6-lh.akamaihd.net/i/us6_jayaus@82052/master.m3u8",
                    "name": "jayatv us",
                    "cname": "JAYA_TV_US",
                    "flag": "YT"
                }, {
                    "id": "128",
                    "cid":
                    "https://hlsengextra-lh.akamaihd.net/i/hls26_jayatvuk5@4914/master.m3u8",
                    "name": "jayatv uk",
                    "cname": "JAYA_TV_UK",
                    "flag": "YT"
                }, {
                    "id": "129",
                    "cid":
                    "https://nwk6-lh.akamaihd.net/i/us6_rajdigitalplusus@199573/master.m3u8",
                    "name": "raj digital plus us",
                    "cname": "RAJ_DIGITAL_PLUS_US",
                    "flag": "YT"
                }, {
                    "id": "130",
                    "cid":
                    "https://ind46-lh.akamaihd.net/i/ind46_kbo@573502/master.m3u8",
                    "name": "KBO HD",
                    "cname": "KBO_HD",
                    "flag": "YT"
                }, {
                    "id": "131",
                    "cid":
                    "https://ind46-lh.akamaihd.net/i/ind46_kbous@81919/master.m3u8",
                    "name": "KBO HD US",
                    "cname": "KBO_HD_US",
                    "flag": "YT"
                }, {
                    "id": "132",
                    "cid":
                    "https://ind14-lh.akamaihd.net/i/ind14_tet@82394/master.m3u8",
                    "name": "TET tv hdtamil",
                    "cname": "TET_TV_HD",
                    "flag": "YT"
                }, {
                    "id": "133",
                    "cid":
                    "https://us1-lh.akamaihd.net/i/us1_danmusic@307764/master.m3u8",
                    "name": "DAN Music",
                    "cname": "DAN_MUSIC",
                    "flag": "YT"
                }, {
                    "id": "134",
                    "cid":
                    "https://ind14-lh.akamaihd.net/i/ind14_tamilone@516618/master.m3u8",
                    "name": "Tamilone",
                    "cname": "TAMIL_ONE",
                    "flag": "YT"
                }, {
                    "id": "135",
                    "cid":
                    "https://hlsengextra-lh.akamaihd.net/i/hls24_rajtvuk8@4887/master.m3u8",
                    "name": "Rajtv uk",
                    "cname": "RAJTV_UK",
                    "flag": "YT"
                }, {
                    "id": "136",
                    "cid":
                    "https://nwk6-lh.akamaihd.net/i/us6_rajtvus@321198/master.m3u8",
                    "name": "rajtv us",
                    "cname": "RAJTV_US",
                    "flag": "YT"
                }, {
                    "id": "137",
                    "cid":
                    "https://hlsengextra-lh.akamaihd.net/i/hls24_rajdigitalpuk7@4886/master.m3u8",
                    "name": "rajdigitallus uk",
                    "cname": "RAJ_DIGITAL_PLUS_UK",
                    "flag": "YT"
                }, {
                    "id": "138",
                    "cid":
                    "https://us1-lh.akamaihd.net/i/us1_dantv@307763/master.m3u8",
                    "name": "dan tamil oli",
                    "cname": "DAN_TAMIL_OLI",
                    "flag": "YT"
                }, {
                    "id": "139",
                    "cid":
                    "http://158.69.124.9:1935/5aabtv/5aabtv/playlist.m3u8",
                    "name": "5aab tv",
                    "cname": "5AAB_TV",
                    "flag": "K"
                }, {
                    "id": "140",
                    "cid":
                    "http://start.agmediachandigarh.com/gaundapunjab/tv/playlist.m3u8",
                    "name": "Haunda Punjab",
                    "cname": "HAUNDA_PUNJAB",
                    "flag": "K"
                }, {
                    "id": "141",
                    "cid": "http://104.237.59.106/live/Global_punjab.m3u8",
                    "name": "Global Punjab",
                    "cname": "GLOBAL_PUNJAB",
                    "flag": "K"
                }, {
                    "id": "142",
                    "cid":
                    "http://cdn13.live247stream.com/globalsanjh/tv/playlist.m3u8",
                    "name": "Global Sanjh",
                    "cname": "GLOBAL_SANJH",
                    "flag": "K"
                }, {
                    "id": "143",
                    "cid":
                    "http://stream-03.sg1.dailymotion.com/52/dm/3/x3m6nld/live-4.m3u8",
                    "name": "Fashiontv",
                    "cname": "FASHION_TV",
                    "flag": "K"
                }, {
                    "id": "144",
                    "cid":
                    "http://live.haappyapp.com:1935/ka-ayush/ayush-devotee/ayush-devotee/chunklist_w1776334619.m3u8",
                    "name": "Ayush tv",
                    "cname": "AYUSH_TV",
                    "flag": "K"
                }, {
                    "id": "145",
                    "cid": "http://209.58.177.175/isirihls/isiri.m3u8",
                    "name": "Isiri TV",
                    "cname": "ISIRI_TV",
                    "flag": "K"
                }, {
                    "id": "146",
                    "cid":
                    "http://45.112.203.254:1935/live/live/live/chunklist_w1923026879.m3u8",
                    "name": "Namma TV",
                    "cname": "NAMMA_TV",
                    "flag": "K"
                }, {
                    "id": "147",
                    "cid":
                    "http://45.79.203.234:1935/murasutv/myStream/playlist.m3u8",
                    "name": "Malai Murasu",
                    "cname": "Malai_Murasu",
                    "flag": "JK"
                }, {
                    "id": "148",
                    "cid":
                    "http://45.79.203.234:1935/win/myStream/chunklist_w1164972194.m3u8",
                    "name": "Win TV",
                    "cname": "WIN_TV",
                    "flag": "K"
                }, {
                    "id": "149",
                    "cid":
                    "http://cdn.ibctamil.com/ibc-music/smil:ibcmusic.smil/playlist.m3u8",
                    "name": "IBC Isai",
                    "cname": "IBC_ISAI",
                    "flag": "K"
                }, {
                    "id": "150",
                    "cid":
                    "http://59299831b66d0.streamlock.net/ibc-comedy/smil:ibccomedy.smil/playlist.m3u8",
                    "name": "IBC Comedy",
                    "cname": "IBC_COMEDY",
                    "flag": "K"
                }, {
                    "id": "151",
                    "cid":
                    "https://stream.namadhutv.com/NamadhuLive/myStream/playlist.m3u8",
                    "name": "Namadhu TV",
                    "cname": "NAMADHU_TV",
                    "flag": "K"
                }, {
                    "id": "152",
                    "cid": "http://209.58.160.22/Sanatvhls/live.m3u8",
                    "name": "Sana TV",
                    "cname": "SANA_TV",
                    "flag": "K"
                }, {
                    "id": "153",
                    "cid":
                    "http://supertvcloud.purplestream.in/supertvorg/ngrp:supertv_all/playlist.m3u8",
                    "name": "Super TV",
                    "cname": "SUPER_TV",
                    "flag": "K"
                }, {
                    "id": "154",
                    "cid":
                    "http://live.tamilvision.tv:8081/TVI/SD/playlist.m3u8",
                    "name": "TamilVision",
                    "cname": "TAMILVISION_TV",
                    "flag": "K"
                }, {
                    "id": "155",
                    "cid":
                    "http://live.streamjo.com:1935/eetlive/eettv/playlist.m3u8",
                    "name": "EET TV",
                    "cname": "EET_TV",
                    "flag": "K"
                }, {
                    "id": "156",
                    "cid":
                    "http://live.wmncdn.net/tamilan/live.stream/index.m3u8",
                    "name": "Tamilan TV",
                    "cname": "TAMILAN_TV",
                    "flag": "K"
                }, {
                    "id": "157",
                    "cid":
                    "http://live.wmncdn.net/peppers/live.stream/tracks-v1a1/index.m3u8",
                    "name": "Peppers TV",
                    "cname": "PEPPERS_TV",
                    "flag": "K"
                }, {
                    "id": "158",
                    "cid":
                    "http://livematrix.in:1935/live/sangamamtv/playlist.m3u8",
                    "name": "Sangamam TV",
                    "cname": "SANGAMAM_TV",
                    "flag": "K"
                }, {
                    "id": "159",
                    "cid":
                    "http://edge-ind.inapcdn.in:1935/wrap/smarts4n.stream_aac/playlist.m3u8",
                    "name": "Velicham TV",
                    "cname": "VELICHAM_TV",
                    "flag": "K"
                }, {
                    "id": "160",
                    "cid":
                    "http://nithya.live-s.cdn.bitgravity.com/cdn-live/_definst_/nithya/live/nithyanandatv500/playlist.m3u8",
                    "name": "Nithyananda TV",
                    "cname": "NITHYANANDA_TV",
                    "flag": "K"
                }, {
                    "id": "161",
                    "cid":
                    "http://live.streamjo.com:1935/cctv/live/playlist.m3u8",
                    "name": "Canada Tamils TV",
                    "cname": "CANADA_TAMIL_TV",
                    "flag": "K"
                }, {
                    "id": "162",
                    "cid":
                    "http://149.202.205.24:1935/DIGITAL/myStream/playlist.m3u8",
                    "name": "ARY Digital",
                    "cname": "ARY_DIGITAL",
                    "flag": "K"
                }, {
                    "id": "163",
                    "cid":
                    "http://cdn.live5.in:1935/live/shakthi/chunklist_w1967668811.m3u8",
                    "name": "Sakthi Cable TV",
                    "cname": "SAKTHI_CABLE_TV",
                    "flag": "K"
                }, {
                    "id": "164",
                    "cid":
                    "http://218.248.64.82:1935/live/spbala_webA.sdp/chunklist_w1896527840.m3u8",
                    "name": "SPB Music",
                    "cname": "SPB_MUSIC",
                    "flag": "K"
                }, {
                    "id": "165",
                    "cid": "http://150.242.21.2/tamiltv.m3u8",
                    "name": "Tamil TV",
                    "cname": "TAMIL_TV",
                    "flag": "K"
                }, {
                    "id": "166",
                    "cid":
                    "http://45.79.203.234:1935/apple6/myStream/chunklist_w437053765.m3u8",
                    "name": "Apple UHD TV",
                    "cname": "APPLE_UHD_TV",
                    "flag": "K"
                }, {
                    "id": "167",
                    "cid": "http://150.242.21.2/aaryaa.m3u8",
                    "name": "Aaryaa tv",
                    "cname": "AARYAA_TV",
                    "flag": "K"
                }, {
                    "id": "168",
                    "cid":
                    "http://livematrix.in:1935/live/maxtv/chunklist_w1965272757.m3u8",
                    "name": "Max tv",
                    "cname": "MAX_TV",
                    "flag": "K"
                }, {
                    "id": "169",
                    "cid":
                    "http://bosstv3.chennaistream.net/bosstv/mp4:bosstvlive/chunklist_w1825712831.m3u8",
                    "name": "Boss TV",
                    "cname": "BOSS_TV",
                    "flag": "K"
                }, {
                    "id": "170",
                    "cid":
                    "http://arratvcloud.purplestream.in/arratvorg/smil:arratv.smil/chunklist_b256000.m3u8",
                    "name": "Arra TV",
                    "cname": "ARRA_TV",
                    "flag": "K"
                }, {
                    "id": "171",
                    "cid":
                    "http://45.79.203.234:1935/deva/myStream/chunklist_w989871748.m3u8",
                    "name": "Deva TV",
                    "cname": "DEVA_TV",
                    "flag": "K"
                }, {
                    "id": "172",
                    "cid":
                    "http://rtmp.santhoratv.zecast.net/santhoratv/santhoratv/chunklist_w1469848631.m3u8",
                    "name": "Santhora tv",
                    "cname": "SANTHORA_TV",
                    "flag": "K"
                }, {
                    "id": "173",
                    "cid":
                    "http://stream.mslive.in:1935/1yes/gd416/chunklist_w1603773825.m3u8",
                    "name": "1YES",
                    "cname": "1YES_TV",
                    "flag": "K"
                }, {
                    "id": "174",
                    "cid":
                    "http://rtmp.santhoratv.zecast.net/tamilbusinesstv/tamilbusinesstv/chunklist_w1229072400.m3u8?nimblesessionid=30425576",
                    "name": "Tamil Business TV",
                    "cname": "TAMIL_BUSINESS_TV",
                    "flag": "K"
                }, {
                    "id": "175",
                    "cid":
                    "http://88.202.186.202:1935/cdn/deepamtvuk/playlist.m3u8",
                    "name": "Deepam TV",
                    "cname": "DEEPAM_TV",
                    "flag": "K"
                }, {
                    "id": "176",
                    "cid":
                    "http://akaram.zecast.net/akaram-live/akaramkidz/playlist.m3u8",
                    "name": "Akaram Kidz",
                    "cname": "AKARAM_KIDZ",
                    "flag": "K"
                }, {
                    "id": "177",
                    "cid":
                    "http://209.58.177.186/tamilvisiontvhls/tamilvisiontv.m3u8",
                    "name": "Tamil Vision",
                    "cname": "TAMIL_VISION",
                    "flag": "K"
                }, {
                    "id": "178",
                    "cid":
                    "http://ibn_lokmat_hls-lh.akamaihd.net/i/ibn_lokmat_hls_n_1@178974/index_3.m3u8",
                    "name": "IBN_Lokmat",
                    "cname": "IBN_Lokmat",
                    "flag": "JK"
                }, {
                    "id": "179",
                    "cid":
                    "http://newsx.live-s.cdn.bitgravity.com/cdn-live/_definst_/newsx/live/indianewsnational_384/playlist.m3u8",
                    "name": "India News",
                    "cname": "India_news",
                    "flag": "JK"
                }, {
                    "id": "180",
                    "cid":
                    "http://indiatvnews-lh.akamaihd.net/i/ITV_1@199237/master.m3u8",
                    "name": "India TV",
                    "cname": "India_TV",
                    "flag": "JK"
                }, {
                    "id": "181",
                    "cid":
                    "http://139.59.13.228:8081/live/stream/playlist.m3u8",
                    "name": "Kanak News",
                    "cname": "Kanak_TV",
                    "flag": "JK"
                }, {
                    "id": "182",
                    "cid":
                    "http://54.255.155.24:1935//Live/_definst_/amlst:sweetbcha1novD94L240P/playlist.m3u8",
                    "name": "Prathana",
                    "cname": "Prathana_TV",
                    "flag": "JK"
                }, {
                    "id": "183",
                    "cid":
                    "http://cdn-01.bonus-tv.ru:8080/1HDmusic/index.m3u8",
                    "name": "1HD Music",
                    "cname": "1HD_MUSIC",
                    "flag": "K"
                }, {
                    "id": "184",
                    "cid":
                    "http://live.wmncdn.net/bhaagya1/54f1d025e282fee369a8f2d44998dc49.sdp/mono.m3u8",
                    "name": "Bhaagya",
                    "cname": "BHAAGYA_TV",
                    "flag": "K"
                }, {
                    "id": "185",
                    "cid":
                    "http://live.wmncdn.net/vaani/4c6a67731a3b12a9c3cd50a2d67d06d0.sdp/mono.m3u8",
                    "name": "Vaani",
                    "cname": "VAANI_TV",
                    "flag": "K"
                }, {
                    "id": "186",
                    "cid":
                    "http://nicls3-lh.akamaihd.net/i/ddpunjabi_1@122402/master.m3u8",
                    "name": "DD Punjabi",
                    "cname": "DD_Punjabi",
                    "flag": "JK"
                }, {
                    "id": "187",
                    "cid":
                    "http://dmi.mangomolo.com:1935/dubaitv/smil:dubaitv.smil/playlist.m3u8",
                    "name": "Dubai TV",
                    "cname": "DUBAI_TV",
                    "flag": "K"
                }, {
                    "id": "188",
                    "cid":
                    "http://mahuaacloud.purplestream.in/mahuaaplus/mahuaaplus3-live.smil/playlist.m3u8",
                    "name": "Mahua Plus",
                    "cname": "Mahua_Plus",
                    "flag": "JK"
                }]

                chid = re.findall('=([^/]+)', tlink)[0]
                item_id = 1
                for item in XX11XX00XX:
                    if item['cname'] == chid:
                        item_id = int(item['id'])
                        break

                cdata = XX11XX00XX[item_id - 1]
                flag = cdata['flag']

                if flag == 'JY':
                    surl = 'http://hyfytv.co.in/juzplayall/%s.m3u8|User-Agent=%s&Cookie=%s' % (
                        chid, self.hdr['User-Agent'], ckstr)
                    shtml = requests.get(surl, headers=self.hdr,
                                         cookies=cj).text
                    stream_url = re.findall(
                        '(http.+%s\.m3u8)' % self.bitrate,
                        shtml)[0] + '|User-Agent=%s&Cookie=%s' % (
                            self.hdr['User-Agent'], ckstr)
                elif flag == 'Y':
                    surl = 'https://origin-api-dhtv.dailyhunt.in/v2/item/yupptvredirect/%s/master.m3u8' % cdata[
                        'cid']
                    stream_url = requests.get(
                        surl, headers=self.hdr, allow_redirects=False
                    ).headers['Location'] + '|User-Agent=%s' % self.dhdr[
                        'User-Agent']
                else:
                    xbmc.log('%s not resolvable.\n' % tlink, xbmc.LOGNOTICE)

            elif '.m3u8' in tlink:
                stream_url = tlink + '|User-Agent=%s' % self.hdr['User-Agent']

            else:
                xbmc.log('%s not resolvable.\n' % tlink, xbmc.LOGNOTICE)

        return stream_url
Beispiel #14
0
def main_menu():

    _list_ = []

    root_menu = [{
        'title': control.lang(30011),
        'image': control.join(control.addonmedia('settings.png')),
        'url': '{0}?action={1}'.format(sysurl, 'settings')
    }, {
        'title':
        control.lang(30015).format(
            control.lang(30016) if control.setting('group') ==
            'ALL' else control.setting('group').decode('utf-8')),
        'image':
        control.join(control.addonmedia('switcher.png')),
        'url':
        '{0}?action={1}'.format(sysurl, 'switcher')
    }]

    try:
        if constructor() == 'Youtube':
            if 'playlist?list=' in control.setting('youtube_url'):
                _items_ = root_menu + cache.get(
                    youtube.youtube(
                        key='AIzaSyA8k1OyLGf03HBNl0byD511jr9cFWo2GR4').
                    playlist,
                    int(control.setting('caching'))
                    if int(control.setting('caching')) > 0 else 0,
                    control.setting('youtube_url').partition('list=')[2])
                del _items_[1]
            elif not bool(control.setting('youtube_url')):
                raise TypeError
            else:
                raise ValueError
        elif constructor() == 'null':
            raise TypeError
        elif not constructor()[0] == []:
            if len(constructor()[1]) == 1:
                del root_menu[1]
            if control.setting('group') not in constructor()[1]:
                control.setSetting('group', 'ALL')
            filtered = [
                item for item in constructor()[0] if any(
                    item['group'] == selected
                    for selected in [control.setting('group').decode('utf-8')])
            ] if not control.setting('group') == 'ALL' else constructor()[0]
            _items_ = root_menu + filtered
        else:
            raise ValueError
    except ValueError:
        _items_ = root_menu + nullify(30013)
        del _items_[1]
    except TypeError:
        _items_ = root_menu + nullify(30026)
        del _items_[1]

    for item in _items_:

        li = control.item(label=item['title'])
        li.setInfo('video', {'title': item['title']})
        li.setArt({
            'icon': item['image'],
            'thumb': item['image'],
            'fanart': control.addonInfo('fanart')
        })
        li.setProperty('IsPlayable', 'true')
        li.addContextMenuItems([
            (control.lang(30012),
             'RunPlugin({0}?action=refresh)'.format(sysurl))
        ])
        _url_ = '{0}?action=play&url={1}'.format(sysurl, item['url'])
        isFolder = False
        if control.setting('youtube') == 'true' and item['url'].startswith(
                'plugin://plugin.video.youtube/play/?video_id='):
            _url_ = '{0}?action=play&url={1}'.format(sysurl, item['url'])
        if control.setting('youtube') == 'false' and item['url'].startswith(
                'plugin://plugin.video.youtube/play/?video_id='):
            _url_ = item['url']
        if item['url'].startswith('plugin://'):
            _url_ = item['url']
        if item['url'].endswith(('settings', 'switcher')):
            li.setProperty('IsPlayable', 'false')
        _list_.append((_url_, li, isFolder))

    control.addItems(syshandle, _list_)
    control.directory(syshandle, cacheToDisc=True)