本文整理汇总了Python中resources.lib.util.xml.JenList类的典型用法代码示例。如果您正苦于以下问题:Python JenList类的具体用法?Python JenList怎么用?Python JenList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JenList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: imdbcharttv
def imdbcharttv(url):
xml = ""
url = url.replace("charttv/","chart/")
url = 'http://www.imdb.com/' + url
listhtml = getHtml(url)
match = re.compile(
'<a href="/title/(.+?)/.+?pf_rd_m=.+?pf_rd_i=.+?&ref_=.+?"\n> <img src="(.+?)" width=".+?" height=".+?"/>\n</a>.+?</td>\n.+?<td class="titleColumn">\n.+?\n.+?<a href=".+?"\ntitle=".+?" >(.+?)</a>\n.+?<span class="secondaryInfo">(.+?)</span>',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for imdb, thumbnail, title, year in match:
tmdb_url = 'http://api.themoviedb.org/3/find/' + imdb + '?api_key=30551812602b96050a36103b3de0163b&external_source=imdb_id'
tmdbhtml = requests.get(tmdb_url).content
Poster_path = re.compile(
'"poster_path":"(.+?)".+?"backdrop_path":"(.+?)"',
re.DOTALL).findall(tmdbhtml)
for poster_path, backdrop_path in Poster_path:
name = title + " " + year
year = year.replace("(","").replace(")","")
xml += "<dir>"\
"<title>%s</title>"\
"<meta>"\
"<content>tvshow</content>"\
"<imdb>%s</imdb>"\
"<imdburl>season/%s</imdburl>"\
"<tvdb></tvdb>"\
"<tvshowtitle>%s</tvshowtitle>"\
"<year>%s</year>"\
"</meta>"\
"<link></link>"\
"<thumbnail>https://image.tmdb.org/t/p/w1280/%s</thumbnail>"\
"<fanart>https://image.tmdb.org/t/p/w1280/%s</fanart>"\
"</dir>" % (name, imdb, imdb, title, year, poster_path, backdrop_path)
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例2: showing
def showing(url):
xml = ''
string = url.split()
TheXml,TheCode = string[0],string[1]
TheCode = TheCode.replace("get/","")
TheCode = base64.b64decode(TheCode)
input = ''
keyboard = xbmc.Keyboard(input, '[COLOR red]So Your Wanting The Naughty Bits Are You ?? Get The Tissues At The Ready[/COLOR]')
keyboard.doModal()
if keyboard.isConfirmed():
input = keyboard.getText()
if input == TheCode:
listhtml = getHtml(TheXml)
match = re.compile(
'([^"]+)',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for xmlContent in match:
xml += xmlContent
else:
xml += "<dir>"\
"<title>[COLOR yellow]Wrong Answer, Are you sure your old enough ??[/COLOR]</title>"\
"<thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
"</dir>"
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例3: trakt_season
def trakt_season(slug):
__builtin__.content_type = "episodes"
splitted = slug.replace("trakt_id", "").split(",")
trakt_id = splitted[0]
season = splitted[1]
year = splitted[2]
tvtitle = ",".join(splitted[3:-2])
tmdb = splitted[-2]
imdb = splitted[-1]
url = "https://api.trakt.tv/shows/%s/seasons/%s?extended=full"
url = url % (trakt_id, season)
headers = {
'Content-Type': 'application/json',
'trakt-api-version': '2',
'trakt-api-key': TRAKT_API_KEY
}
xml, __builtin__.content_type = fetch_from_db(url) or (None, None)
if not xml:
__builtin__.content_type = "episodes"
xml = ""
response = requests.get(url, headers=headers).json()
if type(response) == list:
for item in response:
xml += get_episode_xml(item, trakt_id, year, tvtitle, tmdb,
imdb)
xml = remove_non_ascii(xml)
save_to_db((xml, __builtin__.content_type), url)
jenlist = JenList(xml)
display_list(jenlist.get_list(), __builtin__.content_type)
示例4: imdbactors
def imdbactors(url):
xml = ""
url = url.replace("http://www.imdb.com","").replace("actors","list").replace("actor","")
link = 'http://www.imdb.com/' + url
listhtml = getHtml(link)
match = re.compile(
'<img alt=".+?"\nheight="209"\nsrc="(.+?)"\nwidth="140" />\n</a>.+?</div>\n.+?<div class="lister-item-content">\n.+?<h3 class="lister-item-header">\n.+?<span class="lister-item-index unbold text-primary">.+?</span>\n<a href="/name/(.+?)"\n>(.+?)\n</a>',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for thumbnail, imdb, name in match:
thumbnail = thumbnail.replace("@._V1_UY209_CR10,0,140,209_AL_.jpg","@._V1_SY1000_SX800_AL_.jpg")
thumbnail = thumbnail.replace("._V1_UY209_CR5,0,140,209_AL_.jpg","._V1_UX520_CR0,0,520,700_AL_.jpg")
xml += "<dir>"\
"<title>%s</title>"\
"<imdburl>name/%s</imdburl>"\
"<thumbnail>%s</thumbnail>"\
"</dir>" % (name, imdb ,thumbnail)
next_page = re.compile(
'<a class="flat-button lister-page-next next-page" href="(.+?)">\n.+?Next\n.+?</a>',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for url in next_page:
try:
xml += "<dir>"\
"<title>[COLOR dodgerblue]Next Page >>[/COLOR]</title>"\
"<imdburl>actor%s</imdburl>"\
"<thumbnail>https://image.ibb.co/gtsNjw/next.png</thumbnail>"\
"</dir>" % (url)
except:
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例5: open_table
def open_table():
xml = ""
at = Airtable('appJ1nGNe5G1za9fg', 'NHL', api_key='keyikW1exArRfNAWj')
match = at.get_all(maxRecords=700, view='Grid view')
for field in match:
try:
res = field['fields']
name = res['Name']
name = remove_non_ascii(name)
thumbnail = res['thumbnail']
fanart = res['fanart']
link1 = res['link1']
link2 = res['link2']
link3 = res['link3']
time = res['Time']
dsp = time + " - " + name
xml += "<item>"\
"<title>[COLOR darkmagenta]%s[/COLOR]</title>"\
"<thumbnail>%s</thumbnail>"\
"<fanart>%s</fanart>"\
"<link>"\
"<sublink>%s</sublink>"\
"<sublink>%s</sublink>"\
"<sublink>%s</sublink>"\
"</link>"\
"</item>" % (dsp,thumbnail,fanart,link1,link2,link3)
except:
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例6: imdbseason
def imdbseason(url):
xml = ""
url = url.replace("season/","")
imdb = url
url = 'http://www.imdb.com/title/' + imdb
listhtml = getHtml(url)
match = re.compile(
'href="/title/'+imdb+'/episodes.+?season=.+?&ref_=tt_eps_sn_.+?"\n>(.+?)</a>',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for season in match:
episodeURL = 'http://www.imdb.com/title/' + imdb + "/episodes?season=" + season
name = "Season: [COLOR dodgerblue]" + season + "[/COLOR]"
xml += "<dir>"\
"<title>%s</title>"\
"<meta>"\
"<content>season</content>"\
"<imdb>%s</imdb>"\
"<imdburl>theepisode/%s</imdburl>"\
"<tvdb></tvdb>"\
"<tvshowtitle></tvshowtitle>"\
"<year></year>"\
"<season>%s</season>"\
"</meta>"\
"<link></link>"\
"<thumbnail></thumbnail>"\
"<fanart></fanart>"\
"</dir>" % (name, imdb, episodeURL, season)
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例7: imdbactorspage
def imdbactorspage(url):
xml = ""
link = 'http://www.imdb.com/' + url
listhtml = getHtml(link)
match = re.compile(
'<div class="film.+?" id="act.+?">\n<span class="year_column">\n (.+?)\n</span>\n<b><a href="/title/(.+?)/.+?ref_=.+?"\n>(.+?)</a></b>',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for year, imdb, title in match:
name = title + " (" + year + ")"
xml += "<item>"\
"<title>%s</title>"\
"<meta>"\
"<content>movie</content>"\
"<imdb>%s</imdb>"\
"<title>%s</title>"\
"<year>%s</year>"\
"</meta>"\
"<link>"\
"<sublink>search</sublink>"\
"<sublink>searchsd</sublink>"\
"</link>"\
"<thumbnail></thumbnail>"\
"<fanart></fanart>"\
"</item>" % (name, imdb, title, year)
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例8: get_MRUPlayMedia
def get_MRUPlayMedia(url):
xml = ""
url = url.replace('mru_play/', '')
try:
import cookielib, urllib2
cookieJar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar), urllib2.HTTPHandler())
conn = urllib2.Request(url)
connection = opener.open(conn)
f = connection.read()
connection.close()
js = json.loads(f)
for cookie in cookieJar:
token = cookie.value
js = js['videos']
for el in js:
link = 'http:'+el['url']+'|Cookie=video_key='+token
xml += "<item>"\
" <title>%s</title>"\
" <link>%s</link>"\
" <thumbnail>%s</thumbnail>"\
"</item>" % (el['key'],link,addon_icon)
except:
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例9: imdbNextPage
def imdbNextPage(url):
xml = ""
listhtml = getHtml(url)
match = re.compile(
'<img alt=".+?"\nclass="loadlate"\nloadlate="(.+?)"\ndata-tconst="(.+?)"\nheight=".+?"\nsrc=".+?"\nwidth=".+?" />\n</a>.+?</div>\n.+?<div class="lister-item-content">\n<h3 class="lister-item-header">\n.+?<span class="lister-item-index unbold text-primary">.+?</span>\n.+?\n.+?<a href=".+?"\n>(.+?)</a>\n.+?<span class="lister-item-year text-muted unbold">(.+?)</span>',
re.IGNORECASE | re.DOTALL).findall(listhtml)
for thumbnail, imdb, title, year in match:
name = title + " " + year
year = year.replace("(","").replace(")","")
thumbnail = thumbnail.replace("@._V1_UX67_CR0,0,67,98_AL_.jpg","@._V1_SY1000_SX800_AL_.jpg")
xml += "<item>"\
"<title>%s</title>"\
"<meta>"\
"<content>movie</content>"\
"<imdb>%s</imdb>"\
"<title>%s</title>"\
"<year>%s</year>"\
"</meta>"\
"<link>"\
"<sublink>search</sublink>"\
"<sublink>searchsd</sublink>"\
"</link>"\
"<thumbnail>%s</thumbnail>"\
"<fanart></fanart>"\
"</item>" % (name, imdb, title, year, thumbnail)
next_page = re.compile(
'<a href="([^"]+)"\nclass="lister-page-next next-page" ref-marker=adv_nxt>Next »</a>\n.+?</div>\n.+?<br class="clear" />',
re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
xml += "<dir>"\
"<title>[COLOR dodgerblue]Next Page >>[/COLOR]</title>"\
"<imdburl>http://www.imdb.com/search/title%s</imdburl>"\
"<thumbnail>https://image.ibb.co/gtsNjw/next.png</thumbnail>"\
"</dir>" % (next_page)
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例10: get_network
def get_network(url):
xml = ""
last = url.split("/")[-2]
num = url.split("/")[-1]
html = "https://www.tvmaze.com/shows?Show%5Bnetwork_id%5D="+last+"&page="+num
html2= requests.get(html).content
match = re.compile('<div class="card primary grid-x">.+?<a href="(.+?)".+?<img src="(.+?)".+?<a href=".+?">(.+?)</a>',re.DOTALL).findall(html2)
for link, image, name in match:
link = link.split("/")[-2]
thumb = "http:"+image
xml += "<dir>"\
"<title>%s</title>"\
"<thumbnail>%s</thumbnail>"\
"<tvmaze>show/%s/%s</tvmaze>"\
"</dir>" % (name, thumb, name, link)
try:
match2 = re.compile('<ul class="pagination">.+?<li class="current"><a href="(.+?)"',re.DOTALL).findall(html2)[0]
page = match2.split(";")[-1]
page = page.replace("page=","")
page = int(page)
next_page = page+1
xml += "<dir>"\
"<title>[COLOR dodgerblue]Next Page >>[/COLOR]</title>"\
"<tvmaze>network/%s/%s</tvmaze>"\
"<thumbnail>http://www.clker.com/cliparts/a/f/2/d/1298026466992020846arrow-hi.png</thumbnail>"\
"</dir>" % (last, next_page)
except:
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例11: FullMatch_WWE_Replays
def FullMatch_WWE_Replays(url):
url = url.replace('wwe_replay/', '')
page_id = url
url = base_full_match % ((json_cat_url % (wwe_info['per_page'], wwe_info['category'], page_id)))
try:
xml = ""
response = requests.get(url,headers).json()
try:
if 'invalid' in response['code']:
return
except:
pass
for post in response:
title = clean_titles(post['title']['rendered'])
if not 'wwe' in title.lower():
continue
content = post['content']['rendered']
description = decodeEntities(re.compile('<h2>(.+?)</h2>').findall(content)[0])
try:
icon_js = requests.get(post['_links']['wp:featuredmedia'][0]['href'].replace('\\', ''))
icon_js = json.loads(icon_js.text)
icon = str(icon_js['guid']['rendered'])
except:
icon = addon_icon
sources = dom_parser.parseDOM(str(content), 'iframe', ret='src')
if len(sources) > 0:
xml += "<item>"\
" <title>%s</title>"\
" <meta>"\
" <summary>%s</summary>"\
" </meta>"\
" <link>" % (title,description)
for source in sources:
if not 'http' in source:
source = 'http:%s' % source
host = urlparse.urlparse(source).netloc.capitalize()
xml += " <sublink>%s(%s)</sublink>" % (source,host)
xml += " </link>"\
" <thumbnail>%s</thumbnail>"\
"</item>" % (icon)
except:
pass
try:
xml += "<dir>"\
" <title>Next Page >></title>"\
" <fullmatch>wwe_replay/%s</fullmatch>"\
"</dir>" % (str(int(page_id)+1))
except:
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例12: testings
def testings(file_name="testings.xml"):
"""
parses local xml file as a jen list
:param str file_name: local file name to parse
:return: list of jen items
:rtype: list[dict[str,str]]
"""
profile_path = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')).decode('utf-8')
test_file = xbmcvfs.File(os.path.join(profile_path, file_name))
xml = test_file.read()
test_file.close()
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例13: get_shows
def get_shows(url):
xml = ""
try:
url = "https://www.arconaitv.us/"
headers = {'User_Agent':User_Agent}
html = requests.get(url,headers=headers).content
block2 = re.compile('<div class="content">(.+?)<div class="stream-nav shows" id="shows">',re.DOTALL).findall(html)
match2 = re.compile('href=(.+?) title=(.+?)<img src=(.+?) alt=(.+?) />',re.DOTALL).findall(str(block2))
for link2,title2,image2,name2 in match2:
name2 = name2.replace("\\'", "")
link2 = link2.replace("\\'", "")
image2 = image2.replace("\\'", "")
title2 = title2.replace("\\'", "")
title2 = title2.replace(" class=poster-link>","")
image2 = "https://www.arconaitv.us"+image2
link2 = "plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url=https://www.arconaitv.us/"+link2
if not name2:
xml += "<plugin>"\
"<title>%s</title>"\
"<link>"\
"<sublink>%s</sublink>"\
"</link>"\
"<thumbnail>%s</thumbnail>"\
"</plugin>" % (title2,link2,image2)
else:
xml += "<plugin>"\
"<title>%s</title>"\
"<link>"\
"<sublink>%s</sublink>"\
"</link>"\
"<thumbnail>%s</thumbnail>"\
"</plugin>" % (name2,link2,image2)
block3 = re.compile('<div class="stream-nav movies" id="movies">(.+?)<div class="donation-form" id="donate">',re.DOTALL).findall(html)
match3 = re.compile('href=(.+?) title=(.+?)>',re.DOTALL).findall(str(block3))
for link3,name3 in match3:
name3 = name3.replace("\\'", "")
link3 = link3.replace("\\'", "")
link3 = "plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url=https://www.arconaitv.us/"+link3
image3 = "http://www.userlogos.org/files/logos/nickbyalongshot/film.png"
xml += "<plugin>"\
"<title>%s</title>"\
"<link>"\
"<sublink>%s</sublink>"\
"</link>"\
"<thumbnail>%s</thumbnail>"\
"</plugin>" % (name3,link3,image3)
except:
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())
示例14: get_list
def get_list(url):
"""display jen list"""
global content_type
jen_list = JenList(url)
if not jen_list:
koding.dolog(_("returned empty for ") + url)
items = jen_list.get_list()
content = jen_list.get_content_type()
if items == []:
return False
if content:
content_type = content
display_list(items, content_type)
return True
示例15: get_NHLCupArchives
def get_NHLCupArchives(url):
xml = ""
url = url.replace('sh_nhl_sc/', '')
offset = url.split('/')[0]
account = url.split('/')[1].decode('base64')
url = base_mail_url % (account, offset, per_page['nhl'])
if offset == '1':
offset = '0'
try:
response = requests.get(url).content
results = json.loads(response)
results = results[2]['items']
for item in results:
try:
title = item['Title']
if 'true' in nhl_tonight:
pass
else:
if 'nhl tonight' in title.lower():
continue
meta_url = item['MetaUrl']
icon = item['ImageUrlP']
title = clean_mru_title(title)
xml += "<item>"\
" <title>%s</title>"\
" <sportshub>mru_play/%s</sportshub>"\
" <thumbnail>%s</thumbnail>"\
"</item>" % (title,meta_url,icon)
except:
failure = traceback.format_exc()
xbmcgui.Dialog().textviewer('Item Exception',str(failure))
pass
except:
failure = traceback.format_exc()
xbmcgui.Dialog().textviewer('a',str(failure))
pass
try:
xml += "<dir>"\
" <title>Next Page >></title>"\
" <sportshub>sh_nhl_sc/%s/%s</sportshub>"\
"</dir>" % (str(int(offset)+int(per_page['nhl'])),account.encode('base64'))
except:
failure = traceback.format_exc()
xbmcgui.Dialog().textviewer('a',str(failure))
pass
jenlist = JenList(xml)
display_list(jenlist.get_list(), jenlist.get_content_type())