本文整理汇总了Python中resources.lib.utils.cleantext函数的典型用法代码示例。如果您正苦于以下问题:Python cleantext函数的具体用法?Python cleantext怎么用?Python cleantext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cleantext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: WXFList
def WXFList(url, page=1, onelist=None):
if onelist:
url = url.replace('/page/1/','/page/'+str(page)+'/')
sort = getWXFSortMethod()
if re.search('\?', url, re.DOTALL | re.IGNORECASE):
url = url + '&filtre=' + sort + '&display=extract'
else:
url = url + '?filtre=' + sort + '&display=extract'
try:
listhtml = utils.getHtml(url, '')
except Exception as e:
return None
# match = re.compile('src="([^"]+)" class="attachment-thumb_site.*?<a href="([^"]+)" title="([^"]+)".*?<p>([^<]+)</p>', re.DOTALL | re.IGNORECASE).findall(listhtml)
match = re.compile('<article id=.*?<a href="([^"]+)" title="([^"]+)".*?<img data-src="([^"]+)" alt="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml) # Current as of 19.02.23
# for img, videopage, name, desc in match:
for videopage, name, img, desc in match: # Current as of 19.02.23
name = utils.cleantext(name)
desc = utils.cleantext(desc)
utils.addDownLink(name, videopage, 13, img, desc)
if not onelist:
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)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:25,代码来源:watchxxxfree.py
示例2: Cat
def Cat(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<a class="item" href="([^"]+)" title="([^"]+)".*?data-original="([^"]+)".*?videos">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, name, img, videos in match:
name = utils.cleantext(name) + " [COLOR deeppink]" + videos + "[/COLOR]"
utils.addDir(name, catpage, 361, img, '')
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:tubepornclassic.py
示例3: v7_list
def v7_list(url, page=None, search=None):
orig_url = str(url)
if page:
page_end = 'page/' + str(page) + '/' if url.endswith('/') else '/page/' + str(page) + '/'
url += page_end
else:
page = 1
sort = '?orderby=date' if url.endswith('/') else '/?orderby=date'
url += sort
url = url + search if search else url
try:
listhtml = utils.getHtml(url)
except Exception as e:
return None
match = re.compile('''class='thumb-wrapp'.*?href='([^']+)'.*?"([^"]+)".*?class='vl'(.*?)class="duration">(.*?)</div>.*?class='hp'[^>]+>([^<]+)<''', re.DOTALL | re.IGNORECASE).findall(listhtml)
for videopage, img, hd, duration, name in match:
hd = ' [COLOR orange]HD[/COLOR] ' if 'HD' in hd else ' '
name = utils.cleantext(name) + hd + duration.strip()
utils.addDownLink(name, videopage, 642, img, '')
pages_html = re.compile('<div class="buttons">(.*?)</div', re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
pages = re.compile('<a[^>]+>(.*?)</a', re.DOTALL | re.IGNORECASE).findall(pages_html)
pages = [int(p.replace(' ', '').replace('...', '').strip()) for p in pages]
max_page = max(pages)
if page < max_page:
utils.addDir('Next Page (' + str(page + 1) + ')' , orig_url, 641, '', page + 1, search)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:26,代码来源:vidz7.py
示例4: List
def List(url):
try:
listhtml = utils.getHtml(url, '')
except:
return None
match = re.compile('thumb-main-titre"><a href="..([^"]+)".*?title="([^"]+)".*?src="([^"]+)".*?<div class="thumb-info">(.*?)time">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
for videourl, name, img, hd, duration in match:
name = utils.cleantext(name)
if hd.find('hd') > 0:
if hd.find('full') > 0:
hd = " [COLOR yellow]FULLHD[/COLOR] "
else:
hd = " [COLOR orange]HD[/COLOR] "
else:
hd = " "
videopage = "http://www.absoluporn.com" + videourl
videopage = videopage.replace(" ","%20")
name = name + hd + "[COLOR deeppink]" + duration + "[/COLOR]"
utils.addDownLink(name, videopage, 302, img, '')
try:
nextp=re.compile(r'<span class="text16">\d+</span> <a href="..([^"]+)"').findall(listhtml)[0]
nextp = nextp.replace(" ","%20")
utils.addDir('Next Page', 'http://www.absoluporn.com' + nextp, 301,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:26,代码来源:absoluporn.py
示例5: pornvibe_cat
def pornvibe_cat(url):
listhtml = utils.getHtml(url)
match = re.compile('''<img src="([^"]+)" alt="([^"]+)">.+?href="([^"]+)".*?<p>([^&]+)&''', re.DOTALL | re.IGNORECASE).findall(listhtml)
for img, name, catpage, count in sorted(match, key=lambda x: x[1].strip().lower()):
name = utils.cleantext(name.strip()) + " [COLOR deeppink]" + count.strip() + " videos[/COLOR]"
utils.addDir(name, catpage, 681, img, 1)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:7,代码来源:pornvibe.py
示例6: pl_cat
def pl_cat(url):
listhtml = utils.getHtml(url, 'https://porns.land/')
match = re.compile('<div class="category".*?href="([^"]+)".*?data-original="([^"]+)".*?alt="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, img, name in match:
name = utils.cleantext(name)
utils.addDir(name, catpage, 621, img, 1)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:7,代码来源:pornsland.py
示例7: datoporn_cat
def datoporn_cat(url):
listhtml = utils.getHtml(url)
match = re.compile('''class="vid_block".*?href="([^"]+)".*?url[(]([^)]+)[)].*?<span>([^<]+)</span>.*?<b>([^<]+)</b''', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, img, count, name in sorted(match, key=lambda x: x[3].strip().lower()):
name = utils.cleantext(name.strip()) + " [COLOR deeppink]" + count.strip() + "[/COLOR]"
utils.addDir(name, catpage, 671, img, 1)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:7,代码来源:datoporn.py
示例8: PTList
def PTList(url, page=1, onelist=None):
if onelist:
url = url.replace('page=1','page='+str(page))
try:
listhtml = utils.getHtml(url, '')
except:
utils.notify('Oh oh','It looks like this website is down.')
return None
match = re.compile(r'<div class="(?:visible-xs|thumb-overlay)+">\s+<img src=.*?data-original="([^"]+)" title="([^"]+)"[^>]+>(.*?)duration">[^\d]+([^\t\n\r]+)', re.DOTALL | re.IGNORECASE).findall(listhtml)
for img, name, hd, duration in match:
name = utils.cleantext(name)
if hd.find('HD') > 0:
hd = " [COLOR orange]HD[/COLOR] "
else:
hd = " "
urlid = re.search(r"(\d{2,})", img, re.DOTALL | re.IGNORECASE).group()
videopage = "http://www.porntrex.com/media/nuevo/config.php?key=" + urlid + "-1-1"
name = name + hd + "[COLOR deeppink]" + duration + "[/COLOR]"
utils.addDownLink(name, videopage, 52, img, '')
if not onelist:
if re.search('class="prevnext">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, 51, '', npage)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:25,代码来源:porntrex.py
示例9: 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)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:7,代码来源:freeomovie.py
示例10: v7_cat
def v7_cat(url):
listhtml = utils.getHtml(url, 'http://www.vidz7.com/')
match = re.compile('li><a href="([^"]+)">(.*?)</a><span>([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, name, nr in match:
name = utils.cleantext(name) + ' [COLOR orange]' + nr.strip() + '[/COLOR]'
utils.addDir(name, catpage, 641, '', 1)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:7,代码来源:vidz7.py
示例11: Cat
def Cat(url):
listhtml = utils.getHtml3(url)
match = re.compile('<a class="list-item__link" href="([^"]+)" title="([^"]+)".*?class="list-item__info">([^<]+)', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, name, videos in match:
videos=videos.replace(' ','')
name = utils.cleantext(name) + " [COLOR deeppink]" + videos + "[/COLOR]"
utils.addDir(name, catpage, 361)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:8,代码来源:tubepornclassic.py
示例12: Categories
def Categories(url):
listhtml = utils.getHtml(url, '')
match = re.compile(r'<li>\s+<a href="([^"]+)"[^<]+<[^<]+<img.*?src="([^"]+)".*?title">([^<]+)<', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, img, name in match:
name = utils.cleantext(name)
catpage = catpage + '?sortby=post_date'
utils.addDir(name, catpage, 341, img, '')
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:8,代码来源:hdzog.py
示例13: Cat
def Cat(url):
listhtml = utils.getHtml(url, '')
match0 = re.compile('<h2>Categories(.+?)<tr id="myRow">', re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
match = re.compile('<a href="(.+?)"\s+title=".+?">(.+?)<', re.DOTALL | re.IGNORECASE).findall(match0)
for catpage, name in match:
name = utils.cleantext(name)
utils.addDir(name, catpage, 371, '', '')
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:8,代码来源:freeomovie.py
示例14: 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)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:9,代码来源:hdzog.py
示例15: ChannelList
def ChannelList(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<a href="([^"]+)" class="thumb" data-rt=".+?">.+?<img width="220" height="165" src="([^"]+)" alt="([^"]+)"', re.DOTALL).findall(listhtml)
for videopage, img, name in match:
name = utils.cleantext(name)
utils.addDownLink(name, 'http://www.hclips.com' + videopage, 382, img, '')
try:
nextp=re.compile('<li class="next">.+?<a href="([^"]+)".*?>Next</a>', re.DOTALL | re.IGNORECASE).findall(listhtml)
utils.addDir('Next Page', 'http://www.hclips.com' + nextp[0], 386,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:11,代码来源:hclips.py
示例16: Channels
def Channels(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<a href="([^"]+)" class="video_thumb" title="([^"]+)">.+?<img height="165" width="285" src="([^"]+)"', re.DOTALL).findall(listhtml)
for chanpage, name, img in match:
name = utils.cleantext(name)
utils.addDir(name, "http://hclips.com" + chanpage, 386, "http://hclips.com" + img, '')
try:
nextp=re.compile(r'<li class="next">\s+<a href="([^"]+)".*?>Next</a>', re.DOTALL | re.IGNORECASE).findall(listhtml)
utils.addDir('Next Page', 'http://www.hclips.com' + nextp[0], 385,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:11,代码来源:hclips.py
示例17: WXFCat
def WXFCat(url):
cathtml = utils.getHtml(url, '') #
# match = re.compile('<img width=.+?src="(.+?)".+?a href="(.+?)"\s+title="(.+?)".+?span class="nb_cat border.+?>(.+?)<', re.DOTALL | re.IGNORECASE).findall(cathtml)
match = re.compile('<article id=.*?<a href="([^"]+)" title="([^"]+)".*?data-lazy-src="([^"]+)".*? alt="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(cathtml) # Current as of 19.02.23
for catpage, name, img, videos in match: # Current as of 19.02.23
# for img, catpage, name, videos in match:
catpage = catpage + 'page/1/'
name = utils.cleantext(name)
name = name # + ' [COLOR deeppink]' + videos + '[/COLOR]'
utils.addDir(name, catpage, 11, img, 1)
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:11,代码来源:watchxxxfree.py
示例18: ListSearch
def ListSearch(url):
html = utils.getHtml(url, '').replace('\n','')
match = re.compile('bookmark">([^<]+)</a></h1>.*?<img src="([^"]+)".*?href="([^"]+)"').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)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:11,代码来源:xxxsorg.py
示例19: XTList
def XTList(url, page=1):
sort = getXTSortMethod()
if re.search('\?', url, re.DOTALL | re.IGNORECASE):
url = url + '&filtre=' + sort + '&display=extract'
else:
url = url + '?filtre=' + sort + '&display=extract'
try:
listhtml = utils.getHtml(url, '')
except:
utils.notify('Oh oh','It looks like this website is down.')
return None
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)
开发者ID:anton40,项目名称:WhiteCream-V0.0.1,代码行数:21,代码来源:xtheatre.py
示例20: Channels
def Channels(url):
listhtml = utils.getHtml(url, '')
match = re.compile('<A href="([^"]+)"[^<]+<[^<]+<img.*?src="([^"]+)" alt="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(listhtml)
for catpage, img, name in match:
name = utils.cleantext(name)
utils.addDir(name, catpage, 341, img, '')
try:
nextp=re.compile('href="(/channels/[^"]+)" title="Next', re.DOTALL | re.IGNORECASE).findall(listhtml)
print "next: ", 'http://www.hdzog.com' + nextp[0]
utils.addDir('Next Page', 'http://www.hdzog.com' + nextp[0], 345,'')
except: pass
xbmcplugin.endOfDirectory(utils.addon_handle)
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:12,代码来源:hdzog.py
注:本文中的resources.lib.utils.cleantext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论