本文整理汇总了Python中utils.cleantext函数的典型用法代码示例。如果您正苦于以下问题:Python cleantext函数的具体用法?Python cleantext怎么用?Python cleantext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cleantext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PAQList
def PAQList(url, page, onelist=None):
if onelist:
url = url.replace("page/1/", "page/" + str(page) + "/")
listhtml = utils.getHtml(url, "")
if "pornaq" in url:
match = re.compile(
r'<h2>\s+<a title="([^"]+)" href="([^"]+)".*?src="([^"]+)" class="attachment-primary-post-thumbnail',
re.DOTALL | re.IGNORECASE,
).findall(listhtml)
for name, videopage, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 62, img, "")
elif "porn00" in url:
match = re.compile(
'<h2> <a title="([^"]+)" href="([^"]+)".*?src="([^"]+)" class="attachment-primary-post-thumbnail',
re.DOTALL | re.IGNORECASE,
).findall(listhtml)
for name, videopage, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 62, img, "")
if not onelist:
if re.search("<span class='current'>\d+?</span><span>", listhtml, re.DOTALL | re.IGNORECASE):
npage = page + 1
url = url.replace("page/" + str(page) + "/", "page/" + str(npage) + "/")
utils.addDir("Next Page (" + str(npage) + ")", url, 61, "", npage)
xbmcplugin.endOfDirectory(utils.addon_handle)
示例2: Categories
def Categories(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<a href="(.+?)" title=".+?">\n.+?<div class="thumb">\n.+?<img class="thumb" src="(.+?)" alt="(.+?)"/>').findall(listhtml)
for catpage, img, name in match:
name = utils.cleantext(name)
utils.addDir(name, catpage, 341, img, '')
xbmcplugin.endOfDirectory(utils.addon_handle)
示例3: Cat
def Cat(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<li><a href="([^"]+)" rel="tag">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, name in match:
name = utils.cleantext(name)
utils.addDir(name, catpage, 371, '', '')
xbmcplugin.endOfDirectory(utils.addon_handle)
示例4: Cat
def Cat(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<a class="item" href="([^"]+)" title="([^"]+)".*?thumb" src="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, name, img in match:
name = utils.cleantext(name)
utils.addDir(name, catpage, 361, img, '')
xbmcplugin.endOfDirectory(utils.addon_handle)
示例5: XTList
def XTList(url, page):
sort = getXTSortMethod()
if re.search('\?', url, re.DOTALL | re.IGNORECASE):
url = url + '&filtre=' + sort
else:
url = url + '?filtre=' + sort
print url
listhtml = utils.getHtml(url, '')
match = re.compile('src="([^"]+?)" class="attachment.*?<a href="([^"]+)" title="([^"]+)".*?<div class="right">.<p>([^<]+)</p>', re.DOTALL | re.IGNORECASE).findall(listhtml)
for img, videopage, name, desc in match:
name = utils.cleantext(name)
desc = utils.cleantext(desc)
utils.addDownLink(name, videopage, 23, img, desc)
if re.search('<link rel="next"', listhtml, re.DOTALL | re.IGNORECASE):
npage = page + 1
url = url.replace('/page/'+str(page)+'/','/page/'+str(npage)+'/')
utils.addDir('Next Page ('+str(npage)+')', url, 21, '', npage)
xbmcplugin.endOfDirectory(utils.addon_handle)
示例6: WXFList
def WXFList(url, page):
sort = getWXFSortMethod()
if re.search('\?', url, re.DOTALL | re.IGNORECASE):
url = url + '&filtre=' + sort + '&display=extract'
else:
url = url + '?filtre=' + sort + '&display=extract'
print url
listhtml = utils.getHtml(url, '')
match = re.compile('src="([^"]+)"[^<]+</noscript>.*?<a href="([^"]+)" title="([^"]+)".*?<p>([^<]+)</p>', re.DOTALL | re.IGNORECASE).findall(listhtml)
for img, videopage, name, desc in match:
name = utils.cleantext(name)
desc = utils.cleantext(desc)
utils.addDownLink(name, videopage, 13, img, desc)
if re.search('<link rel="next"', listhtml, re.DOTALL | re.IGNORECASE):
npage = page + 1
url = url.replace('/page/'+str(page)+'/','/page/'+str(npage)+'/')
utils.addDir('Next Page ('+str(npage)+')', url, 11, '', npage)
xbmcplugin.endOfDirectory(utils.addon_handle)
示例7: ListSearch
def ListSearch(url):
html = utils.getHtml(url, '').replace('\n','')
match = re.compile('<p>(.+?)</p><p>.+?<img src="(.+?)".*?/>.*?</a>.*?<a href="(.+?)" class="more-link">').findall(html)
for name, img, videopage in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 422, img, '')
try:
nextp = re.compile('<link rel="next" href="(.+?)" />', re.DOTALL | re.IGNORECASE).findall(html)
utils.addDir('Next Page', nextp[0], 425,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例8: List
def List(url):
listhtml = utils.getHtml(url, '')
match = re.compile(r'class="content-list-thumb">\s+<a href="([^"]+)" title="([^"]+)">.*?src="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
for videopage, name, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 232, img, '')
try:
nextp=re.compile('next page-numbers" href="([^"]+)">»', re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
utils.addDir('Next Page', nextp, 231,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例9: P00List
def P00List(url, page):
listhtml = utils.getHtml(url, '')
match = re.compile('src="([^"]+)" class="attachment-primary-post-thumbnail wp-post-image".*?<a title="([^"]+)" href="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
for img, name, videopage in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 62, img, '')
if re.search("<span class='current'>\d+?</span><span>", listhtml, re.DOTALL | re.IGNORECASE):
npage = page + 1
url = url.replace('page/'+str(page)+'/','page/'+str(npage)+'/')
utils.addDir('Next Page ('+str(npage)+')', url, 65, '', npage)
xbmcplugin.endOfDirectory(utils.addon_handle)
示例10: List
def List(url):
listhtml = utils.getHtml(url, '')
match = re.compile(r'<div class="quadrato">\s*?<a href="([^"]+)"\s*?title="([^"]+)".*?src="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
for videopage, name, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 172, img, '')
try:
nextp=re.compile(r"""current(?:"|')>\d+</span><a.*?href=(?:"|')([^'"]+)""", re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
utils.addDir('Next Page', nextp, 171,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例11: List
def List(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<h2><a href="([^"]+)".*?title="([^"]+)">.+?<img src="([^"]+)".+? width="', re.DOTALL).findall(listhtml)
for videopage, name, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 372, img, '')
try:
nextp = re.compile('<span class=\'current\'>.+?</span><a class="page larger" href="([^"]+)"').findall(listhtml)
utils.addDir('Next Page', nextp[0], 371,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例12: List
def List(url):
listhtml = utils.getHtml(url, '')
match = re.compile(r'<a class="thumbnail" href="(.+?)">\n<script.+?</script>\n<figure>\n<img id=".+?" src="(.+?)".+?/>\n<figcaption>\n<span class="video-icon"><i class="fa fa-play"></i></span>\n<span class="duration"><i class="fa fa-clock-o"></i>(.+?)</span>\n(.+?)\n').findall(listhtml)
for videopage, img, duration, name in match:
name = utils.cleantext(name) + ' ' + duration
utils.addDownLink(name, 'http://www.mrsexe.com/' + videopage, 402, img, '')
try:
nextp=re.compile(r'<li class="arrow"><a href="(.+?)">suivant</li>').findall(listhtml)
utils.addDir('Next Page', 'http://www.mrsexe.com/' + nextp[0], 401,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例13: List
def List(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<a class="" href="(.+?)" title="(.+?)">\n<img src="(.+?)" class="has-image" alt=".+?"/>', re.DOTALL | re.IGNORECASE).findall(listhtml)
for videopage, name, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 352, img, '')
try:
nextp=re.compile('<li class="disabled active"><span class="active">.+?</span></li><li><a href="(.+?)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
utils.addDir('Next Page', nextp[0], 351,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例14: List
def List(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<li>\n.+?<a href="(.+?)" title="(.+?)">\n.+?<div class="thumb thumb-paged" data-screen-main="1">\n\n.+?<img src="(.+?)"').findall(listhtml)
for videopage, name, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 342, img, '')
try:
nextp=re.compile('<a href="(.+?)" title="Next Page" data-page-num.+?>Next page').findall(listhtml)
utils.addDir('Next Page', 'http://www.hdzog.com' + nextp[0], 341,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
示例15: List
def List(url):
html = utils.getHtml(url, '')
match = re.compile(r'data-id="\d+" title="([^"]+)" href="([^"]+)".*?src="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(html)
for name, videopage, img in match:
name = utils.cleantext(name)
utils.addDownLink(name, videopage, 412, img, '')
try:
nextp = re.compile('<a class="nextpostslink" rel="next" href="(.+?)">', re.DOTALL | re.IGNORECASE).findall(html)
utils.addDir('Next Page', nextp[0], 411,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)