Пример #1
0
def retrieveVideoInfo(video_id):
    
    video_info = VideoInfo()
    video_info.set_video_hosting_info(getVideoHostingInfo())
    video_info.set_video_id(video_id)
    try:
        video_info_link = 'http://www.vimeo.com/moogaloop/load/clip:' + str(video_id)
        soup = BeautifulStoneSoup(HttpUtils.HttpClient().getHtmlContent(url=video_info_link), convertEntities=BeautifulStoneSoup.XML_ENTITIES)
        
        referrerObj = soup.findChild(name='referrer')
        req_sig = referrerObj.findChild(name='request_signature').getText()
        req_sig_exp = referrerObj.findChild(name='request_signature_expires').getText()
        
        videoObj = soup.findChild(name='video')
        img_link = videoObj.findChild(name='thumbnail').getText()
        video_title = videoObj.findChild(name='caption').getText()
        
        qual = 'sd'
        video_link = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=H264,VP8,VP6&type=moogaloop_local&embed_location=" % (video_id, req_sig, req_sig_exp, qual)
        video_info.add_video_link(VIDEO_QUAL_SD, video_link)
        
        if(videoObj.findChild(name='ishd').getText() == '1'):
            qual = 'hd'
            video_link = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=H264,VP8,VP6&type=moogaloop_local&embed_location=" % (video_id, req_sig, req_sig_exp, qual)
            video_info.add_video_link(VIDEO_QUAL_HD_720, video_link)
            
        video_info.set_video_stopped(False)
        video_info.set_video_image(img_link)
        video_info.set_video_name(video_title)
        
    except: 
        video_info.set_video_stopped(True)
    return video_info
Пример #2
0
def retrieveVideoInfo(video_id):

    video_info = VideoInfo()
    video_info.set_video_hosting_info(getVideoHostingInfo())
    video_info.set_video_id(video_id)
    try:
        video_info_link = 'http://www.veoh.com/rest/v2/execute.xml?method=veoh.video.findByPermalink&permalink=' + str(
            video_id) + '&apiKey=' + API_KEY
        soup = BeautifulStoneSoup(
            HttpUtils.HttpClient().getHtmlContent(url=video_info_link),
            convertEntities=BeautifulStoneSoup.XML_ENTITIES)

        videoObj = soup.findChild(name='video')
        video_link = HttpUtils.getRedirectedUrl(str(videoObj['ipodurl']))
        img_link = str(videoObj['highresimage'])
        video_title = str(videoObj['title'])

        video_info.set_video_stopped(False)
        video_info.set_video_image(img_link)
        video_info.set_video_name(video_title)
        video_info.add_video_link(VIDEO_QUAL_SD, video_link)

    except:
        video_info.set_video_stopped(True)
    return video_info
Пример #3
0
def retrieveVideoInfo(video_id):

    video_info = VideoInfo()
    video_info.set_video_hosting_info(getVideoHostingInfo())
    video_info.set_video_id(video_id)
    try:
        video_info_link = 'http://www.vimeo.com/moogaloop/load/clip:' + str(
            video_id)
        soup = BeautifulStoneSoup(
            HttpUtils.HttpClient().getHtmlContent(url=video_info_link),
            convertEntities=BeautifulStoneSoup.XML_ENTITIES)

        referrerObj = soup.findChild(name='referrer')
        req_sig = referrerObj.findChild(name='request_signature').getText()
        req_sig_exp = referrerObj.findChild(
            name='request_signature_expires').getText()

        videoObj = soup.findChild(name='video')
        img_link = videoObj.findChild(name='thumbnail').getText()
        video_title = videoObj.findChild(name='caption').getText()

        qual = 'sd'
        video_link = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=H264,VP8,VP6&type=moogaloop_local&embed_location=" % (
            video_id, req_sig, req_sig_exp, qual)
        video_info.add_video_link(VIDEO_QUAL_SD, video_link)

        if (videoObj.findChild(name='ishd').getText() == '1'):
            qual = 'hd'
            video_link = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=H264,VP8,VP6&type=moogaloop_local&embed_location=" % (
                video_id, req_sig, req_sig_exp, qual)
            video_info.add_video_link(VIDEO_QUAL_HD_720, video_link)

        video_info.set_video_stopped(False)
        video_info.set_video_image(img_link)
        video_info.set_video_name(video_title)

    except:
        video_info.set_video_stopped(True)
    return video_info
Пример #4
0
def svg_text_to_plotcutsvg(svg_text):
    BeautifulStoneSoup.NESTABLE_TAGS["g"] = []
    svg_soup = BeautifulStoneSoup(svg_text, selfClosingTags=['path'])
    svg_soup = svg_soup.findChild('svg')
    assert svg_soup

    paths = svg_extract_paths(svg_soup)
    assert paths

    plottify_closed(paths)

    plotcut_svg = absolute_paths_to_plotcut_svg(paths)

    return plotcut_svg
Пример #5
0
def svg_text_to_plotcutsvg(svg_text):
    BeautifulStoneSoup.NESTABLE_TAGS["g"] = []
    svg_soup = BeautifulStoneSoup(svg_text, selfClosingTags=['path'])
    svg_soup = svg_soup.findChild('svg')
    assert svg_soup

    paths = svg_extract_paths(svg_soup)
    assert paths

    plottify_closed(paths)
        
    plotcut_svg = absolute_paths_to_plotcut_svg(paths)

    return plotcut_svg
Пример #6
0
def retrieveVideoInfo(video_id):
    
    video_info = VideoInfo()
    video_info.set_video_hosting_info(getVideoHostingInfo())
    video_info.set_video_id(video_id)
    try:
        video_info_link = 'http://www.veoh.com/rest/v2/execute.xml?method=veoh.video.findByPermalink&permalink=' + str(video_id) + '&apiKey=' + API_KEY
        soup = BeautifulStoneSoup(HttpUtils.HttpClient().getHtmlContent(url=video_info_link), convertEntities=BeautifulStoneSoup.XML_ENTITIES)
        
        videoObj = soup.findChild(name='video')
        video_link = HttpUtils.getRedirectedUrl(str(videoObj['ipodurl']))
        img_link = str(videoObj['highresimage'])
        video_title = str(videoObj['title'])
        
        video_info.set_video_stopped(False)
        video_info.set_video_image(img_link)
        video_info.set_video_name(video_title)
        video_info.add_video_link(VIDEO_QUAL_SD, video_link)
        
    except: 
        video_info.set_video_stopped(True)
    return video_info