本文整理汇总了Python中common.DataObjects.VideoInfo.set_video_stopped方法的典型用法代码示例。如果您正苦于以下问题:Python VideoInfo.set_video_stopped方法的具体用法?Python VideoInfo.set_video_stopped怎么用?Python VideoInfo.set_video_stopped使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.DataObjects.VideoInfo
的用法示例。
在下文中一共展示了VideoInfo.set_video_stopped方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
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: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = 'http://www.megavideo.com/xml/videolink.php?v=' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_link)
html = ''.join(html.splitlines()).replace('\t', '').replace('\'', '"')
un = re.compile(' un="(.+?)"').findall(html)
k1 = re.compile(' k1="(.+?)"').findall(html)
k2 = re.compile(' k2="(.+?)"').findall(html)
hashresult = decrypt(un[0], k1[0], k2[0])
s = re.compile(' s="(.+?)"').findall(html)
title = re.compile(' title="(.+?)"').findall(html)
videoTitle = urllib.unquote_plus(title[0].replace('+', ' ').replace('.', ' '))
video_link = "http://www" + s[0] + ".megavideo.com/files/" + hashresult + "/" + videoTitle.replace('www.apnajoy.com', '') + ".flv";
video_info.set_video_stopped(False)
video_info.set_video_name(videoTitle)
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
except:
video_info.set_video_stopped(True)
return video_info
示例3: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
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.facebook.com/video/video.php?v=' + str(video_id)
html = urllib.unquote_plus(HttpUtils.HttpClient().getHtmlContent(url=video_info_link).replace('\u0025', '%'))
video_title = re.compile('addVariable\("video_title"\, "(.+?)"').findall(html)[0]
img_link = re.compile('addVariable\("thumb_url"\, "(.+?)"').findall(html)[0]
high_video_link = re.compile('addVariable\("highqual_src"\, "(.+?)"').findall(html)
low_video_link = re.compile('addVariable\("lowqual_src"\, "(.+?)"').findall(html)
video_link = re.compile('addVariable\("video_src"\, "(.+?)"').findall(html)
if len(high_video_link) > 0:
video_info.add_video_link(VIDEO_QUAL_HD_720, high_video_link[0])
if len(low_video_link) > 0:
video_info.add_video_link(VIDEO_QUAL_SD, low_video_link[0])
if len(video_link) > 0:
video_info.add_video_link(VIDEO_QUAL_SD, video_link[0])
video_info.set_video_stopped(False)
video_info.set_video_name(video_title)
video_info.set_video_image(img_link)
except:
raise
video_info.set_video_stopped(True)
return video_info
示例4: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
HttpUtils.HttpClient().enableCookies()
video_info_link = 'http://www.vidxden.com/' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link)
if re.search(r'Video bandwidth is expensive. We appreciate Your patience!', html):
data = {'method_free': 'Continue to Video', 'op' : 'download1', 'usr_login' : '', 'id':str(video_id)}
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link, params=data)
HttpUtils.HttpClient().disableCookies()
paramSet = re.compile("return p\}\(\'(.+?)\',(\d\d),(\d\d),\'(.+?)\'").findall(html)
video_info_link = AddonUtils.parsePackedValue(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'')
img_data = re.compile(r"addVariable\(\'image\',\'(.+?)\'\);").findall(video_info_link)
if len(img_data) == 1:
video_info.set_video_image(img_data[0])
video_link = re.compile("addVariable\(\'file\',\'(.+?)\'\);").findall(video_info_link)[0]
video_info.set_video_stopped(False)
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
except:
video_info.set_video_stopped(True)
return video_info
示例5: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = 'http://www.dailymotion.com/video/' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_link)
sequence = re.compile('"sequence":"(.+?)"').findall(html)
newseqeunce = urllib.unquote(sequence[0]).decode('utf8').replace('\\/', '/')
# jsonObj = json.loads(newseqeunce, encoding='utf-8')
# print jsonObj
imgSrc = re.compile('og:image" content="(.+?)"').findall(html)
if(len(imgSrc) == 0):
imgSrc = re.compile('/jpeg" href="(.+?)"').findall(html)
dm_low = re.compile('"sdURL":"(.+?)"').findall(newseqeunce)
dm_high = re.compile('"hqURL":"(.+?)"').findall(newseqeunce)
video_info.set_video_image(imgSrc[0])
video_info.set_video_stopped(False)
if(len(dm_high) == 0 and len(dm_low) == 1):
video_info.add_video_link(VIDEO_QUAL_SD, dm_low[0])
elif(len(dm_low) == 0 and len(dm_high) == 1):
video_info.add_video_link(VIDEO_QUAL_HD_720, dm_high[0])
else:
video_info.add_video_link(VIDEO_QUAL_SD, dm_low[0])
video_info.add_video_link(VIDEO_QUAL_HD_720, dm_high[0])
except:
video_info.set_video_stopped(True)
return video_info
示例6: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
html = HttpUtils.HttpClient().getHtmlContent(url='http://vimeo.com/' + str(video_id))
referrerObj = re.compile('"timestamp":(.+?),"signature":"(.+?)"').findall(html)[0]
req_sig_exp = referrerObj[0]
req_sig = referrerObj[1]
img_link = re.compile('itemprop="thumbnailUrl" content="(.+?)"').findall(html)[0]
video_title = re.compile('"title":"(.+?)"').findall(html)[0]
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(re.search('"hd":1', html)):
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 Exception, e:
Logger.logError(e)
video_info.set_video_stopped(True)
示例7: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = 'http://www.mediaplaybox.com/mobile?vinf=' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_link, headers=HttpUtils.IPAD_HEADERS)
video_file_info = re.compile('href="http://www.mediaplaybox.com/media/files_flv/(.+?)"').findall(html)
if(len(video_file_info) == 0):
video_file_info = re.compile('href="http://www.mediaplaybox.com:81/media/files_flv/(.+?)"').findall(html)
video_file = video_file_info[0]
img_file_info = re.compile('src="http://www.mediaplaybox.com/media/files_thumbnail/(.+?)"').findall(html)
if(len(img_file_info) == 0):
img_file_info = re.compile('src="http://www.mediaplaybox.com/media/files_thumbnail/(.+?)"').findall(html)[0]
img_file = img_file_info[0]
video_link = 'http://www.mediaplaybox.com/media/files_flv/' + video_file.replace('_ipod.mp4', '.flv')
hd_video_link = 'http://www.mediaplaybox.com/media/files_flv/' + video_file.replace('_ipod.mp4', '_hd.mp4')
img_link = 'http://www.mediaplaybox.com/media/files_thumbnail/' + img_file
video_info.set_video_stopped(False)
video_info.set_video_image(img_link)
video_info.set_video_name("Media PlayBox Video")
try:
response = HttpUtils.HttpClient().getResponse(url=hd_video_link)
if response.status < 400:
video_info.add_video_link(VIDEO_QUAL_HD_720, hd_video_link, addUserAgent=False)
except Exception,e:
print 'No HD link'
video_info.add_video_link(VIDEO_QUAL_SD, video_link, addUserAgent=False)
示例8: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
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.vidpe.com/" + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link)
paramSet = re.compile("return p\}\('(.+?)',(\d\d),(\d\d),'(.+?)'").findall(html)
video_info_link = (
AddonUtils.parsePackedValue(
paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split("|")
)
.replace("\\", "")
.replace('"', "'")
)
img_data = re.compile(r"addVariable\(\'image\',\'(.+?)\'\);").findall(video_info_link)
if len(img_data) == 1:
video_info.set_video_image(img_data[0])
video_link = re.compile("addVariable\('file','(.+?)'\);").findall(video_info_link)[0]
video_info.set_video_stopped(False)
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
except:
video_info.set_video_stopped(True)
return video_info
示例9: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
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://movzap.com/' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link)
paramSet = re.compile("return p\}\(\'(.+?)\',(\d\d),(\d\d),\'(.+?)\'").findall(html)
if len(paramSet) > 0:
video_info_link = AddonUtils.parsePackedValue(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'')
img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link)
if len(img_data) == 1:
video_info.set_video_image(img_data[0])
video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0]
else:
video_link = re.compile("'file': '(.+?)'").findall(html)[0]
video_info.set_video_stopped(False)
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
except Exception, e:
Logger.logError(e)
video_info.set_video_stopped(True)
示例10: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
HttpUtils.HttpClient().enableCookies()
video_info_link = 'http://www.movshare.net/video/' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link)
if re.search(r'Video hosting is expensive. We need you to prove you\'re human.', html):
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link)
video_info_link = re.compile('<embed type="video/divx" src="(.+?)"').findall(html)
video_link = ''
if len(video_info_link) == 0:
domainStr = re.compile('flashvars.domain="(.+?)"').findall(html)[0]
fileStr = re.compile('flashvars.file="(.+?)"').findall(html)[0]
filekeyStr = re.compile('flashvars.filekey="(.+?)"').findall(html)[0]
video_info_link = domainStr + '/api/player.api.php?user=undefined&pass=undefined&codes=1&file=' + fileStr + '&key=' + filekeyStr
html = HttpUtils.HttpClient().getHtmlContent(url=video_info_link)
video_link = re.compile(r'url=(.+?)&').findall(html)[0]
else:
video_link = video_info_link[0]
HttpUtils.HttpClient().disableCookies()
video_info.set_video_stopped(False)
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
except:
video_info.set_video_stopped(True)
return video_info
示例11: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = "http://videos.videopress.com/" + str(video_id) + ".mp4"
print video_link
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
video_info.set_video_stopped(False)
except:
video_info.set_video_stopped(True)
return video_info
示例12: retrieveAudioInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveAudioInfo(audioUrl):
url = 'https://api.soundcloud.com/' + audioUrl
jObj = json.loads(HttpUtils.HttpClient().getHtmlContent(url=url))
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(url)
video_info.add_video_link(VIDEO_QUAL_SD, jObj['http_mp3_128_url'], addUserAgent=False, addReferer=False)
video_info.set_video_image('')
video_info.set_video_name('')
Logger.logDebug(jObj['http_mp3_128_url'])
video_info.set_video_stopped(False)
return video_info
示例13: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = 'http://videos.stvflicks.com/' + str(video_id) + '.mp4'
print video_link
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
video_info.set_video_stopped(False)
except:
video_info.set_video_stopped(True)
return video_info
示例14: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = "http://www.vioku.com/flvideo/" + video_id
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
video_info.set_video_stopped(False)
except:
video_info.set_video_stopped(True)
return video_info
示例15: retrieveVideoInfo
# 需要导入模块: from common.DataObjects import VideoInfo [as 别名]
# 或者: from common.DataObjects.VideoInfo import set_video_stopped [as 别名]
def retrieveVideoInfo(video_id):
video_info = VideoInfo()
video_info.set_video_hosting_info(getVideoHostingInfo())
video_info.set_video_id(video_id)
try:
video_link = 'http://www.zshare.net/video/' + str(video_id)
html = HttpUtils.HttpClient().getHtmlContent(url=video_link)
match = re.compile('<iframe src="http://www.zshare.net/videoplayer/player.php(.+?)"').findall(html)
html = HttpUtils.HttpClient().getHtmlContent(url=('http://www.zshare.net/videoplayer/player.php' + match[0].replace(' ', '%20')))
video_link = re.compile('file: "(.+?)"').findall(html)[0].replace(' ', '%20')
video_info.set_video_stopped(False)
video_info.add_video_link(VIDEO_QUAL_SD, video_link)
except:
video_info.set_video_stopped(True)
return video_info