Example #1
0
def identify(info):
    link = info['link']
    mirror = info['mirror']
    domain = info['domain']
    #print(link, mirror, domain)
    link = m_identify(link)
    return hosts[mirror].get_video(link, domain)
def play_video(link, mirror, domain, title):
    from hosts import hosts
    from scrapers.utils import m_identify
    from hosts.exceptions.exceptions import VideoNotAvalaible
    from scrapers.exceptions.exceptions import ScrapingFailed

    try:
        link = m_identify(link)
        path = hosts[mirror].get_video(link, domain)

        play_item = xbmcgui.ListItem(path=path, label=title)

        xbmcplugin.setResolvedUrl(_handle, True, play_item)
    except (VideoNotAvalaible, ScrapingFailed):
        dialog = xbmcgui.Dialog()

        dialog = dialog.ok(messages['stream']['error_stream_title'],
                           messages['stream']['error_stream_text'])