示例#1
0
def play_video(params):
    lutil.log("esa.play " + repr(params))

    buffer_link = lutil.carga_web(params.get("url"))
    if language != 'en':
        pattern_lang = '<a href="([^\(]*?\(lang\)/%s)"' % language
        video_link = lutil.find_first(buffer_link, pattern_lang)
        if video_link:
            lang_url = '%s%s' % (root_url, video_link)
            lutil.log(
                "esa.play: We have found this alt video URL for '%s' language: '%s'"
                % (language, lang_url))
            buffer_link = lutil.carga_web(lang_url)

    pattern_video = "file[']?: '(http[^']*?)'"
    video_url = lutil.find_first(buffer_link, pattern_video)
    if video_url:
        try:
            lutil.log(
                "esa.play: We have found this video: '%s' and let's going to play it!"
                % video_url)
            return lutil.play_resolved_url(pluginhandle=pluginhandle,
                                           url=video_url)
        except:
            lutil.log(
                'esa.play ERROR: we cannot reproduce this video URL: "%s"' %
                video_url)
            return lutil.showWarning(translation(30012))

    lutil.log(
        'esa.play ERROR: we cannot play the video from this source yet: "%s"' %
        params.get("url"))
    return lutil.showWarning(translation(30011))
示例#2
0
def play_video(params):
    lutil.log("eso.play "+repr(params))

    page_url = params.get("url")
    buffer_link = lutil.carga_web(page_url)
    pattern_video = '<span class="archive_dl_text"><a href="([^"]*?)"'
    quality_list = { 'UltraHD' : 'ultra_hd/', 'HD' : 'hd_and_apple', 'SD': 'medium_podcast' }

    video_list = [url for url in lutil.find_multiple(buffer_link, pattern_video) if not url.endswith(('zip','srt','pdf','mxf','wav'))]
    lutil.log("eso.play video list"+repr(video_list))
    video_options = dict((vquality, url) for url in video_list for vquality in quality_list.keys() if quality_list[vquality] in url)
    lutil.log("eso.play video options"+repr(video_options))

    video_url = video_options.get('%s' % ('SD', 'HD', 'UltraHD')[quality], '') or video_options.get('SD', '') or video_list[0] if len(video_list) else ''
    if video_url:
        if video_url.startswith('//'):
            video_url = "%s%s" % ('http:', video_url)
        elif video_url.startswith('/'):
            root_url = eso_url if eso_url in page_url else space_url
            video_url = "%s%s" % (root_url, video_url)
        try:
            lutil.log("eso.play: We have found this video: '%s' and let's going to play it!" % video_url)
            return lutil.play_resolved_url(pluginhandle = pluginhandle, url = video_url)
        except:
            lutil.log('eso.play ERROR: we cannot reproduce this video URL: "%s"' % video_url)
            return lutil.showWarning(translation(30012))
    else:
        lutil.log('eso.play ERROR: we cannot play the video from this source yet: "%s"' % params.get("url"))
        return lutil.showWarning(translation(30011))
示例#3
0
def play_video(params):
    lutil.log("eso.play "+repr(params))

    page_url = params.get("url")
    buffer_link = lutil.carga_web(page_url)
    pattern_video = '<span class="archive_dl_text"><a href="([^"]*?)"'
    quality_list = { 'UltraHD' : 'ultra_hd/', 'HD' : 'hd_and_apple', 'SD': 'medium_podcast' }

    video_list = [url for url in lutil.find_multiple(buffer_link, pattern_video) if not url.endswith(('zip','srt','pdf','mxf','wav'))]
    lutil.log("eso.play video list"+repr(video_list))
    video_options = dict((vquality, url) for url in video_list for vquality in quality_list.keys() if quality_list[vquality] in url)
    lutil.log("eso.play video options"+repr(video_options))

    video_url = video_options.get('%s' % ('SD', 'HD', 'UltraHD')[quality], '') or video_options.get('SD', '') or video_list[0] if len(video_list) else ''
    if video_url:
        if video_url.startswith('//'):
            video_url = "%s%s" % ('http:', video_url)
        elif video_url.startswith('/'):
            root_url = eso_url if eso_url in page_url else space_url
            video_url = "%s%s" % (root_url, video_url)
        try:
            lutil.log("eso.play: We have found this video: '%s' and let's going to play it!" % video_url)
            return lutil.play_resolved_url(pluginhandle = pluginhandle, url = video_url)
        except:
            lutil.log('eso.play ERROR: we cannot reproduce this video URL: "%s"' % video_url)
            return lutil.showWarning(translation(30012))
    else:
        lutil.log('eso.play ERROR: we cannot play the video from this source yet: "%s"' % params.get("url"))
        return lutil.showWarning(translation(30011))
示例#4
0
def play_video(params):
    lutil.log("tv5monde.play_video "+repr(params))

    buffer_link = lutil.carga_web(params.get("url"))
    pattern_player  = '<videoUrl>([^<]+)</videoUrl>.*?<appleStreamingUrl>([^<]*)</appleStreamingUrl>'
    smil_url, video_url = lutil.find_first(buffer_link, pattern_player)
    if video_url:
        lutil.log('tv5monde.play_video: We have found the URL of the video file: "%s" and going to play it!!' % video_url)
        return lutil.play_resolved_url(pluginhandle = pluginhandle, url = video_url)
    else:
        lutil.log('tv5monde.play: We did not find the video file URL because it is very old. We have to load the smil URL and get the info from there: "%s"' % smil_url)
        buffer_smil = lutil.carga_web(smil_url)
        pattern_smil = '<video src="(tv5mondeplus/hq/[^"]+)"'
        video_source = lutil.find_first(buffer_smil, pattern_smil)
        if video_source:
            video_smil = 'http://dlhd.tv5monde.com/%s' % video_source
            lutil.log('tv5monde.play_video: We have found the URL of the video file: "%s" and going to play it!!' % video_smil)
            return lutil.play_resolved_url(pluginhandle = pluginhandle, url = video_smil)
        else:
            lutil.log("tv5monde.play_video: We did not find the video file URL from the smil info. We cannot play it!!")
            lutil.showWarning(translation(30011))
示例#5
0
def play_video(params):
    lutil.log("esa.play "+repr(params))

    buffer_link = lutil.carga_web(params.get("url"))
    if language != 'en':
        pattern_lang = '<li><a href="([^\(]*?\(lang\)/%s)" >' % language
        video_link = lutil.find_first(buffer_link, pattern_lang)
        if video_link:
            lang_url = '%s%s' % (root_url, video_link)
            lutil.log("esa.play: We have found this alt video URL for '%s' language: '%s'" % (language, lang_url))
            buffer_link = lutil.carga_web(lang_url)

    pattern_video = '<a href="([^"]*?)" id="download_link"'
    video_url = lutil.find_first(buffer_link, pattern_video)
    if video_url:
        try:
            lutil.log("esa.play: We have found this video: '%s' and let's going to play it!" % video_url)
            return lutil.play_resolved_url(pluginhandle = pluginhandle, url = video_url)
        except:
            lutil.log('esa.play ERROR: we cannot reproduce this video URL: "%s"' % video_url)
            return lutil.showWarning(translation(30012))

    lutil.log('esa.play ERROR: we cannot play the video from this source yet: "%s"' % params.get("url"))
    return lutil.showWarning(translation(30011))