def __getVideoFileUrl (self, confgFileUrl, siteType = 1) :
if siteType != 1:
confgFileUrl = confgFileUrl + '&site=' + str(siteType)
pageHeader, pageBody = self.Tools.getPage(confgFileUrl)
info = re.findall(r"^.*\((.*)\);", pageBody)
info = info[0].decode('gbk').encode('utf-8')
info = json.JSONDecoder().decode(info)
if info.has_key('data') :
if len(info['data']['urls']['m3u8'][self.videoTypeList[self.videoType]]) > 0 :
fileUrl = info['data']['urls']['m3u8'][self.videoTypeList[self.videoType]][0]
else :
fileUrl = info['data']['urls']['m3u8'][self.videoTypeList['n']][0]
fileUrlBase = re.findall(r"^(.*)\.m3u8\?", fileUrl)
if len(fileUrlBase) > 0 :
fileUrl = fileUrlBase[0] + self.fileUrlSuffix
else :
fileUrl = False
else :
fileUrl = self.__getVideoFileUrl(confgFileUrl, 2)
return fileUrl
评论列表
文章目录