Example #1
0
    def fetch_stream_data(self) -> str:
        html = utils.get_html_response_for("http://mobilefeeds.lbcgroup.tv/getCategories.aspx")

        root = xml.etree.ElementTree.fromstring(html)
        playlist = root.find("watchLive").text

        html = utils.get_html_response_for(playlist)
        return make_response(playlist, html)
Example #2
0
    def fetch_stream_data(self) -> str:
        html = utils.get_html_response_for(self.url)

        playlist = ""
        for line in html.splitlines():
            if "file" in line and "m3u8" in line:
                line_splitted = line.split('"')
                playlist = line_splitted[1]

        html = utils.get_html_response_for(playlist)
        return make_response(playlist, html)
Example #3
0
def __fetch_epg(channel: Channel, url: str):
    try:
        html = utils.get_html_response_for(url)
        start_end_data = channel.epg_parser.parse_schedule_page(html)
        epg_utils.normalize_times(start_end_data, channel.epg_data.get_normalization())
        return get_response(start_end_data, channel.channel_id)
    except urllib.error.URLError:
        return ''
Example #4
0
def fill_jadeed_additional_mappings(additional_mappings: Dict[ProgramData, str]):
    for program_data, url in additional_mappings.items():
        html = utils.get_html_response_for(url)
        parsed_html = bs4.BeautifulSoup(html, 'lxml')

        image_div = parsed_html.find('div', attrs={'class': 'mainArtistImage'})
        image_src = 'http://aljadeed.tv' + image_div.img['src'].replace(" ", "%20")
        program_data.icon = image_src

        text_div = parsed_html.find('div', attrs={'class': 'newsContent'})
        program_data.desc = text_div.text