本文整理汇总了Python中pulsar.provider.notify函数的典型用法代码示例。如果您正苦于以下问题:Python notify函数的具体用法?Python notify怎么用?Python notify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了notify函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: extract_torrents
def extract_torrents(data):
try:
filters.information() # print filters settings
data = common.clean_html(data)
size = re.findall('class="tac">[0-9.]*[0-9]..B', data) # list the size
size = [s.replace('class="tac">','') for s in size]
#seeds = re.findall('class="tac green" style="width: 5%;">(.*?)<', data)
#peers = re.findall('class="tac red" style="width: 5%;">(.*?)<', data)
cont = 0
results = []
for cm, magnet in enumerate(re.findall(r'magnet:\?[^\'"\s<>\[\]]+', data)):
info_magnet = common.Magnet(magnet)
name = re.search('dn=(.*?)&tr=',magnet).group(1) # find name in the magnet
name = size[cm] + ' - ' + unquote_plus(name).replace('.',' ').title() + ' - ' + settings.name_provider
if filters.verify(name,size[cm]):
results.append({"name": name, "uri": magnet, "info_hash": info_magnet.hash}) #
cont+= 1
else:
provider.log.warning(filters.reason)
if cont == settings.max_magnets: # limit magnets
break
provider.log.info('>>>>>>' + str(cont) + ' torrents sent to Pulsar<<<<<<<')
return results
except:
provider.log.error('>>>>>>>ERROR parsing data<<<<<<<')
provider.notify(message='ERROR parsing data', header=None, time=5000, image=settings.icon)
开发者ID:entr,项目名称:script.pulsar.arenabg-mc,代码行数:26,代码来源:main.py
示例2: extract_torrents
def extract_torrents(data):
try:
filters.information() # print filters settings
data = common.clean_html(data)
rows = re.findall(
"fa fa-download(.*?)</td>(.*?)</td>(.*?)</td>(.*?)</td>(.*?)</td>(.*?)</td>(.*?)</td>(.*?)</tr>", data, re.S
)
size = [s[2].replace("\n <td>", "") for s in rows]
# seeds = [s[5].replace('\n <td>', '') for s in rows]
# peers = [s[6].replace('\n <td>', '') for s in rows]
lname = re.findall('torrent-filename">(.*?)>(.*?)<', data, re.S) # list the name
cont = 0
results = []
for cm, magnet in enumerate(re.findall(r'magnet:\?[^\'"\s<>\[\]]+', data)):
info_magnet = common.Magnet(magnet)
name = (
size[cm]
+ "B - "
+ unquote_plus(lname[cm][1]).replace(".", " ").title()
+ " - "
+ settings.name_provider
)
if filters.verify(name, size[cm]):
results.append({"name": name, "uri": magnet, "info_hash": info_magnet.hash}) # return le torrent
cont += 1
else:
provider.log.warning(filters.reason)
if cont == settings.max_magnets: # limit magnets
break
provider.log.info(">>>>>>" + str(cont) + " torrents sent to Pulsar<<<<<<<")
return results
except:
provider.log.error(">>>>>>>ERROR parsing data<<<<<<<")
provider.notify(message="ERROR parsing data", header=None, time=5000, image=settings.icon)
开发者ID:kusik,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:34,代码来源:main.py
示例3: extract_torrents
def extract_torrents(data):
try:
filters.information() # print filters settings
data = common.clean_html(data)
data = data[data.find('Latest Top Release'):] # short the result
size = re.findall('class=ts>(.*?)B<', data) # list the size
cont = 0
results = []
for cm, (torrent, name) in enumerate(re.findall('/torrent/(.*?)/(.*?).html', data)):
torrent = settings.url + '/tor/' + torrent + '.torrent'
name = size[cm] + 'B' + ' - ' + name.replace('-', ' ').title() + ' - ' + settings.name_provider # find
# name in the torrent
if filters.verify(name, size[cm]):
results.append({"name": name, "uri": torrent}) # return le torrent
cont += 1
else:
provider.log.warning(filters.reason)
if cont == settings.max_magnets: # limit magnets
break
provider.log.info('>>>>>>' + str(cont) + ' torrents sent to Pulsar<<<<<<<')
return results
except:
provider.log.error('>>>>>>>ERROR parsing data<<<<<<<')
provider.notify(message='ERROR parsing data', header=None, time=5000, image=settings.icon)
return []
开发者ID:Inter95,项目名称:tutvguia,代码行数:25,代码来源:main.py
示例4: extract_torrents
def extract_torrents(data):
try:
filters.information() # print filters settings
data = common.clean_html(data)
value_search = 'total <b style="color: #ff0000;">0</b> torrents found on your search query' in data
size = re.findall('</span></td><td>(.*?)B</td>', data) # list the size
cont = 0
results = []
for cm, torrent in enumerate(re.findall(r'/torrent_download(.*?).torrent', data)):
name = torrent[len(re.search("/*[0-9]*/",torrent).group()):]
name = size[cm].replace(' ',' ') + 'B' + ' - ' + unquote_plus(name) + ' - ' + settings.name_provider #find name in the torrent
torrent = settings.url + '/download' + torrent + '.torrent' # torrent to send to Pulsar
if filters.verify(name, size[cm].replace(' ',' ')) and not value_search:
results.append({"name": name, "uri": torrent}) # return le torrent
cont += 1
else:
provider.log.warning(filters.reason)
if cont == settings.max_magnets: # limit magnets
break
provider.log.info('>>>>>>' + str(cont) + ' torrents sent to Pulsar<<<<<<<')
return results
except:
provider.log.error('>>>>>>>ERROR parsing data<<<<<<<')
provider.notify(message='ERROR parsing data', header=None, time=5000, image=settings.icon)
return []
开发者ID:assli100,项目名称:kodi-openelec,代码行数:25,代码来源:main.py
示例5: search_episode
def search_episode(info):
title= ' S%02dE%02d' % (info['episode'],info['season'])
if settings.time_noti > 0 : provider.notify(message='Searching: ' + info['title'].encode("utf-8").title() +
title +'...', header=None, time=settings.time_noti, image=settings.icon)
url_search = "%s/show/%s" % (settings.url ,info['imdb_id'])
provider.log.info(url_search)
response = provider.GET(url_search)
results=[]
if str(response.data)!='':
filters.use_TV()
filters.information()
items = provider.parse_json(response.data)
for episode in items['episodes']:
if (episode['episode']==info['episode'] and episode['season']==info['season']):
for resolution in episode['torrents']:
resASCII =resolution.encode('utf-8')
name = resASCII + ' - ' + items['title'] + ' - ' + episode['title'].encode('utf-8') + ' - ' + 'S%02dE%02d'% (info['season'], info['episode'])
if filters.included(resASCII, filters.quality_allow) and not filters.included(resASCII, filters.quality_deny):
res_val=values3[resASCII]
magnet = episode['torrents'][resolution]['url']
info_magnet = common.Magnet(magnet)
results.append({'name': name + ' - ' + settings.name_provider,
'uri': magnet})
else:
provider.log.warning(name + ' ***Blocked File by Keyword, Name or Size***')
return results
开发者ID:JesseJams,项目名称:script.pulsar.eztv-mc,代码行数:26,代码来源:main.py
示例6: extract_torrents
def extract_torrents(data):
try:
filters.information() # print filters settings
data = common.clean_html(data)
size = re.findall('Size (.*?)B', data) # list the size
seedsPeers = re.findall('<td align="right">(.*?)</td>', data) # list the size
seeds = seedsPeers[0:][::2]
peers = seedsPeers[1:][::2]
cont = 0
results = []
for cm, magnet in enumerate(re.findall(r'magnet:\?[^\'"\s<>\[\]]+', data)):
info = common.Magnet(magnet)
name = size[cm].replace(' ',' ') + 'B' + ' - ' + info.name + ' - ' + settings.name_provider
if filters.verify(name, size[cm].replace(' ', ' ')):
results.append({"name": name, "uri": magnet, "info_hash": info.hash,
"size": common.size_int(size[cm].replace(' ', ' ')),
"seeds": int(seeds[cm]), "peers": int(peers[cm]),
"language": settings.language}) # return le torrent
cont += 1
else:
provider.log.warning(filters.reason)
if cont == settings.max_magnets: # limit magnets
break
provider.log.info('>>>>>>' + str(cont) + ' torrents sent to Pulsar<<<<<<<')
return results
except:
provider.log.error('>>>>>>>ERROR parsing data<<<<<<<')
provider.notify(message='ERROR parsing data', header=None, time=5000, image=settings.icon)
开发者ID:Stasevi4,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:28,代码来源:main.py
示例7: search_episode
def search_episode(info):
info['title'] = common.exception(info['title'])
if info['absolute_number'] == 0:
query = info['title'] + ' %sx%02d'% (info['season'], info['episode']) # define query
else:
query = info['title'] + ' %02d' % info['absolute_number'] # define query anime
query = query.encode('utf-8')
filters.title = query
if settings.time_noti > 0: provider.notify(message="Searching: " + query.title() + '...', header=None, time=settings.time_noti, image=settings.icon)
query = provider.quote_plus(query)
url_search = "%s/buscar.php?busqueda=%s" % (settings.url,query)
provider.log.info(url_search)
if browser.open(url_search):
results = []
data = browser.content
search_serie = re.search('/series/(.*?)/" title', data)
if search_serie is not None:
url_search = '%s/series/%s/' % (settings.url, search_serie.group(1))
browser.open(url_search)
data = browser.content
cont = 0
lname = re.search(filters.title.replace(' ', '.') + '(.*?).torrent', data, re.IGNORECASE)
if lname is not None:
torrent = '%s/torrents_tor/%s' % (settings.url, lname.group())
name = lname.group().replace('.torrent', '') + ' S%02dE%02d'% (info['season'], info['episode']) + ' - ' + settings.name_provider #find name in the torrent
results.append({"name": name, "uri": torrent, "seeds": 10000, "peers": 5000}) # return le torrent
cont = 1
provider.log.info('>>>>>> ' + str(cont) + ' torrents sent to Pulsar<<<<<<<')
else:
provider.log.error('>>>>>>>%s<<<<<<<' % browser.status)
provider.notify(message=browser.status, header=None, time=5000, image=settings.icon)
return results
开发者ID:Stasevi4,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:32,代码来源:main.py
示例8: extract_torrents
def extract_torrents(data):
try:
filters.information() # print filters settings
data = common.clean_html(data).replace('<td data-href="magnet:?', '')
lname = re.findall('<td data-href="/torrent/(.*?)/(.*?)"', data) # list the size
size = re.findall('<td class="size_td">(.*?)</td>', data) # list the size
seeds = re.findall('<td class="seed_td">(.*?)</td>', data) # list the seeds
peers = re.findall('<td class="leech_td">(.*?)</td>', data) # list the seeds
cont = 0
results = []
for cm, magnet in enumerate(re.findall(r'magnet:\?[^\'"\s<>\[\]]+', data)):
info_magnet = common.Magnet(magnet)
name = size[cm] + ' - ' + lname[cm][1].replace('-', ' ') + ' - ' + settings.name_provider #find name in the torrent
if filters.verify(name,size[cm]):
results.append({"name": name, "uri": magnet, "info_hash": info_magnet.hash,
"size": common.size_int(size[cm]), "seeds": int(seeds[cm]), "peers": int(peers[cm]),
"language": settings.language
}) # return le torrent
cont += 1
else:
provider.log.warning(filters.reason)
if cont == settings.max_magnets: # limit magnets
break
provider.log.info('>>>>>>' + str(cont) + ' torrents sent to Pulsar<<<<<<<')
return results
except:
provider.log.error('>>>>>>>ERROR parsing data<<<<<<<')
provider.notify(message='ERROR parsing data', header=None, time=5000, image=settings.icon)
开发者ID:Stasevi4,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:28,代码来源:main.py
示例9: search_movie
def search_movie(info):
filters.use_movie()
if settings.time_noti > 0: provider.notify(message='Searching: ' + info['title'].title().encode("utf-8") + '...', header=None,
time=settings.time_noti, image=settings.icon)
url_search = "%s/v2/list_movies.json?query_term=%s" % (settings.url, info['imdb_id'])
provider.log.info(url_search)
response = provider.GET(url_search)
return extract_magnets_json(response.data)
开发者ID:Stasevi4,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:8,代码来源:main.py
示例10: search
def search(query):
query += ' ' + extra
if time_noti > 0:
provider.notify(message='Searching: ' + query + '...', header=None, time=1500, image=icon)
url_search = "%s/search/0/0/000/4/%s" % (url, query.replace(' ', '%20')) # search string
provider.log.info(url_search)
response = provider.GET(url_search)
if response == (None, None):
provider.log.error('404 Page not found')
return []
else:
return extract_torrents(response.data)
开发者ID:Stasevi4,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:12,代码来源:main.py
示例11: search
def search(query):
query += " " + settings.extra # add the extra information
query = filters.type_filtering(query, "+") # check type filter and set-up filters.title
url_search = "%s/search/?search=%s&srt=seeds&order=desc" % (settings.url, query) # change in each provider
provider.log.info(url_search)
if browser.open(url_search):
results = extract_torrents(browser.content)
else:
provider.log.error(">>>>>>>%s<<<<<<<" % browser.status)
provider.notify(message=browser.status, header=None, time=5000, image=settings.icon)
results = []
return results
开发者ID:kusik,项目名称:Unofficial-Pulsar-Repo-Mirror,代码行数:12,代码来源:main.py
示例12: search
def search(query):
query += ' ' + settings.extra # add the extra information
query = filters.type_filtering(query, '+') # check type filter and set-up filters.title
url_search = "%s/index.php?page=torrents&search=%s&category=0&options=0&active=1&order=5&by=2" % (settings.url,query)
provider.log.info(url_search)
if browser.open(url_search):
results = extract_torrents(browser.content)
else:
provider.log.error('>>>>>>>%s<<<<<<<' % browser.status)
provider.notify(message=browser.status, header=None, time=5000, image=settings.icon)
results = []
return results
开发者ID:Inter95,项目名称:tutvguia,代码行数:12,代码来源:main.py
示例13: search_movie
def search_movie(info):
filters.use_movie()
if settings.time_noti > 0: provider.notify(message='Searching: ' + info['title'].title().encode("utf-8") + '...',
header=None,
time=settings.time_noti, image=settings.icon)
id = findID(info["title"], info["year"])
if id == "0":
return []
else:
url_search = "%s/movies/%s" % (settings.url, id)
provider.log.info(url_search)
response = provider.GET(url_search)
return extract_magnets_json(response.data)
开发者ID:Inter95,项目名称:tutvguia,代码行数:13,代码来源:main.py
注:本文中的pulsar.provider.notify函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论