Пример #1
0
def play_mirror(url):
    with common.busy_indicator():
        # soup = BeautifulSoup(common.webread(url), 'html5lib')
        # iframe = soup.find(id='iframeplayer')
        # iframe_url = urljoin(config.base_url, iframe.attrs['src'])
        (vidurl,
         pars) = scrapers.episodeVideo(urljoin(config.video_url,
                                               url))  # common.resolve(url)
        vidurl = _base64(vidurl)
        if not re.match(r'(.)*\.m3u8$', vidurl):
            if re.match(r'(.*)123ku(.*)', pars):
                vidurl = scrapers.episodeVideo_123ku(vidurl)
            else:
                vidurl = scrapers.episodeVideo_dplayer(vidurl)

        if vidurl:
            try:
                title, image = scrapers.title_image(
                    urljoin(config.video_url, url))
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')

            li = xbmcgui.ListItem(title)
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + quote(get_ua())
            xbmc.Player().play(vidurl, li)
Пример #2
0
def play_mirror(url):
    with common.busy_indicator():
        soup = BeautifulSoup(common.webread(url), 'html5lib')
        iframe = soup.find(id='iframeplayer')
        iframe_url = urljoin(config.base_url, str(iframe.attrs['src']))
        try:
            vidurl = common.resolve(iframe_url)
        except ResolverError as e:
            if str(e) == 'No link selected':
                return
            raise e

        if vidurl:
            try:
                title, image = scrapers.title_image(url)
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')
            li = xbmcgui.ListItem(title)
            li.setArt({'thumb': image})
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + urllib.parse.quote(get_ua())
            xbmc.Player().play(vidurl, li)

        else:
            common.notify(heading="icDrama", message="Unable to play video")
Пример #3
0
def play_mirror(url):
    with common.busy_indicator():
        # soup = BeautifulSoup(common.webread(url), 'html5lib')
        # iframe = soup.find(id='iframeplayer')
        # iframe_url = urljoin(config.base_url, iframe.attrs['src'])
        vidurl = scrapers.episodeVideo(urljoin(config.video_url, url)) # common.resolve(url)

        if vidurl:
            try:
                title, image = scrapers.title_image(urljoin(config.video_url, url))
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')

            osWin = xbmc.getCondVisibility('system.platform.windows')
            osOsx = xbmc.getCondVisibility('system.platform.osx')
            osLinux = xbmc.getCondVisibility('system.platform.linux')
            osAndroid = xbmc.getCondVisibility('System.Platform.Android')

            li = xbmcgui.ListItem(title)
            li.setThumbnailImage(image)

            if osOsx or osWin or (osLinux and not osAndroid):    
                if 'User-Agent=' not in vidurl:
                    vidurl = vidurl + '|User-Agent=' + urllib.quote(get_ua())
                xbmc.Player().play(vidurl, li)
            elif osAndroid:
                xbmc.executebuiltin("PlayMedia("+vidurl+")")
Пример #4
0
def add_to_saved(all_title, show_url, image):
    with common.busy_indicator():
        sl = _get_saved_list()
        sl.insert(0, (all_title, show_url, image))
        uniq = set()
        sl = [x for x in sl if not (x in uniq or uniq.add(x))]
        store.put(_saved_list_key, sl)
    common.popup(xbmcaddon.Addon().getLocalizedString(33302))
def add_to_saved(eng_name, ori_name, show_url, image):
    with common.busy_indicator():
        sl = _get_saved_list()
        sl.insert(0, (eng_name, ori_name, show_url, image))
        uniq = set()
        sl = [x for x in sl if not (x in uniq or uniq.add(x))]
        store.put(_saved_list_key, sl)
    common.popup(xbmcaddon.Addon().getLocalizedString(33302))
def add_to_saved(eng_name, ori_name, show_url, image):
    with common.busy_indicator():
        sl = _get_saved_list()
        sl.insert(0, (eng_name, ori_name, show_url, image))
        uniq = set()
        sl = [x for x in sl if not (x in uniq or uniq.add(x))]
        store.put(_saved_list_key, sl)
    common.popup(loc.getLocalizedString(33302))
Пример #7
0
def play_mirror(url):
    with common.busy_indicator():
        common.error("What is the url: " + url)
        (title, vidurl) = scrapers.episodeVideo(url.split('?')[0]) # common.resolve(url)
        if vidurl:
            li = xbmcgui.ListItem(title)
            li.setThumbnailImage('')
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + urllib.quote(get_ua())
            xbmc.Player().play(vidurl, li)
Пример #8
0
def play_mirror(url, title):
    with common.busy_indicator():
        # soup = BeautifulSoup(common.webread(url), 'html5lib')
        # iframe = soup.find(id='iframeplayer')
        # iframe_url = urljoin(config.base_url, iframe.attrs['src'])
        vidurl = quote(url, ':/?&=')  # common.resolve(url)

        if vidurl:
            li = xbmcgui.ListItem(title)
            xbmc.Player().play(vidurl, li)
def play_mirror(url):
    with common.busy_indicator():
        vidurl = common.resolve(url)
        if vidurl:
            try:
                title, image = scrapers.title_image(url)
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')
            li = xbmcgui.ListItem(title)
            li.setThumbnailImage(image)
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + urllib.quote(get_ua())
            xbmc.Player().play(vidurl, li)
def play_mirror(url):
    playing = False
    player = None
    orig_url = ''
    
    with common.busy_indicator():
        vidurl = common.resolve(url)
        orig_url = vidurl
        if vidurl:
            try:
                title, image = scrapers.title_image(url)
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')
            li = xbmcgui.ListItem(title)
            li.setArt({ 'thumb' : image })
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + urllib.quote(get_ua())
            
            # Instantiate own player class
            player = MyPlayer()
            
            player.play(vidurl, li)

            
            playing = True
    
    if player:
        counter = 0
        # Checks for a minimum of 60 seconds; keeps script alive for this time
        while player.alive and counter < 30:
            counter += 1
            xbmc.sleep(2000)
        
        if not player.hasStarted:
            common.debug('Icdrama: Player encountered a format that prevented it from starting')
            # Add to blacklist
            sourceutil.add_blacklist(orig_url)
            
            # Delete to free up reference
            del player
            
            # Try again
            play_mirror(url)
            
        else:
            # Delete to free up reference
            del player
    
    return playing
Пример #11
0
def play_mirror(url):
    with common.busy_indicator():
        vidurl = common.resolve(url)
        if vidurl:
            try:
                title, image = scrapers.title_image(url)
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')
            li = xbmcgui.ListItem(title)
            li.setThumbnailImage(image)
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + urllib.quote(get_ua())
            xbmc.Player().play(vidurl, li)
Пример #12
0
def play_mirror(url):
    with common.busy_indicator():
        common.error("What is the url: " + url)
        (title, vidurl) = scrapers.episodeVideo(
            url.split('?')[0])  # common.resolve(url)
        if vidurl:
            li = xbmcgui.ListItem(title)
            for pxyDomain in config.domain_using_proxy:
                if (re.search(pxyDomain, vidurl)):
                    vidurl = config.local_proxy + '/' + re.sub(
                        '\://', '/', vidurl, 1)
                    break
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + quote(get_ua())
            xbmc.Player().play(vidurl, li)
Пример #13
0
def play_mirror(url):
    with common.busy_indicator():
        # soup = BeautifulSoup(common.webread(url), 'html5lib')
        # iframe = soup.find(id='iframeplayer')
        # iframe_url = urljoin(config.base_url, iframe.attrs['src'])
        vidurl = scrapers.episodeVideo(urljoin(config.video_url, url)) # common.resolve(url)

        if vidurl:
            try:
                title, image = scrapers.title_image(urljoin(config.video_url, url))
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')

            li = xbmcgui.ListItem(title)
            xbmc.Player().play(vidurl, li)
Пример #14
0
def play_mirror(url):
    with common.busy_indicator():
        soup = BeautifulSoup(common.webread(url), 'html5lib')
        iframe = soup.find(id='iframeplayer')
        iframe_url = urljoin(config.base_url, iframe.attrs['src'])
        vidurl = common.resolve(iframe_url)

        if vidurl:
            try:
                title, image = scrapers.title_image(url)
            except Exception:
                # we can proceed without the title and image
                title, image = ('', '')
            li = xbmcgui.ListItem(title)
            li.setArt({ 'thumb': image })
            if 'User-Agent=' not in vidurl:
                vidurl = vidurl + '|User-Agent=' + quote(get_ua())
            xbmc.Player().play(vidurl, li)