本文整理汇总了Python中asi.Utils.makeFilename方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.makeFilename方法的具体用法?Python Utils.makeFilename怎么用?Python Utils.makeFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asi.Utils
的用法示例。
在下文中一共展示了Utils.makeFilename方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, url, channel, date, pid, title, desc, h264, m3u8, wmv):
super(Program, self).__init__()
self.url = url
self.pid = pid
self.title = title
self.description = desc
self.channel = channel
if date:
self.datetime = datetime.datetime.strptime(date, "%d/%m/%Y")
else:
self.datetime = datetime.datetime.now()
Utils.addH264Url(self.h264, 0, h264)
if m3u8:
self.ts = m3u8
if wmv:
self.mms = wmv
self.grabber = grabber
self.filename = Utils.makeFilename(self.title)
self.canFollow = True
示例2: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, pid, grabber, data):
super(Elem, self).__init__()
self.pid = pid
self.title = data.findtext("titolo")
self.description = data.findtext("descrizione")
self.channel = data.findtext("dominio")
self.grabber = grabber
strTime = data.findtext("datapubblicazione")
strTime = strTime.replace("-", "/")
self.datetime = datetime.datetime.strptime(strTime, "%d/%m/%Y")
# extra experimental data
h264 = data.findtext("h264")
Utils.addH264Url(self.h264, 0, h264)
self.ts = data.findtext("m3u8")
self.id = data.findtext("localid")
self.length = data.findtext("durata")
web = data.findtext("web")
if not web:
web = RAIUrls.getWebFromID(self.id)
self.url = RAIUrls.base + web
self.filename = Utils.makeFilename(self.title)
self.canFollow = True
示例3: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, url, downType, pid):
super(Demand, self).__init__()
self.grabber = grabber
parts = urllib.parse.urlparse(url)
if not parts.scheme:
url = RAIUrls.getItemUrl(url)
self.url = url
self.pid = pid
folder = Config.itemFolder
localFilename = os.path.join(folder, Utils.httpFilename(self.url))
f = Utils.download(grabber, None, self.url, localFilename, downType, "utf-8")
parser = VideoHTMLParser()
parser.feed(f.read())
self.values = parser.values
self.channel = "item"
self.title = self.values.title
self.ts = self.values.videoUrlM3U8
Utils.addH264Url(self.h264, 0, self.values.videoUrlH264)
if self.values.date:
self.datetime = datetime.datetime.strptime(self.values.date, "%d/%m/%Y")
self.mms = None
if self.values.type and self.values.type != "Video":
# this is a case of a Photogallery
self.url = None
self.filename = None
return
if not self.values.videoUrl:
self.values.videoUrl = self.values.videoPath
#sometimes we get .mp4 which does not work
self.values.videoUrl = self.values.videoUrl.replace("relinkerServlet.mp4", "relinkerServlet.htm")
#make a nice filename
self.filename = Utils.makeFilename(self.title)
self.mms = self.values.videoUrl
示例4: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, channel, date, hour, pid, length, title, desc, url):
super(Program, self).__init__()
self.pid = pid
self.title = title
self.description = desc
self.channel = channel
self.datetime = datetime.datetime.strptime(date + " " + hour, "%Y-%m-%d %H:%M")
self.ts = url
self.grabber = grabber
self.length = length
name = Utils.makeFilename(self.title)
self.filename = self.pid + "-" + name
示例5: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, datetime, length, pid, title, desc, wat, category):
super(Program, self).__init__()
self.pid = pid
self.title = title
self.description = desc
self.channel = "tf1"
self.wat = wat
self.datetime = datetime
self.category = category
self.length = length
self.grabber = grabber
self.ts = getWatLink(self.wat)
name = Utils.makeFilename(self.title)
self.filename = self.pid + "-" + name
示例6: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, conf, datetime, length, pid, title, desc, num, channel):
super(Program, self).__init__()
self.pid = pid
self.title = title
self.description = desc
self.channel = channel
self.num = num
self.datetime = datetime
self.length = length
self.grabber = grabber
self.url = getMediasetLink(conf, num)
name = Utils.makeFilename(self.title)
self.filename = self.pid + "-" + name
示例7: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, pid, grabber, title, description, date, length, url, h264, ts, mms):
super(Episode, self).__init__()
self.pid = pid
self.grabber = grabber
self.title = title
self.description = description
self.url = url
self.datetime = datetime.datetime.strptime(date, "%d-%m-%Y")
self.length = length
Utils.addH264Url(self.h264, 0, h264)
self.ts = ts
self.mms = mms
self.filename = Utils.makeFilename(self.title)
示例8: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, url, channel, date, pid, title, desc, h264, m3u8):
super(Program, self).__init__()
self.url = url
self.pid = pid
self.title = title
self.description = desc
self.channel = channel
strtime = date.replace("-", "/")
self.datetime = datetime.datetime.strptime(strtime, "%d/%m/%Y %H:%M")
Utils.addH264Url(self.h264, 0, h264)
if m3u8:
self.ts = m3u8
self.grabber = grabber
name = Utils.makeFilename(self.title)
self.filename = name + "-" + self.datetime.strftime("%Y-%m-%d")
self.canFollow = True
示例9: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, channel, date, hour, pid, length, title, desc, h264, tablet, smartPhone):
super(Program, self).__init__()
self.pid = pid
self.title = title
self.h264 = h264
self.description = desc
self.channel = channel
if tablet: # higher quality normally
self.ts = tablet
else:
self.ts = smartPhone
self.datetime = datetime.datetime.strptime(date + " " + hour, "%Y-%m-%d %H:%M")
self.grabber = grabber
self.length = length
name = Utils.makeFilename(self.title)
self.filename = self.pid + "-" + name
示例10: __init__
# 需要导入模块: from asi import Utils [as 别名]
# 或者: from asi.Utils import makeFilename [as 别名]
def __init__(self, grabber, downType, channel, date, pid, key, length, title, desc):
super(Program, self).__init__()
self.pid = pid
self.title = title
self.description = desc
self.channel = channel
self.key = key
self.downType = downType
self.url = getInfoUrl(self.channel, self.key);
if date:
self.datetime = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
else:
self.datetime = datetime.datetime.now()
self.grabber = grabber
self.length = length
name = Utils.makeFilename(self.title)
self.filename = self.pid + "-" + name