コード例 #1
0
ファイル: tools.py プロジェクト: CYBERxNUKE/xbmc-addon
def password_handler(url):
    adult_xml = ''
    try:
        the_setting = this_addon.getSetting('adult_stuff')
        if the_setting == None or the_setting == '':
            the_setting = 'false'
            xbmcaddon.Addon().setSetting('adult_stuff', str(the_setting))
        if the_setting == 'false':
            adult_xml += "<item>"\
                    "    <title>[COLOR yellow]This menu is not enabled[/COLOR]</title>"\
                    "    <heading></heading>"\
                    "    <thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
                    "</item>"
            jenlist = JenList(adult_xml)
            display_list(jenlist.get_list(), jenlist.get_content_type())
            return
    except:
        return

    sep_list = url.decode('base64').split('|')
    dec_pass = sep_list[0]
    xml_loc = sep_list[1]
    expires_at = this_addon.getSetting('PASS_EXIRES_AT')
    if time.time() > expires_at or expires_at == '':
        input = ''
        keyboard = xbmc.Keyboard(input, '[COLOR red]Are you worthy?[/COLOR]')
        keyboard.doModal()
        if keyboard.isConfirmed():
            input = keyboard.getText()
        if input == dec_pass:
            expires_at = time.time() + 60 * 60 * int(SESSION_HOURS)
            this_addon.setSetting("PASS_EXIRES_AT", str(expires_at))
            if 'http' in xml_loc:
                adult_xml = requests.get(xml_loc).content
            else:
                import xbmcvfs
                xml_loc = xml_loc.replace('file://', '')
                xml_file = xbmcvfs.File(os.path.join(addon_path, "xml", xml_loc))
                adult_xml = xml_file.read()
                xml_file.close()
        else:
            adult_xml += "<dir>"\
                    "    <title>[COLOR yellow]Wrong Answer! You are not worthy[/COLOR]</title>"\
                    "    <thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
                    "</dir>"
    else:
        if 'http' in xml_loc:
            adult_xml = requests.get(xml_loc).content
        else:
            import xbmcvfs
            xml_loc = xml_loc.replace('file://', '')
            xml_file = xbmcvfs.File(os.path.join(addon_path, "xml", xml_loc))
            adult_xml = xml_file.read()
            xml_file.close()
    jenlist = JenList(adult_xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #2
0
ファイル: tvmaze.py プロジェクト: vphuc81/MyRepository
def get_country(url):
    xml = ""
    if "all" in url:
        html = "https://www.tvmaze.com/networks" 
        html2 = requests.get(html).content
        block = re.compile('<option value=""></option>(.+?)</select>',re.DOTALL).findall(html2)
        match = re.compile('<option value="(.+?)">(.+?)</option>',re.DOTALL).findall(str(block))
        for number, country in match:
            xml += "<dir>"\
                   "<title>%s</title>"\
                   "<tvmaze>country/%s/1</tvmaze>"\
                   "</dir>" % (country, country)
                   
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
    else:
        last = url.split("/")[-2]
        num = url.split("/")[-1]
        html = "https://www.tvmaze.com/networks" 
        html2 = requests.get(html).content
        block = re.compile('<option value=""></option>(.+?)</select>',re.DOTALL).findall(html2)
        match = re.compile('<option value="(.+?)">(.+?)</option>',re.DOTALL).findall(str(block))
        for number, country in match:
            if country == last:
                html3 = "https://www.tvmaze.com/networks?Network%5Bcountry_enum%5D="+number+"&Network%5Bsort%5D=1&page="+num
                html4 = requests.get(html3).content 
                match = re.compile('<div class="card primary grid-x">.+?<a href="(.+?)".+?<img src="(.+?)".+?<a href=".+?">(.+?)</a>',re.DOTALL).findall(html4)
                for link, image, name in match:
                    link = link.split("/")[-2]
                    thumb = "http:"+image
                    xml += "<dir>"\
                           "<title>%s</title>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<tvmaze>network/%s/1</tvmaze>"\
                           "</dir>" % (name, thumb,link)
                try:
                    match2 = re.compile('<ul class="pagination">.+?<li class="current"><a href="(.+?)"',re.DOTALL).findall(html4)[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>country/%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()) 
コード例 #3
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
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 &#187;</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())
コード例 #4
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
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
0
ファイル: trakt.py プロジェクト: Shepo6/Shepo
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)
コード例 #6
0
ファイル: password.py プロジェクト: vphuc81/MyRepository
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())
コード例 #7
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
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())
コード例 #8
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
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())
コード例 #9
0
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())    
コード例 #10
0
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())
コード例 #11
0
ファイル: tvmaze.py プロジェクト: vphuc81/MyRepository
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()) 
コード例 #12
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
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&nbsp;(.+?)\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())	
コード例 #13
0
ファイル: fmtv.py プロジェクト: CYBERxNUKE/xbmc-addon
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())
コード例 #14
0
ファイル: testings.py プロジェクト: vphuc81/MyRepository
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())
コード例 #15
0
ファイル: arconaitv.py プロジェクト: vphuc81/MyRepository
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&amp;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&amp;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()) 
コード例 #16
0
ファイル: default.py プロジェクト: CYBERxNUKE/xbmc-addon
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
コード例 #17
0
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())
コード例 #18
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
def imdbuser(url):
	xml = ""
	link = 'http://www.imdb.com/' + url
	listhtml = getHtml(link)
	match = re.compile(
			'<a class="list-name" href="(.+?)">(.+?)</a>', 
			re.IGNORECASE | re.DOTALL).findall(listhtml)
	for url, name in match:
		xml += "<dir>"\
			   "<title>%s</title>"\
			   "<imdburl>%s</imdburl>"\
			   "<thumbnail>https://image.ibb.co/fR6AOm/download.jpg</thumbnail>"\
			   "</dir>" % (name, url)
	jenlist = JenList(xml)
	display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #19
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
def imdbKeywords(url):
	xml = ""
	listhtml = getHtml(url)
	match = re.compile(
			'<a href="/keyword/(.+?)/.+?ref_=fn_kw_kw_.+?" >.+?</a>(.+?)</td>', 
			re.IGNORECASE | re.DOTALL).findall(listhtml)
	for keywords, count in match:
			name = keywords + count
			xml += "<dir>"\
				   "<title>%s</title>"\
				   "<imdburl>keyword/%s</imdburl>"\
				   "<thumbnail></thumbnail>"\
				   "</dir>" % (name, keywords)	
	jenlist = JenList(xml)
	display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #20
0
def get_NBAReplayHD(url):
    xml = ""
    url = url.replace('nbareplayhd/', '') # Strip our category tag off.
    cat_item = url.split('/')
    if cat_item[1] == None or cat_item[1] == '':
        cat_item[1] = '1'
    orig_cat  = cat_item[0]
    orig_page = cat_item[1]
    url = urlparse.urljoin(archives['nbareplayhd'], (json_cat_url % (per_page['nba'], cat_item[0], cat_item[1]))) 
    try:
        response = requests.get(url).content
        results = re.compile('"id":(.+?),',re.DOTALL).findall(response)
        count = 0
        for post_id in results:
            count += 1
            try:
                url = urlparse.urljoin(archives['nbareplayhd'], ('/wp-json/wp/v2/posts/%s' % (post_id)))
                page = requests.get(url).content
                page = page.replace('\\','')
                try:
                    src = 'http:' + re.compile('src="(.+?)"',re.DOTALL).findall(page)[0]
                except:
                    continue

                title = re.compile('"title".+?"rendered":"(.+?)"',re.DOTALL).findall(page)[0]
                title = remove_non_ascii(title)
                xml += "<item>"\
                       "    <title>%s</title>"\
                       "    <link>%s</link>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "</item>" % (title,src,addon_icon)
            except:
                pass
    except:
        pass

    try:
        if count == int(per_page['nba']):
            xml += "<dir>"\
                   "    <title>Next Page >></title>"\
                   "    <sportshub>nbareplayhd/%s/%s</sportshub>"\
                   "</dir>" % (orig_cat,str((int(orig_page)+1)))
    except:
        pass

    if count > 0:
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #21
0
ファイル: tmdb.py プロジェクト: Shepo6/Shepo
def tmdb_tv_show(url):
    xml = fetch_from_db(url)
    if not xml:
        xml = ""
        splitted = url.replace("tmdb_id", "").split(",")
        tmdb_id = splitted[0]
        year = splitted[1]
        tvtitle = ",".join(splitted[2:])
        response = tmdbsimple.TV(tmdb_id).info()
        seasons = response["seasons"]
        xml = ""
        for season in seasons:
            xml += get_season_xml(season, tmdb_id, year, tvtitle)
        save_to_db(xml, url)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #22
0
ファイル: tmdb.py プロジェクト: Shepo6/Shepo
def tmdb_season(url):
    xml = fetch_from_db(url)
    if not xml:
        xml = ""
        splitted = url.replace("tmdb_id", "").split(",")
        tmdb_id = splitted[0]
        season = splitted[1]
        year = splitted[2]
        tvtitle = ",".join(splitted[3:])
        response = tmdbsimple.TV_Seasons(tmdb_id, season).info()
        episodes = response["episodes"]
        xml = ""
        for episode in episodes:
            xml += get_episode_xml(episode, tmdb_id, year, tvtitle)
        save_to_db(xml, url)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #23
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
def imdbBothSearch(url):
	xml = ""
	listhtml = getHtml(url)
	match = re.compile(
			'<img src="(.+?)" /></a> </td> <td class="result_text"> <a href="/title/(.+?)/.+?ref_=fn_al_tt_.+?" >(.+?)</a>(.+?)</td>', 
			re.IGNORECASE | re.DOTALL).findall(listhtml)
	for thumbnail, imdb, 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":"(.+?)"', 
							re.DOTALL).findall(tmdbhtml)
			Backdrop_path = re.compile(
							'"backdrop_path":"(.+?)"', 
							re.DOTALL).findall(tmdbhtml)
			for poster_path in Poster_path:
				for backdrop_path in Backdrop_path:
					if not 'Series' in year:
						year = year.split(')', 1)[0]
						name = title + " " + year + ')'
						year = year.replace("(","").replace(")","")
						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>https://image.tmdb.org/t/p/w1280/%s</thumbnail>"\
								"<fanart>https://image.tmdb.org/t/p/w1280/%s</fanart>"\
								"</item>" % (name, imdb, title, year, poster_path, backdrop_path)
					else:
						name = title + " " + year
						xml += "<dir>"\
							   "<title>%s</title>"\
							   "<imdburl>season/%s</imdburl>"\
							   "<thumbnail>https://image.tmdb.org/t/p/w1280/%s</thumbnail>"\
							   "<fanart>https://image.tmdb.org/t/p/w1280/%s</fanart>"\
							   "</dir>" % (name, imdb, poster_path, backdrop_path)	
	jenlist = JenList(xml)
	display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #24
0
ファイル: m3u.py プロジェクト: Shepo6/Shepo
def m3u(url):
    xml = ""
    if not xml:
        xml = ""
        if '.m3u' in url:
            listhtml = getHtml(url)
            match = re.compile('#EXTINF:.+?,(.+?)\n([^"]+)\n',
                               re.IGNORECASE | re.DOTALL).findall(listhtml)
            for name, url in match:
                name = name
                url = url
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<link>%s</link>"\
                       "<thumbnail></thumbnail>"\
                       "</item>" % (name, url)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #25
0
ファイル: tvmaze.py プロジェクト: vphuc81/MyRepository
def get_season(url):
    xml = "" 
    sea_num = url.split("/")[-1]
    if len(sea_num)==1:
        sea_num = "0"+sea_num
    tmdb_id = url.split("/")[-2]
    tvdb = url.split("/")[-3]
    imdb = url.split("/")[-4]
    tv_title = url.split("/")[-6]
    fanart = url.split("/")[-5]
    tmdb_fanart = "https://image.tmdb.org/t/p/original/"+str(fanart)
    html = "https://api.themoviedb.org/3/tv/%s/season/%s?api_key=%s&language=en-US" % (tmdb_id, sea_num, TMDB_api_key)
    html = requests.get(html).json()
    eps = html['episodes']
    for episodes in eps:
        thumb = episodes['still_path']
        thumb = "https://image.tmdb.org/t/p/original"+str(thumb)
        title = episodes['name']
        air_date = episodes['air_date']
        year = air_date.split("-")[0]
        episode_num = episodes['episode_number']
        xml += "<item>"\
              "<title>%s</title>"\
              "<meta>"\
              "<imdb>%s</imdb>"\
              "<tvdb>%s</tvdb>"\
              "<content>episode</content>"\
              "<tvshowtitle>%s</tvshowtitle>"\
              "<year>%s</year>"\
              "<premiered></premiered>"\
              "<season>%s</season>"\
              "<episode>%s</episode>"\
              "</meta>"\
              "<link>"\
              "<sublink>search</sublink>"\
              "<sublink>searchsd</sublink>"\
              "</link>"\
              "<thumbnail>%s</thumbnail>"\
              "<fanart>%s</fanart>"\
              "</item>" % (title, imdb, tvdb, tv_title, year, sea_num, episode_num, thumb, tmdb_fanart) 

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #26
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
def imdbyears(url):
	xml = ""
	url = url.replace("years/","")
	url = 'http://www.imdb.com/search/title?year=' + url + '&title_type=feature'
	listhtml = getHtml(url)
	match = re.compile(
			'<img alt=".+?"\nclass="loadlate"\nloadlate="(.+?)"\ndata-tconst="(.+?)"\nheight="98"\nsrc=".+?"\nwidth="67" />\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:
		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(
						'"backdrop_path":"(.+?)".+?"overview":".+?","poster_path":"(.+?)"}', 
						re.DOTALL).findall(tmdbhtml)
		for backdrop_path, poster_path in Poster_path:
			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>https://image.tmdb.org/t/p/w1280/%s</thumbnail>"\
					"<fanart>https://image.tmdb.org/t/p/w1280/%s</fanart>"\
					"</item>" % (name, imdb, title, year, poster_path, backdrop_path)
	next_page = re.compile(
				'<a href="([^"]+)"\nclass="lister-page-next next-page" ref-marker=adv_nxt>Next &#187;</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())
コード例 #27
0
ファイル: air_table.py プロジェクト: vphuc81/MyRepository
def new_releases():
    xml = ""
    at = Airtable('apppx7NENxSaqMkM5', 'Sports_channels', api_key='keyOHaxsTGzHU9EEh')
    match = at.get_all(maxRecords=700, sort=['channel'])
    results = re.compile("fanart': u'(.+?)'.+?link': u'(.+?)'.+?thumbnail': u'(.+?)'.+?channel': u'(.+?)'.+?summary': u'(.+?)'",re.DOTALL).findall(str(match))
    for fanart,link,thumbnail,channel,summary in results:
        if "plugin" in link:

            xml += "<plugin>"\
                   "<title>%s</title>"\
                   "<meta>"\
                   "<content>movie</content>"\
                   "<imdb></imdb>"\
                   "<title>%s</title>"\
                   "<year></year>"\
                   "<thumbnail>%s</thumbnail>"\
                   "<fanart>%s</fanart>"\
                   "<summary>%s</summary>"\
                   "</meta>"\
                   "<link>"\
                   "<sublink>%s</sublink>"\
                   "</link>"\
                   "</plugin>" % (channel,channel,thumbnail,fanart,summary,link)
                
        else:
            xml +=  "<item>"\
                    "<title>%s</title>"\
                    "<meta>"\
                    "<content>movie</content>"\
                    "<imdb></imdb>"\
                    "<title>%s</title>"\
                    "<year></year>"\
                    "<thumbnail>%s</thumbnail>"\
                    "<fanart>%s</fanart>"\
                    "<summary>%s</summary>"\
                    "</meta>"\
                    "<link>"\
                    "<sublink>%s</sublink>"\
                    "</link>"\
                    "</item>" % (channel,channel,thumbnail,fanart,summary,link)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #28
0
ファイル: imdb.py プロジェクト: Shepo6/Shepo
def imdbseries(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:
		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)
	try:
		next_page = re.compile(
					'<a href="([^"]+)"\nclass="lister-page-next next-page" ref-marker=adv_nxt>Next &#187;</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)
	except:
		pass
	jenlist = JenList(xml)
	display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #29
0
ファイル: default.py プロジェクト: CYBERxNUKE/xbmc-addon
def all_episodes(url):
    global content_type
    import pickle
    import xbmcgui
    season_urls = pickle.loads(url)
    result_items = []
    dialog = xbmcgui.DialogProgress()
    dialog.create(addon_name, _("Loading items"))
    num_urls = len(season_urls)
    for index, season_url in enumerate(season_urls):
        if dialog.iscanceled():
            break
        percent = ((index + 1) * 100) / num_urls
        dialog.update(percent, _("processing lists"), _("%s of %s") % (
            index + 1,
            num_urls))

        jen_list = JenList(season_url)
        result_items.extend(jen_list.get_list(skip_dialog=True))
    content_type = "episodes"
    display_list(result_items, "episodes")
コード例 #30
0
def get_MLBArchives(url):
    xml = ""
    url = url.replace('sh_mlb/', '')
    offset  = url.split('/')[0]
    account = url.split('/')[1].decode('base64')
    url = base_mail_url % (account, offset, per_page['mlb'])
    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']
                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:
                continue
    except:
        pass

    try:
        xml += "<dir>"\
               "    <title>Next Page >></title>"\
               "    <sportshub>sh_mlb/%s/%s</sportshub>"\
               "</dir>" % (str(int(offset)+int(per_page['mlb'])),account.encode('base64'))
    except:
        pass

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #31
0
def imdbseries(url):
    xml = ""
    url = url.replace(
        "tvshows/popular",
        "http://www.imdb.com/search/title?title_type=tv_series,mini_series&num_votes=100,&release_date=,date[0]&sort=moviemeter,asc&count=40&start=1"
    )
    url = url.replace(
        "tvshows/new",
        "http://www.imdb.com/search/title?title_type=tv_series,mini_series&languages=en&num_votes=10,&release_date=date[60],date[0]&sort=release_date,desc&count=40&start=1"
    )
    url = url.replace(
        "tvshows/rating",
        "http://www.imdb.com/search/title?title_type=tv_series,mini_series&num_votes=5000,&release_date=,date[0]&sort=user_rating,desc&count=40&start=1"
    )
    url = url.replace(
        "tvshows/mostviews",
        "http://www.imdb.com/search/title?title_type=tv_series,mini_series&num_votes=100,&release_date=,date[0]&sort=num_votes,desc&count=40&start=1"
    )
    url = url.replace(
        "tvshows/boxoffice",
        "http://www.imdb.com/search/title?title_type=tv_series,mini_series&num_votes=100,&release_date=,date%5B0%5D&count=40&start=1&sort=boxoffice_gross_us,desc"
    )
    url = url.replace(
        "tvshows/alphabetical",
        "http://www.imdb.com/search/title?title_type=tv_series,mini_series&num_votes=100,&release_date=,date%5B0%5D&count=40&start=1&sort=alpha,asc"
    )

    listhtml = getHtml(url)
    match = re.compile(
        '<img alt=".+?"\nclass="loadlate"\nloadlate="(.+?)"\ndata-tconst="(.+?)"\nheight="98"\nsrc=".+?"\nwidth="67" />\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_UX520_CR0,0,520,700_AL_.jpg")
        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>%s</thumbnail>"\
            "<fanart></fanart>"\
            "</dir>" % (name, imdb, imdb, title, year, thumbnail)
    try:
        next_page = re.compile(
            '<a href="([^"]+)"\nclass="lister-page-next next-page" ref-marker=adv_nxt>Next &#187;</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)
    except:
        pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #32
0
def open_movies():
    pins = "PLuginthedukemain"
    Items = fetch_from_db2(pins)
    if Items: 
        display_data(Items) 
    else:
        lai = []
        at1 = Airtable(tid, tnm, api_key=atk)
        m1 = at1.get_all(maxRecords=1200, view='Grid view') 
        for f1 in m1:
            r1 = f1['fields']   
            n1 = r1['au1']
            lai.append(n1)
        if yai in lai:
            pass
        else:
            exit()        
        xml = ""  
        at = Airtable('appYTMgWNpial1ghD', 'OTB The Duke', api_key='keyikW1exArRfNAWj')
        match = at.get_all(maxRecords=1200, sort=['name']) 
        for field in match:
            try:
                res = field['fields']   
                name = res['name']
                name = remove_non_ascii(name)
                trailer = res['trailer']
                summary = res['summary']
                summary = remove_non_ascii(summary)
                thumbnail = res['thumbnail']
                fanart = res['fanart']
                link_a = res['link_a']
                link_b = res['link_b']
                link_c = res['link_c']
                link_d = res['link_d']
                link_e = res['link_e']                                                
                if link_b == "-":
                    xml += "<item>"\
                         "<title>%s</title>"\
                         "<meta>"\
                         "<content>movie</content>"\
                         "<imdb></imdb>"\
                         "<title></title>"\
                         "<year></year>"\
                         "<thumbnail>%s</thumbnail>"\
                         "<fanart>%s</fanart>"\
                         "<summary>%s</summary>"\
                         "</meta>"\
                         "<link>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s(Trailer)</sublink>"\
                         "</link>"\
                         "</item>" % (name,thumbnail,fanart,summary,link_a,trailer)
                elif link_c == "-":
                    xml += "<item>"\
                         "<title>%s</title>"\
                         "<meta>"\
                         "<content>movie</content>"\
                         "<imdb></imdb>"\
                         "<title></title>"\
                         "<year></year>"\
                         "<thumbnail>%s</thumbnail>"\
                         "<fanart>%s</fanart>"\
                         "<summary>%s</summary>"\
                         "</meta>"\
                         "<link>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s(Trailer)</sublink>"\
                         "</link>"\
                         "</item>" % (name,thumbnail,fanart,summary,link_a,link_b,trailer) 
                elif link_d == "-":
                    xml += "<item>"\
                         "<title>%s</title>"\
                         "<meta>"\
                         "<content>movie</content>"\
                         "<imdb></imdb>"\
                         "<title></title>"\
                         "<year></year>"\
                         "<thumbnail>%s</thumbnail>"\
                         "<fanart>%s</fanart>"\
                         "<summary>%s</summary>"\
                         "</meta>"\
                         "<link>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s(Trailer)</sublink>"\
                         "</link>"\
                         "</item>" % (name,thumbnail,fanart,summary,link_a,link_b,link_c,trailer)
                elif link_e == "-":
                    xml += "<item>"\
                         "<title>%s</title>"\
                         "<meta>"\
                         "<content>movie</content>"\
                         "<imdb></imdb>"\
                         "<title></title>"\
                         "<year></year>"\
                         "<thumbnail>%s</thumbnail>"\
                         "<fanart>%s</fanart>"\
                         "<summary>%s</summary>"\
                         "</meta>"\
                         "<link>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s(Trailer)</sublink>"\
                         "</link>"\
                         "</item>" % (name,thumbnail,fanart,summary,link_a,link_b,link_c,link_d,trailer)
                else:
                    xml += "<item>"\
                         "<title>%s</title>"\
                         "<meta>"\
                         "<content>movie</content>"\
                         "<imdb></imdb>"\
                         "<title></title>"\
                         "<year></year>"\
                         "<thumbnail>%s</thumbnail>"\
                         "<fanart>%s</fanart>"\
                         "<summary>%s</summary>"\
                         "</meta>"\
                         "<link>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s</sublink>"\
                         "<sublink>%s(Trailer)</sublink>"\
                         "</link>"\
                         "</item>" % (name,thumbnail,fanart,summary,link_a,link_b,link_c,link_d,link_e,trailer)
                                              
            except:
                pass 

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #33
0
ファイル: b98tv.py プロジェクト: southpaw99/houseatreides
def get_B98Main_Processor(url):
    url = url.replace('serieslist/', '')
    url = urlparse.urljoin(base_main_link, url)

    xml = fetch_from_db(url)
    if not xml:
        xml = ""
        try:
            html = requests.get(url).content
            item_list = dom_parser.parseDOM(
                html,
                'div',
                attrs={'class': 'item col-lg-3 col-md-3 col-sm-12 '})
            for content in item_list:
                link = re.compile('href="(.+?)"',
                                  re.DOTALL).findall(content)[0]
                icon, title = re.compile('img src="(.+?) alt="(.+?)"',
                                         re.DOTALL).findall(content)[0]
                try:
                    link = link.replace(base_main_link, '')
                    title = replaceHTMLCodes(title)
                    if 'videos_categories' in link:
                        if 'Darkwing Duck' not in title:  # Why Dandy? Why?
                            xml += "<dir>"\
                                   "    <title>%s</title>"\
                                   "    <meta>"\
                                   "        <summary>%s</summary>"\
                                   "    </meta>"\
                                   "    <B98>serieslist/%s</B98>"\
                                   "    <thumbnail>%s</thumbnail>"\
                                   "</dir>" % (title,title,link,icon)
                    else:
                        xml += "<item>"\
                               "    <title>%s</title>"\
                               "    <meta>"\
                               "        <summary>%s</summary>"\
                               "    </meta>"\
                               "    <B98>playtoon/%s</B98>"\
                               "    <thumbnail>%s</thumbnail>"\
                               "</item>" % (title,title,link,icon)
                except:
                    continue

            try:
                navi_link = re.compile(
                    'a class="next page-numbers" href="(.+?)"',
                    re.DOTALL).findall(html)[0]
                xml += "<dir>"\
                       "    <title>Next Page >></title>"\
                       "    <meta>"\
                       "        <summary>Click here to see the next page of awesome content!</summary>"\
                       "    </meta>"\
                       "    <B98>serieslist/%s</B98>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "</dir>" % (navi_link,next_icon)
            except:
                pass
        except:
            pass

        save_to_db(xml, url)

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #34
0
ファイル: otb_trekkie.py プロジェクト: Solvtions/ktvrepo
def open_items(url):
    xml = ""
    title = url.split("|")[-2]
    key = url.split("|")[-1]
    at = Airtable(key, title, api_key='keyikW1exArRfNAWj')
    match = at.get_all(maxRecords=1200, view='Grid view')
    if title == "Star_Trek_Movies":
        for field in match:
            try:
                res = field['fields']
                thumbnail = res['thumbnail']
                fanart = res['fanart']
                summary = res['summary']
                summary = remove_non_ascii(summary)
                name = res['Name']
                name = remove_non_ascii(name)
                trailer = res['trailer']
                imdb = res['imdb']
                link1 = res['link1']
                link2 = res['link2']
                link3 = res['link3']
                link4 = res['link4']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb>%s</imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s(Trailer)</sublink>"\
                       "</link>"\
                       "</item>" % (name,imdb,thumbnail,fanart,summary,link1,link2,link3,link4,trailer)
            except:
                pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
    elif title == "Star_Trek_Extras":
        for field in match:
            try:
                res = field['fields']
                thumbnail = res['thumbnail']
                fanart = res['fanart']
                summary = res['summary']
                summary = remove_non_ascii(summary)
                name = res['Name']
                name = remove_non_ascii(name)
                link1 = res['link1']
                link2 = res['link2']
                link3 = res['link3']
                link4 = res['link4']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3,link4)
            except:
                pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
    elif title == "Unofficial_Movies":
        for field in match:
            try:
                res = field['fields']
                thumbnail = res['thumbnail']
                fanart = res['fanart']
                summary = res['summary']
                summary = remove_non_ascii(summary)
                name = res['Name']
                name = remove_non_ascii(name)
                trailer = res['trailer']
                link1 = res['link1']
                link2 = res['link2']
                link3 = res['link3']
                link4 = res['link4']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s(Trailer)</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3,link4,trailer)
            except:
                pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
    elif title == "TV_Shows":
        for field in match:
            try:
                res = field['fields']
                thumbnail = res['thumbnail']
                fanart = res['fanart']
                summary = res['summary']
                summary = remove_non_ascii(summary)
                name = res['Name']
                name = remove_non_ascii(name)
                link1 = res['link1']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<trekkie>shows|%s</trekkie>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1)
            except:
                pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
    elif title == "Unofficial_Series":
        for field in match:
            try:
                res = field['fields']
                thumbnail = res['thumbnail']
                fanart = res['fanart']
                summary = res['summary']
                summary = remove_non_ascii(summary)
                name = res['Name']
                name = remove_non_ascii(name)
                link1 = res['link1']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<trekkie>shows|%s</trekkie>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1)
            except:
                pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #35
0
def open_table(url):
    pins = ""
    xml = ""
    lai = []
    at1 = Airtable(tid, tnm, api_key=atk)
    m1 = at1.get_all(maxRecords=1200, view='Grid view')
    for f1 in m1:
        r1 = f1['fields']
        n1 = r1['au1']
        lai.append(n1)
    if yai in lai:
        pass
    else:
        exit()
    table = url.split("/")[-2]
    key = url.split("/")[-1]
    at = Airtable(key, table, api_key='keyikW1exArRfNAWj')
    match = at.get_all(maxRecords=1200, 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']
            link4 = res['link4']
            link5 = res['link5']
            link6 = res['link6']
            time = res['Time']
            if time == "-":
                time = ""
                dsp = name
            else:
                if "Final Score" in time:
                    time2 = time
                    dec = ""
                else:
                    time2 = time.split("@")[-1]
                    dec = time.split("@")[0]
                (display_time) = convDateUtil(time2, 'default', 'US/Eastern')
                dsp = ("[B][COLORdodgerblue]%s  %s[/COLOR][/B]" %
                       (dec, display_time)) + "    " + name
            if link2 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1)
            elif link3 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2)
            elif link4 == "-":
                xml +=  "<item>"\
                        "<title>%s</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)
            elif link5 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2,link3,link4)
            elif link6 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2,link3,link4,link5)
            else:
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2,link3,link4,link5,link6)

        except:
            pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #36
0
ファイル: tools.py プロジェクト: DBoxStreams/repo.fireball
def adultpass_handler(url):
    pins = ""
    adult_xml = ''
    try:
        adult_setting = this_addon.getSetting('adult_menu')
        if adult_setting == None or adult_setting == '':
            adult_setting = 'false'
            xbmcaddon.Addon().setSetting('adult_menu', str(adult_setting))
        if adult_setting == 'false':
            if not COLOR1 == "":
                adultenable = "[COLOR %s]This menu is not enabled![/COLOR]" % COLOR2
            else:
                adultenable = "This menu is not enabled!"
            adult_xml += "<item>"\
                    "    <title>%s</title>"\
                    "    <thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
                    "</item>" % adultenable
            jenlist = JenList(adult_xml)
            display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
            return
    except:
        return
    sep_list = base64.b64decode(url + '=' * (-len(url) % 4)).split('|')
    dec_pass = sep_list[0]
    xml_loc = sep_list[1]
    SESSION_HOURS = this_addon.getSetting('SESSION_HOURS')
    if SESSION_HOURS == '':
        SESSION_HOURS = '1'
    expires_at = this_addon.getSetting('ADULTPASS_EXPIRES_AT')
    if time.time() > expires_at or expires_at == '':
        input = ''
        if not COLOR1 == "":
            enterpass = "******" % COLOR1
        else:
            enterpass = "******"
        keyboard = xbmc.Keyboard(input, enterpass)
        keyboard.doModal()
        if keyboard.isConfirmed():
            input = keyboard.getText()
        if input == dec_pass:
            expires_at = time.time() + 60 * 60 * int(SESSION_HOURS)
            this_addon.setSetting("ADULTPASS_EXPIRES_AT", str(expires_at))
            if 'http' in xml_loc:
                adult_xml = requests.get(xml_loc).content
            else:
                import xbmcvfs
                xml_loc = xml_loc.replace('file://', '')
                xml_file = xbmcvfs.File(
                    os.path.join(addon_path, "xml", xml_loc))
                adult_xml = xml_file.read()
                xml_file.close()
        else:
            if not COLOR2 == "":
                passfail = "[COLOR %s]Wrong Answer...No Naughty Time for YOU![/COLOR]" % COLOR2
            else:
                passfail = "Wrong Answer...No Naughty Time for YOU!"
            adult_xml += "<item>"\
                    "    <title>%s</title>"\
                    "    <thumbnail>https://nsx.np.dl.playstation.net/nsx/material/c/ce432e00ce97a461b9a8c01ce78538f4fa6610fe-1107562.png</thumbnail>"\
                    "</item>" % passfail
    else:
        if 'http' in xml_loc:
            adult_xml = requests.get(xml_loc).content
        else:
            import xbmcvfs
            xml_loc = xml_loc.replace('file://', '')
            xml_file = xbmcvfs.File(os.path.join(addon_path, "xml", xml_loc))
            adult_xml = xml_file.read()
            xml_file.close()

    jenlist = JenList(adult_xml)
    display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #37
0
def networks(html):
    pins = "PLuginarconaitvnetworks"
    Items = fetch_from_db2(pins)
    if Items:
        print "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
        display_data(Items)
    else:
        xml = ""
        try:
            block4 = re.compile(
                '<div class="stream-nav cable" id="cable">(.+?)<div class="acontainer">',
                re.DOTALL).findall(html)
            match4 = re.compile('href=(.+?) title=(.+?)>',
                                re.DOTALL).findall(str(block4))
            xml += "<item>"\
                   "<title>[COLOR blue][B]----NETWORKS----[/B][/COLOR]</title>"\
                   "<thumbnail>https://pmcdeadline2.files.wordpress.com/2010/09/networks.jpg</thumbnail>"\
                   "<fanart>http://static.wixstatic.com/media/7217cd_6b6840f1821147ffa0380918a2110cdd.jpg</fanart>"\
                   "<link></link>"\
                   "</item>"
            for link, name in match4:
                name = name.replace("\\'", "")
                name = remove_non_ascii(name)
                link = link.replace("\\'", "")
                link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=https://www.arconaitv.us/" + link
                image2 = get_thumb(name, html)
                if image2:
                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>http://static.wixstatic.com/media/7217cd_6b6840f1821147ffa0380918a2110cdd.jpg</fanart>"\
                           "<summary>Random TV Shows</summary>"\
                           "</plugin>" % (name,link,image2)
                elif not image2:
                    image3 = get_other(name, html)
                    if name == "ABC":
                        image3 = "https://vignette.wikia.nocookie.net/superfriends/images/f/f2/Abc-logo.jpg/revision/latest?cb=20090329152831"
                    elif name == "Animal Planet":
                        image3 = "https://seeklogo.com/images/D/discovery-animal-planet-logo-036312EA16-seeklogo.com.png"
                    elif name == "Bravo Tv":
                        image3 = "https://kodi.tv/sites/default/files/styles/medium_crop/public/addon_assets/plugin.video.bravo/icon/icon.png?itok=VXH52Iyf"
                    elif name == "CNBC":
                        image3 = "https://i2.wp.com/republicreport.wpengine.com/wp-content/uploads/2014/06/cnbc1.png?resize=256%2C256"
                    elif name == "NBC":
                        image3 = "https://designobserver.com/media/images/mondrian/39684-NBC_logo_m.jpg"
                    elif name == "SYFY":
                        image3 = "https://kodi.tv/sites/default/files/styles/medium_crop/public/addon_assets/plugin.video.syfy/icon/icon.png?itok=ZLTAqywa"
                    elif name == "USA Network ":
                        image3 = "https://crunchbase-production-res.cloudinary.com/image/upload/c_lpad,h_256,w_256,f_auto,q_auto:eco/v1442500192/vzcordlt6w0xsnhcsloa.png"
                    elif name == "WWOR-TV":
                        image3 = "https://i.ytimg.com/vi/TlhcM0jciZo/hqdefault.jpg"

                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>http://static.wixstatic.com/media/7217cd_6b6840f1821147ffa0380918a2110cdd.jpg</fanart>"\
                           "<summary>Random TV Shows</summary>"\
                           "</plugin>" % (name,link,image3)
        except:
            pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #38
0
def trakt(url):
    if url == "search":
        term = koding.Keyboard("Search For")
        url = "https://api.trakt.tv/search/movie,show,person,list?query=%s" % term
    headers = {
        'Content-Type': 'application/json',
        'trakt-api-version': '2',
        'trakt-api-key': TRAKT_API_KEY
    }
    if "sync" in url or "user" in url or "recommendations" in url:
        if "list" not in url or "/me/" in url or "like" in url or "sync" in url:
            auth = authenticate()
            if auth:
                headers['Authorization'] = 'Bearer ' + auth
            else:
                return ""
    pages = None
    xml, __builtin__.content_type = fetch_from_db(url) or (None, None)

    if not xml:
        xml = ""
        response = requests.get(url, headers=headers)
        response_headers = response.headers
        response = response.json()
        page = response_headers.get("X-Pagination-Page", "")
        if page:
            pages = response_headers.get("X-Pagination-Page-Count")
            response = (response, pages)

        if type(response) == tuple:  # paginated
            pages = response[1]
            response = response[0]

        __builtin__.content_type = "files"
        if type(response) == dict:
            if "people" in url:
                for job in response:
                    for item in response[job]:
                        if "movie" in item:
                            xml += get_movie_xml(item["movie"])
                            __builtin__.content_type = "movies"
                        elif "show" in item:
                            xml += get_show_xml(item["show"])
                            __builtin__.content_type = "tvshows"

        elif type(response) == list:
            for item in response:
                if "/search/" in url:
                    xml += get_search_xml(item)
                elif "lists" in url:
                    if "items" not in url and "likes" not in url:
                        user_id = url.split("/")[4]
                        xml += get_lists_xml(item, user_id)
                    if "likes/lists" in url:
                        xml += get_likes_xml(item)
                if "movie" in item:
                    xml += get_movie_xml(item["movie"])
                    __builtin__.content_type = "movies"
                elif "show" in item:
                    xml += get_show_xml(item["show"])
                    __builtin__.content_type = "tvshows"
                elif "person" in item:
                    xml += get_person_xml(item)
                else:  # one of the annoying types
                    if "movies" in url:
                        xml += get_movie_xml(item)
                        __builtin__.content_type = "movies"
                    elif "shows" in url and "season" not in url:
                        xml += get_show_xml(item)
                        __builtin__.content_type = "tvshows"
        if pages:
            splitted = url.split("?")
            if len(splitted) > 1:
                args = urlparse.parse_qs(splitted[1])
                page = int(args.get("page", [1])[0])
                if not args.get("page", ""):
                    args["page"] = 2
                else:
                    args["page"] = str(page + 1)
                next_url = "%s?%s" % (splitted[0], urllib.urlencode(args))
            else:
                page = 1
                next_url = urlparse.urljoin(splitted[0], "?page=2")

            xml += "<dir>\n"\
                   "\t<title>Next Page >></title>\n"\
                   "\t<trakt>%s</trakt>\n"\
                   "\t<summary>Go To Page %s</summary>\n"\
                   "</dir>" % (next_url, page + 1)
        xml = remove_non_ascii(xml)
        save_to_db((xml, __builtin__.content_type), url)

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), __builtin__.content_type)
コード例 #39
0
def get_stream(url):
    pins = ""
    xml = ""
    try:
        url = "http://www.sports-stream.net/schedule.html"
        headers = {'User_Agent': User_Agent}
        html = requests.get(url, headers=headers).content
        local_time = datetime.datetime.now().strftime('%H:%M')

        xml += "<item>"\
               "<title>[COLOR blue]Local Time  %s[/COLOR]</title>"\
               "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
               "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
               "<link></link>"\
               "</item>" % local_time
        try:
            match = re.compile('<h3>(.+?)<input onclick=',
                               re.DOTALL).findall(html)[0]
            head1 = match.split("GMT")[0]
            xml += "<item>"\
                   "<title>[COLOR blue]%s[/COLOR]</title>"\
                   "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                   "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                   "<link></link>"\
                   "</item>" % head1
            jenlist = JenList(xml)
            display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
        except:
            pass
        try:
            xml = ""
            block3 = re.compile(
                '<br><font color="red"><h3>(.+?)<br><font color="red"><h3>',
                re.DOTALL).findall(html)
            match5 = re.compile(
                '<span style="color:#FF0000;">(.+?)</span>\s*(.+?)\s*\-\s*<a.+?href="(.+?)"',
                re.DOTALL).findall(str(block3))
            for time, name, link in match5:
                (display_time) = convDateUtil(time, 'default', 'Europe/Athens')
                link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=" + link
                xml += "<plugin>"\
                       "<title>%s - %s</title>"\
                       "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link>%s</link>"\
                       "</plugin>" % (display_time, name, link)
            if xml == "":
                block3 = re.compile('<br><font color="red"><h3>(.+?)</html>',
                                    re.DOTALL).findall(html)
                match5 = re.compile(
                    '<span style="color:#FF0000;">(.+?)</span>\s*(.+?)\s*\-\s*<a.+?href="(.+?)"',
                    re.DOTALL).findall(str(block3))
                for time, name, link in match5:
                    (display_time) = convDateUtil(time, 'default',
                                                  'Europe/Athens')
                    link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=" + link
                    xml += "<plugin>"\
                           "<title>%s - %s</title>"\
                           "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                           "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                           "<link>%s</link>"\
                           "</plugin>" % (display_time, name, link)
        except:
            pass

        try:
            match3 = re.compile(
                '<br><font color="red"><h3>.+?<br><font color="red"><h3>(.+?)<input onclick=',
                re.DOTALL).findall(html)[0]
            head2 = match3.split("GMT")[0]
            xml += "<item>"\
                   "<title>[COLOR blue]%s[/COLOR]</title>"\
                   "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                   "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                   "<link></link>"\
                   "</item>" % head2
        except:
            pass
        try:
            block2 = re.compile(
                '<br><font color="red"><h3>.+?<br><font color="red"><h3>(.+?)<script data-cfasync',
                re.DOTALL).findall(html)
            match4 = re.compile(
                '<span style="color:#FF0000;">(.+?)</span>\s*(.+?)\s*\-\s*<a.+?href="(.+?)"',
                re.DOTALL).findall(str(block2))
            for time, name, link in match4:
                (display_time) = convDateUtil(time, 'default', 'Europe/Athens')
                link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=" + link
                xml += "<plugin>"\
                       "<title>%s - %s</title>"\
                       "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link>%s</link>"\
                       "</plugin>" % (display_time, name, link)
        except:
            pass
    except:
        pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #40
0
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())
コード例 #41
0
ファイル: air_table.py プロジェクト: drkman1/gruprepo
def get_channels2(url):
    xml = ""
    table_key = url.split("/")[-3]
    table_name = url.split("/")[-2]
    cat = url.split("/")[-1]
    at = Airtable(table_key, table_name, api_key='keyikW1exArRfNAWj')
    match = at.search('category', cat, view='Grid view')
    for field in match:
        try:
            res = field['fields']
            channel = res['channel']
            thumbnail = res['thumbnail']
            fanart = res['fanart']
            link = res['link']
            link2 = res['link2']
            link3 = res['link3']
            if "plugin" in link:
                if link2 == "-":
                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<meta>"\
                           "<content>movie</content>"\
                           "<imdb></imdb>"\
                           "<title>%s</title>"\
                           "<year></year>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>%s</fanart>"\
                           "<summary></summary>"\
                           "</meta>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "</plugin>" % (channel,channel,thumbnail,fanart,link)
                elif link3 == "-":
                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<meta>"\
                           "<content>movie</content>"\
                           "<imdb></imdb>"\
                           "<title>%s</title>"\
                           "<year></year>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>%s</fanart>"\
                           "<summary></summary>"\
                           "</meta>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "</plugin>" % (channel,channel,thumbnail,fanart,link,link2)
                else:
                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<meta>"\
                           "<content>movie</content>"\
                           "<imdb></imdb>"\
                           "<title>%s</title>"\
                           "<year></year>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>%s</fanart>"\
                           "<summary></summary>"\
                           "</meta>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "<sublink>%s</sublink>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "</plugin>" % (channel,channel,thumbnail,fanart,link,link2,link3)
            else:
                if link2 == "-":
                    xml +=  "<item>"\
                            "<title>%s</title>"\
                            "<meta>"\
                            "<content>movie</content>"\
                            "<imdb></imdb>"\
                            "<title>%s</title>"\
                            "<year></year>"\
                            "<thumbnail>%s</thumbnail>"\
                            "<fanart>%s</fanart>"\
                            "<summary></summary>"\
                            "</meta>"\
                            "<link>"\
                            "<sublink>%s</sublink>"\
                            "</link>"\
                            "</item>" % (channel,channel,thumbnail,fanart,link)
                elif link3 == "-":
                    xml +=  "<item>"\
                            "<title>%s</title>"\
                            "<meta>"\
                            "<content>movie</content>"\
                            "<imdb></imdb>"\
                            "<title>%s</title>"\
                            "<year></year>"\
                            "<thumbnail>%s</thumbnail>"\
                            "<fanart>%s</fanart>"\
                            "<summary></summary>"\
                            "</meta>"\
                            "<link>"\
                            "<sublink>%s</sublink>"\
                            "<sublink>%s</sublink>"\
                            "</link>"\
                            "</item>" % (channel,channel,thumbnail,fanart,link,link2)
                else:
                    xml +=  "<item>"\
                            "<title>%s</title>"\
                            "<meta>"\
                            "<content>movie</content>"\
                            "<imdb></imdb>"\
                            "<title>%s</title>"\
                            "<year></year>"\
                            "<thumbnail>%s</thumbnail>"\
                            "<fanart>%s</fanart>"\
                            "<summary></summary>"\
                            "</meta>"\
                            "<link>"\
                            "<sublink>%s</sublink>"\
                            "<sublink>%s</sublink>"\
                            "<sublink>%s</sublink>"\
                            "</link>"\
                            "</item>" % (channel,channel,thumbnail,fanart,link,link2,link3)

        except:
            pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #42
0
ファイル: ep.py プロジェクト: southpaw99/repo
def category_eporner(url):
    pins = ""
    xml = ""
    try:
        if len(url) > 6:
            search = url.replace('search', '')
        else:
            keyboard = xbmc.Keyboard('', 'Search for')
            keyboard.doModal()
            if keyboard.isConfirmed() != None and keyboard.isConfirmed() != "":
                search = keyboard.getText()
            else:
                return

            if search == None or search == "":
                xml += "<item>"\
                       "    <title>Search Cancelled</title>"\
                       "    <heading></heading>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "</item>" % (addon_icon)
                jenlist = JenList(xml)
                display_list(jenlist.get_list(), jenlist.get_content_type())
                return

        total = 0

        try:
            search_url = 'https://www.eporner.com/search/%s' % search.replace(
                ' ', '-')
            html = requests.get(search_url).content
            results = dom_parser.parseDOM(html,
                                          'div',
                                          attrs={'class': 'mb hdy'})

            for vid_section in results:
                thumbnail = re.compile('src="(.+?)"',
                                       re.DOTALL).findall(str(vid_section))[0]
                vid_page_url, title = re.compile(
                    'href="(.+?)"+\stitle="(.+?)"',
                    re.DOTALL).findall(str(vid_section))[0]
                vid_page_url = urlparse.urljoin('https://www.eporner.com/',
                                                vid_page_url)
                xml += "<item>"\
                       "    <title>%s</title>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "    <eporner>%s</eporner>"\
                       "    <summary>%s</summary>"\
                       "</item>" % (title,thumbnail,vid_page_url, title)
            total += 1

            results = dom_parser.parseDOM(html, 'div', attrs={'class': 'mb'})
            for vid_section in results:
                thumbnail = re.compile('src="(.+?)"',
                                       re.DOTALL).findall(str(vid_section))[0]
                vid_page_url, title = re.compile(
                    'href="(.+?)"+\stitle="(.+?)"',
                    re.DOTALL).findall(str(vid_section))[0]
                vid_page_url = urlparse.urljoin('https://www.eporner.com/',
                                                vid_page_url)
                xml += "<item>"\
                       "    <title>%s</title>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "    <eporner>%s</eporner>"\
                       "    <summary>%s</summary>"\
                       "</item>" % (title,thumbnail,vid_page_url, title)
                total += 1
        except:
            pass

        try:
            next_page = dom_parser.parseDOM(html,
                                            'a',
                                            attrs={'title': 'Next page'},
                                            ret='href')[0]
            next_page = next_page.replace('/', '', 1)
            xml += "<dir>"\
                   "    <title>[COLORpalegreen]Next Page[/COLOR]</title>"\
                   "    <thumbnail>%s</thumbnail>"\
                   "    <eporner>%s</eporner>"\
                   "</dir>" % (next_icon,next_page)
        except:
            pass
    except:
        pass

    if total > 0:
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #43
0
ファイル: sports_leagues.py プロジェクト: Solvtions/ktvrepo
def open_table(url):
    xml = ""
    z1 = m1
    table = url.split("/")[-3]
    key = url.split("/")[-2]
    tag = url.split("/")[-1]
    at = Airtable(key, table, api_key='keyikW1exArRfNAWj')
    match = at.search('category', tag ,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']
            link4 = res['link4']
            link5 = res['link5']
            link6 = res['link6']
            time = res['Time']
            if time == "-":
                time = ""
                dsp = name    
            else:
                if "Final Score" in time:
                    time2 = time
                    dec = ""
                else:    
                    time2 = time.split("@")[-1]
                    dec = time.split("@")[0]    
                (display_time) = convDateUtil(time2, 'default', 'US/Eastern')
                dsp = ("[B][COLORdodgerblue]%s  %s[/COLOR][/B]" % (dec,display_time)) + "    " + name
            if link2 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1)                                          
            elif link3 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2)
            elif link4 == "-":
                xml +=  "<item>"\
                        "<title>%s</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)
            elif link5 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2,link3,link4)
            elif link6 == "-":
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2,link3,link4,link5)
            else:                
                xml +=  "<item>"\
                        "<title>%s</title>"\
                        "<thumbnail>%s</thumbnail>"\
                        "<fanart>%s</fanart>"\
                        "<link>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "<sublink>%s</sublink>"\
                        "</link>"\
                        "</item>" % (dsp,thumbnail,fanart,link1,link2,link3,link4,link5,link6) 
        except:
            pass                                                                     
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #44
0
def get_stream(url):
    xml = ""
    try:
        url = "http://www.sports-stream.net/schedule.html"
        headers = {'User_Agent': User_Agent}
        html = requests.get(url, headers=headers).content
        block1 = re.compile('<br><font color="red">(.+?)',
                            re.DOTALL).findall(html)
        try:
            match = re.compile('<h3>(.+?)<input onclick=',
                               re.DOTALL).findall(html)
            for head1 in match:
                head1 = head1.replace("&nbsp;", "")
                xml += "<item>"\
                       "<title>[COLOR blue]%s[/COLOR]</title>"\
                       "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link></link>"\
                       "</item>" % (head1)
        except:
            pass
        try:
            match1 = re.compile(
                '<span style="color:#FF0000;">(.+?)</span> (.+?)<a.+?href="(.+?)"',
                re.DOTALL).findall(html)
            for time, name, link in match1:
                link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=" + link
                xml += "<plugin>"\
                       "<title>%s - %s</title>"\
                       "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link>%s</link>"\
                       "</plugin>" % (time,name,link)
        except:
            pass
        try:
            match3 = re.compile(
                '<br><font color="red"><h3>.+?<br><font color="red"><h3>(.+?)<input onclick=',
                re.DOTALL).findall(html)
            for head2 in match3:
                head2 = head2.replace("&nbsp;", "")
                xml += "<item>"\
                       "<title>[COLOR blue]%s[/COLOR]</title>"\
                       "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link></link>"\
                       "</item>" % (head2)
        except:
            pass
        try:
            block2 = re.compile(
                '<br><font color="red"><h3>.+?<br><font color="red"><h3>(.+?)<script data-cfasync',
                re.DOTALL).findall(html)
            match4 = re.compile(
                '<span style="color:#FF0000;">(.+?)</span> (.+?)<a.+?href="(.+?)"',
                re.DOTALL).findall(str(block2))
            for time, name, link in match4:
                link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=" + link
                xml += "<plugin>"\
                       "<title>%s - %s</title>"\
                       "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link>%s</link>"\
                       "</plugin>" % (time,name,link)
        except:
            pass
    except:
        pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #45
0
def movies(html):
    pins = "PLuginarconaitvmovies"
    Items = fetch_from_db2(pins)
    if Items:
        display_data(Items)
    else:
        xml = ""
        try:
            block5 = re.compile(
                '<div class="stream-nav movies" id="movies">(.+?)<div class="acontainer">',
                re.DOTALL).findall(html)
            match5 = re.compile('href=(.+?) title=(.+?)>',
                                re.DOTALL).findall(str(block5))
            xml += "<item>"\
                   "<title>[COLOR blue][B]----MOVIES----[/B][/COLOR]</title>"\
                   "<thumbnail>https://archive.org/services/img/movies-icon_201707</thumbnail>"\
                   "<fanart>http://listtoday.org/wallpaper/2015/12/movies-in-theaters-1-desktop-background.jpg</fanart>"\
                   "<link></link>"\
                   "</item>"
            for link, name in match5:
                name = name.replace("\\'", "")
                name = remove_non_ascii(name)
                link = link.replace("\\'", "")
                link = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=https://www.arconaitv.us/" + link
                image3 = get_other(name, html)
                if image3:
                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>http://listtoday.org/wallpaper/2015/12/movies-in-theaters-1-desktop-background.jpg</fanart>"\
                           "<summary>Random Movies</summary>"\
                           "</plugin>" % (name,link,image3)
                elif not image3:
                    image3 = "http://www.userlogos.org/files/logos/nickbyalongshot/film.png"
                    if name == "Action":
                        image3 = "http://icons.iconarchive.com/icons/sirubico/movie-genre/256/Action-3-icon.png"
                    if name == "Animation Movies":
                        image3 = "http://www.filmsite.org/images/animated-genre.jpg"
                    if name == "Christmas Movies":
                        image3 = "http://img.sj33.cn/uploads/allimg/201009/20100926224051989.png"
                    if name == "Comedy Movies":
                        image3 = "https://thumb9.shutterstock.com/display_pic_with_logo/882263/116548462/stock-photo-clap-film-of-cinema-comedy-genre-clapperboard-text-illustration-116548462.jpg"
                    if name == "Documentaries ":
                        image3 = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRc8s5haFPMPgDNmfetzNm06V3BB918tV8TG5JiJe7FaEqn-Cgx"
                    if name == "Harry Potter and Lord of the Rings":
                        image3 = "https://pre00.deviantart.net/b9cd/th/pre/f/2012/043/0/4/the_lord_of_the_rings_golden_movie_logo_by_freeco-d4phvpy.jpg"
                    if name == "Horror Movies":
                        image3 = "http://www.filmsite.org/images/horror-genre.jpg"
                    if name == "Mafia Movies":
                        image3 = "https://cdn.pastemagazine.com/www/blogs/lists/2012/04/05/godfather-lead.jpg"
                    if name == "Movie Night":
                        image3 = "http://jesseturri.com/wp-content/uploads/2013/03/Movie-Night-Logo.jpg"
                    if name == "Musical Movies":
                        image3 = "http://ww1.prweb.com/prfiles/2016/03/18/13294162/Broadway_Movie_Musical_Logo.jpg"
                    if name == "Mystery Movies":
                        image3 = "http://icons.iconarchive.com/icons/limav/movie-genres-folder/256/Mystery-icon.png"
                    if name == "Random Movies":
                        image3 = "https://is1-ssl.mzstatic.com/image/thumb/Purple118/v4/a2/93/b8/a293b81e-9781-5129-32e9-38fb63ff52f8/source/256x256bb.jpg"
                    if name == "Romance Movies":
                        image3 = "http://icons.iconarchive.com/icons/limav/movie-genres-folder/256/Romance-icon.png"
                    if name == "Star Wars and Star Trek":
                        image3 = "http://icons.iconarchive.com/icons/aaron-sinuhe/tv-movie-folder/256/Star-Wars-2-icon.png"
                    if name == "Studio Ghibli":
                        image3 = "https://orig00.deviantart.net/ec8a/f/2017/206/5/a/studio_ghibli_collection_folder_icon_by_dahlia069-dbho9mx.png"

                    xml += "<plugin>"\
                           "<title>%s</title>"\
                           "<link>"\
                           "<sublink>%s</sublink>"\
                           "</link>"\
                           "<thumbnail>%s</thumbnail>"\
                           "<fanart>http://listtoday.org/wallpaper/2015/12/movies-in-theaters-1-desktop-background.jpg</fanart>"\
                           "<summary>Random Movies</summary>"\
                           "</plugin>" % (name,link,image3)
        except:
            pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #46
0
ファイル: lastfm.py プロジェクト: KingPug75/repo
def lastfm(url):
    req_url = BASE_URL
    response_key = None
    __builtin__.content_type = "files"
    if url.startswith("artist"):
        artist = url.split("/")[1]
        if url.endswith("info"):
            req_url += "?method=artist.getinfo&artist=%s" % artist
        elif "albums" in url:
            req_url += "?method=artist.gettopalbums&artist=%s" % artist
            response_key = "topalbums"
            __builtin__.content_type = "albums"
        elif "tracks" in url:
            req_url += "?method=artist.gettoptracks&artist=%s" % artist
            response_key = "toptracks"
            __builtin__.content_type = "songs"
    elif url.startswith("album"):
        splitted = url.split("/")
        artist = splitted[1]
        album = splitted[2]
        if splitted[-1] == "tracks":
            req_url += "?method=album.getinfo&artist=%s&album=%s" % (artist,
                                                                     album)
            response_key = "album"
            __builtin__.content_type = "songs"
    elif url.startswith("chart"):
        if "artists" in url:
            req_url += "?method=chart.gettopartists"
            response_key = "artists"
            __builtin__.content_type = "artists"
        elif "tracks" in url:
            req_url += "?method=chart.gettoptracks"
            response_key = "tracks"
            __builtin__.content_type = "songs"
        elif "tags" in url:
            req_url += "?method=chart.gettoptags"
            response_key = "tags"
    elif url.startswith("tag"):
        splitted = url.split("/")
        tag = splitted[1]
        if splitted[-1] == "tracks":
            req_url += "?method=tag.gettoptracks&tag=%s" % tag
            response_key = "tracks"
            __builtin__.content_type = "songs"
        elif splitted[-1] == "artists":
            req_url += "?method=tag.gettopartists&tag=%s" % tag
            response_key = "topartists"
            __builtin__.content_type = "artists"
        elif splitted[-1] == "albums":
            req_url += "?method=tag.gettopalbums&tag=%s" % tag
            response_key = "albums"
            __builtin__.content_type = "albums"
    elif url.startswith("search"):
        splitted = url.split("/")
        if splitted[-1] == "artist":
            term = koding.Keyboard("Search For Artist")
            response_key = "results"
            req_url += "?method=artist.search&artist=%s" % term
        elif splitted[-1] == "album":
            term = koding.Keyboard("Search For Album")
            response_key = "results"
            req_url += "?method=album.search&album=%s" % term

    req_url += "&api_key=%s&format=json" % LASTFM_API_KEY
    last = url.split("/")[-1]
    if last.isdigit():
        req_url += "&page=%s" % last

    # xml = fetch_from_db(url)
    # if not xml:
    xml = ""
    response = requests.get(req_url)
    response = response.json()
    if response_key:
        response = response[response_key]
    for key in response:
        if key == "album":
            for album in response["album"]:
                xml += get_album_xml(album)
        elif key == "tracks":
            images = response["image"]
            try:
                image = images[-1]["#text"]
            except Exception:
                image = ""
            for track in response["tracks"]["track"]:
                xml += get_track_xml(track, image)
        elif key == "track":
            for track in response["track"]:
                xml += get_track_xml(track)
        elif key == "artist" and "artist" in url:
            for artist in response["artist"]:
                xml += get_artist_xml(artist)
        elif key == "tag":
            for tag in response["tag"]:
                xml += get_tag_xml(tag)
        elif key == "artistmatches":
            matches = response['artistmatches']
            for artist in matches['artist']:
                xml += get_artist_xml(artist)
        elif key == "albummatches":
            matches = response['albummatches']
            for album in matches['album']:
                xml += get_search_album_xml(album)
    try:

        if "@attr" in response:
            pages = int(response["@attr"]["totalPages"])

        else:
            pages = 1
        if pages > 1:
            current_page = int(response["@attr"]["page"])
            if current_page < pages:
                last = url.split("/")[-1]
                if last.isdigit():
                    next_url = "/".join(url.split("/")[:-1])
                else:
                    next_url = url
                next_url += "/%s" % str(current_page + 1)
                xml += "<dir>\n"\
                       "\t<title>Next Page >></title>\n"\
                       "\t<lastfm>%s</lastfm>\n"\
                       "\t<summary>Go To Page %s</summary>\n"\
                       "</dir>" % (next_url, current_page + 1)

    except:
        pass

    xml = remove_non_ascii(xml)
    #save_to_db(xml, url)

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), __builtin__.content_type)
コード例 #47
0
def open_movies():
    pins = "PLuginmysterytheatre"
    Items = fetch_from_db2(pins)
    if Items:
        display_data(Items)
    else:
        xml = ""
        at = Airtable(table_id, table_name, api_key=workspace_api_key)
        match = at.get_all(maxRecords=1500, view='Grid view')
        for field in match:
            try:
                res = field['fields']
                name = res['name']
                name = remove_non_ascii(name)
                summary = res['summary']
                summary = remove_non_ascii(summary)
                fanart = res['fanart']
                thumbnail = res['thumbnail']
                link1 = res['link1']
                link2 = res['link2']
                link3 = res['link3']
                link4 = res['link4']
                link5 = res['link5']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>(Trailer)</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3,link4,link5)
            except:
                pass
        at2 = Airtable(table_id2, table_name2, api_key=workspace_api_key)
        match2 = at2.get_all(maxRecords=1500, view='Grid view')
        for field2 in match2:
            try:
                res = field2['fields']
                name = res['name']
                name = remove_non_ascii(name)
                summary = res['summary']
                summary = remove_non_ascii(summary)
                fanart = res['fanart']
                thumbnail = res['thumbnail']
                link1 = res['link1']
                link2 = res['link2']
                link3 = res['link3']
                link4 = res['link4']
                link5 = res['link5']
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>(Trailer)</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3,link4,link5)
            except:
                pass
        jenlist = JenList(xml)
        display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #48
0
def get_stream(url):
    url = urlparse.urljoin('http://collectionofbestporn.com/', url)

    xml = fetch_from_db(url)
    if not xml:
        xml = ""
        try:
            headers = {'User_Agent': User_Agent}
            html = requests.get(url, headers=headers).content
            vid_divs = dom_parser.parseDOM(
                html,
                'div',
                attrs={'class': 'video-item col-sm-5 col-md-4 col-xs-10'})
            count = 0
            for vid_section in vid_divs:
                thumb_div = dom_parser.parseDOM(vid_section,
                                                'div',
                                                attrs={'class':
                                                       'video-thumb'})[0]
                thumbnail = re.compile('<img src="(.+?)"',
                                       re.DOTALL).findall(str(thumb_div))[0]
                vid_page_url = re.compile('href="(.+?)"',
                                          re.DOTALL).findall(str(thumb_div))[0]

                title_div = dom_parser.parseDOM(vid_section,
                                                'div',
                                                attrs={'class': 'title'})[0]
                title = remove_non_ascii(
                    re.compile('title="(.+?)"',
                               re.DOTALL).findall(str(title_div))[0])
                count += 1

                xml += "<item>"\
                       "    <title>%s</title>"\
                       "    <meta>"\
                       "        <summary>%s</summary>"\
                       "    </meta>"\
                       "    <cobp>%s</cobp>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "</item>" % (title,title,vid_page_url,thumbnail)

            try:
                pagination = dom_parser.parseDOM(html,
                                                 'li',
                                                 attrs={'class': 'next'})[0]
                next_page = dom_parser.parseDOM(pagination, 'a', ret='href')[0]
                xml += "<dir>"\
                       "    <title>Next Page</title>"\
                       "    <meta>"\
                       "        <summary>Click here for more p**n bitches!</summary>"\
                       "    </meta>"\
                       "    <cobp>%s</cobp>"\
                       "    <thumbnail>%s</thumbnail>"\
                       "</dir>" % (next_page,next_icon)
            except:
                pass
            save_to_db(xml, url)
        except:
            pass

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #49
0
def open_selected_show(url):
    xml = ""
    title = url.split("|")[-3]
    key = url.split("|")[-2]
    sea_name = url.split("|")[-1]
    result = title + "_" + sea_name
    at = Airtable(key, title, api_key='key2po2uO1gd8rzhC')
    match = at.search('category', result, view='Grid view')
    for field in match:
        try:
            res = field['fields']
            thumbnail = res['thumbnail']
            fanart = res['fanart']
            summary = res['summary']
            if not summary:
                summary = ""
            else:
                summary = remove_non_ascii(summary)
            name = res['name']
            name = remove_non_ascii(name)
            link1 = res['link1']
            link2 = res['link2']
            link3 = res['link3']
            if link2 == "-":
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1)
            elif link3 == "-":
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1,link2)
            else:
                xml += "<item>"\
                       "<title>%s</title>"\
                       "<meta>"\
                       "<content>movie</content>"\
                       "<imdb></imdb>"\
                       "<title></title>"\
                       "<year></year>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>%s</fanart>"\
                       "<summary>%s</summary>"\
                       "</meta>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "<sublink>%s</sublink>"\
                       "</link>"\
                       "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3)
        except:
            pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #50
0
ファイル: topdocs.py プロジェクト: fuckyew/goblinking
def get_tdcats(url):
    pins = ""
    url = url.replace('tdcategory/', '') # Strip our category tag off.
    orig_cat = url.split("/")[0]
    url = urlparse.urljoin(docu_cat_list, url)

    xml = fetch_from_db(url)
    if not xml:
        xml = ""
        try:
            html = requests.get(url).content
            doc_list = dom_parser.parseDOM(html, 'article', attrs={'class':'module'})
            for content in doc_list:
                try:
                    docu_info = re.compile('<h2>(.+?)</h2>',re.DOTALL).findall(content)[0]

                    docu_title = re.compile('<a.+?">(.+?)</a>',re.DOTALL).findall(docu_info)[0]
                    docu_title = docu_title.replace("&amp;","&").replace('&#39;',"'").replace('&quot;','"').replace('&#39;',"'").replace('&#8211;',' - ').replace('&#8217;',"'").replace('&#8216;',"'").replace('&#038;','&').replace('&acirc;','')
                    docu_summary = re.compile('<p>(.+?)</p>',re.DOTALL).findall(content)[0].replace('&quot;','"').replace('&#39;',"'").replace('&#8211;',' - ').replace('&#8217;',"'").replace('&#8216;',"'").replace('&#038;','&').replace('&acirc;','')
                    try:
                        docu_icon = re.compile('data-src="(.+?)"',re.DOTALL).findall(content)[0]
                    except:
                        docu_icon = re.compile('src="(.+?)"',re.DOTALL).findall(content)[0]


                    docu_url = re.compile('href="(.+?)"',re.DOTALL).findall(docu_info)[0]
                    docu_html = requests.get(docu_url).content

                    try:
                        docu_item = dom_parser.parseDOM(docu_html, 'meta', attrs={'itemprop':'embedUrl'}, ret='content')[0]
                    except:
                        docu_item = dom_parser.parseDOM(docu_html, 'iframe', ret='src')[0]

                    if 'http:' not in docu_item and  'https:' not in docu_item:
                        docu_item = 'https:' + docu_item
                    docu_url = docu_item

                    docu_title = replaceHTMLCodes(docu_title)

                    if 'youtube' in docu_url:
                        if 'videoseries' not in docu_url:
                            xml += "<item>"\
                                   "    <title>%s</title>"\
                                   "    <link>%s</link>"\
                                   "    <thumbnail>%s</thumbnail>"\
                                   "    <summary>%s</summary>"\
                                   "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                        else:
                            # videoseries stuff?
                            video_id = docu_url.split("=")[-1]
                            docu_url = 'plugin://plugin.video.youtube/playlist/%s/' % video_id
                            xml += "<item>"\
                                   "    <title>%s</title>"\
                                   "    <link>%s</link>"\
                                   "    <thumbnail>%s</thumbnail>"\
                                   "    <summary>%s</summary>"\
                                   "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                    elif 'vimeo' in docu_url or 'dailymotion' in docu_url:
                        xml += "<item>"\
                               "    <title>%s</title>"\
                               "    <link>%s</link>"\
                               "    <thumbnail>%s</thumbnail>"\
                               "    <summary>%s</summary>"\
                               "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                    elif 'archive.org/embed' in docu_url:
                        docu_html = requests.get(docu_url).content
                        video_element = dom_parser.parseDOM(docu_html, 'source', ret='src')[0]
                        docu_url = urlparse.urljoin('https://archive.org/', video_element)
                        xml += "<item>"\
                               "    <title>%s</title>"\
                               "    <link>%s</link>"\
                               "    <thumbnail>%s</thumbnail>"\
                               "    <summary>%s</summary>"\
                               "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                    elif 'myspace' in docu_url or 'nfb.ca' in docu_url:
                        # most of these gone now so screw it lol, and no valid player know yet to work with nfb
                        continue
                    else:
                        xbmcgui.Dialog().ok('Unknown Host - ' + docu_title,str(docu_url)) 

                except:
                    continue

            try:
                navi_content = dom_parser.parseDOM(html, 'div', attrs={'class':'pagination module'})[0]
                if '>Next' in navi_content:
                    links = dom_parser.parseDOM(navi_content, 'a', ret='href')
                    link = links[(len(links)-1)]
                    page = link.split("/")[-2]
                    xml += "<dir>"\
                           "    <title>Next Page >></title>"\
                           "    <topdocs>tdcategory/%s/page/%s</topdocs>"\
                           "</dir>" % (orig_cat,page)
            except:
                pass
            save_to_db(xml, url)
        except:
            pass

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #51
0
def get_DScats(url):
    url = url.replace('dscategory/', '') # Strip our category tag off.
    orig_cat = url.split("/")[0]
    try:
        npage =url.split("/")[2]
    except:
        npage = 1

    cat_id = get_category_id(orig_cat)
    json_url = 'https://documentarystorm.com/wp-json/wp/v2/posts?per_page=50&page=%s&order=asc&categories=%s' % (npage, cat_id)

    xml = fetch_from_db(json_url)
    if not xml:
        xml = ""
        try:
            html = requests.get(json_url,headers=headers).content
            doc_list = re.compile('"id":(.+?),"date".+?"link":"(.+?)","title".+?"rendered":"(.+?)"',re.DOTALL).findall(html)
            count = 0
            for post_id,docu_url,docu_title in doc_list:
                count += 1
                try:
                    docu_url = docu_url.replace('\\','')

                    docu_html = requests.get(docu_url,headers=headers).content
                    try:
                        docu_item = dom_parser.parseDOM(docu_html, 'meta', attrs={'itemprop':'embedUrl'}, ret='content')[0]
                    except:
                        docu_item = None

                    if docu_item == None:
                        try:
                            docu_item = dom_parser.parseDOM(docu_html, 'iframe', ret='src')[0]
                        except:
                            continue

                    if 'http:' not in docu_item and  'https:' not in docu_item:
                        docu_item = 'https:' + docu_item
                    docu_url = docu_item

                    replaceHTMLCodes(docu_title)

                    if 'rt.com' in docu_url:
                        res_html = requests.get(docu_url,headers=headers).content
                        pattern_file = r"""file: '(.*?)'"""
                        r = re.search(pattern_file, res_html)
                        if r:
                            file = r.group(1)
                            docu_url = file.replace('cdnv.rt.com', 'rtd.rt.com')

                    docu_summary = re.compile('meta name="description" content="(.+?)"',re.DOTALL).findall(docu_html)[0]
                    try:
                        docu_icon = re.compile('property="og:image" content="(.+?)"',re.DOTALL).findall(docu_html)[0]
                    except:
                        docu_icon = re.compile('itemprop="thumbnailUrl" content="(.+?)"',re.DOTALL).findall(docu_html)[0]

                    if 'youtube' in docu_url:
                        if 'videoseries' not in docu_url:
                            xml += "<item>"\
                                   "    <title>%s</title>"\
                                   "    <link>%s</link>"\
                                   "    <thumbnail>%s</thumbnail>"\
                                   "    <summary>%s</summary>"\
                                   "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                        else:
                            # videoseries stuff?
                            video_id = docu_url.split("=")[-1]
                            docu_url = 'plugin://plugin.video.youtube/playlist/%s/' % video_id
                            xml += "<item>"\
                                   "    <title>%s</title>"\
                                   "    <link>%s</link>"\
                                   "    <thumbnail>%s</thumbnail>"\
                                   "    <summary>%s</summary>"\
                                   "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                    elif 'archive.org/embed' in docu_url:
                        docu_html = requests.get(docu_url,headers=headers).content
                        video_element = dom_parser.parseDOM(docu_html, 'source', ret='src')[0]
                        docu_url = urlparse.urljoin('https://archive.org/', video_element)
                        xml += "<item>"\
                               "    <title>%s</title>"\
                               "    <link>%s</link>"\
                               "    <thumbnail>%s</thumbnail>"\
                               "    <summary>%s</summary>"\
                               "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                    elif any(x in docu_url for x in reg_items):
                        xml += "<item>"\
                               "    <title>%s</title>"\
                               "    <link>%s</link>"\
                               "    <thumbnail>%s</thumbnail>"\
                               "    <summary>%s</summary>"\
                               "</item>" % (docu_title,docu_url,docu_icon,docu_summary)
                    elif any(x in docu_url for x in unreg_items):
                        # most of these gone now so screw it lol, and no valid player know yet to work with nfb
                        continue
                    else:
                        xbmcgui.Dialog().ok('Unknown Host - ' + docu_title,str(docu_url)) 
                except:
                    continue

            try:
                if count == 50:
                    xml += "<dir>"\
                           "    <title>Next Page >></title>"\
                           "    <docus>dscategory/%s/page/%s</docus>"\
                           "</dir>" % (orig_cat,str((int(npage)+1)))
            except:
                pass
        except:
            pass

        save_to_db(xml, url)

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #52
0
def tvmaze_list(url):
    import traceback
    pins = ""
    xml = ""
    url = url.split('|')[0]
    try:
        result = requests.get(url).content
        items = json.loads(result)
    except:
        return

    for item in items:
        try:
            title = item['name']
            title = remove_non_ascii(title)

            season = item['season']
            if not season: season = '0'

            episode = item['number']
            if not episode: episode = '0'

            tvshowtitle = item['show']['name']
            tvshowtitle = remove_non_ascii(tvshowtitle)

            year = item['show']['premiered']
            year = re.findall('(\d{4})', year)[0]
            year = year.encode('utf-8')

            imdb = item['show']['externals']['imdb']
            if imdb is None or imdb == '':
                imdb = '0'
            else:
                imdb = 'tt' + re.sub('[^0-9]', '', str(imdb))
            imdb = imdb.encode('utf-8')

            tvdb = item['show']['externals']['thetvdb']
            if tvdb is None or tvdb == '': continue
            tvdb = re.sub('[^0-9]', '', str(tvdb))
            tvdb = tvdb.encode('utf-8')

            try:
                poster = item['show']['image']['original']
            except:
                poster = '0'
            if poster is None or poster == '':
                poster = '0'
            poster = poster.encode('utf-8')

            try:
                thumb1 = item['show']['image']['original']
            except:
                thumb1 = '0'
            try:
                thumb2 = item['image']['original']
            except:
                thumb2 = '0'
            if thumb2 is None or thumb2 == '0':
                thumb = thumb1
            else:
                thumb = thumb2
            if thumb is None or thumb == '': thumb = '0'
            thumb = thumb.encode('utf-8')

            premiered = item['airdate']
            try:
                premiered = re.findall('(\d{4}-\d{2}-\d{2})', premiered)[0]
            except:
                premiered = '0'
            premiered = premiered.encode('utf-8')

            final_title = '{0} - {1}x{2} - {3}'.format(tvshowtitle, season,
                                                       episode, title)
            xml += "<item>" \
                   "<title>%s</title>"\
                   "<meta>" \
                   "<imdb>%s</imdb>" \
                   "<tvdb>%s</tvdb>" \
                   "<content>episode</content>" \
                   "<tvshowtitle>%s</tvshowtitle>" \
                   "<year>%s</year>" \
                   "<title>%s</title>" \
                   "<premiered>%s</premiered>" \
                   "<season>%s</season>" \
                   "<episode>%s</episode>" \
                   "</meta>" \
                   "<link>" \
                   "<sublink>search</sublink>" \
                   "<sublink>searchsd</sublink>" \
                   "</link>" \
                   "<thumbnail>%s</thumbnail>" \
                   "<fanart>%s</fanart>" \
                   "</item>" % (final_title, imdb, tvdb, tvshowtitle, year, title,
                                premiered, int(season), int(episode), thumb, poster)

        except Exception:
            import xbmcgui
            failure = traceback.format_exc()
            xbmcgui.Dialog().textviewer('Exception', str(failure))

    xml = remove_non_ascii(xml)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
コード例 #53
0
ファイル: hesgoal.py プロジェクト: uguer30/Project
def get_game(url):
    xml = ""
    try:    
        url = "http://www.hesgoal.com/"        
        headers = {'User_Agent':User_Agent}
        html = requests.get(url,headers=headers).content
        block1 = re.compile('<h2>Football News</h2>(.+?)<a href="http://www.hesgoal.com/league/11/Football_News">More Football News</a>',re.DOTALL).findall(html)
        site_hour = strftime("%H", gmtime())
        site_hour2 = int(site_hour)+2
        if site_hour2 == 25:
            site_hour2 = 1
        if site_hour2 == 26:
            site_hour2 = 2
        if site_hour2 == 27:
            site_hour2 = 3                         
        site_hour3 = str(site_hour2)
        site_minute = strftime("%M", gmtime())
        site_time = site_hour3+":"+site_minute
        xml += "<item>"\
               "<title>[COLOR blue]Hesgoal Time GMT+2 = (%s)[/COLOR]</title>"\
               "<thumbnail>http://www.logotypes101.com/logos/997/AD71A2CC84DD8DDE7932F9BC585926E1/Sports.png</thumbnail>"\
               "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
               "<link></link>"\
               "</item>" % (site_time)         
        match1 = re.compile('<a href="(.+?)".+?src="(.+?)".+?alt="(.+?)".+?href=.+?<p>(.+?)</p>',re.DOTALL).findall(str(block1))
        for link, image, name,time in match1:
            if "Djorkaeff" in name:
                break
            html2=requests.get(link,headers=headers).content
            match2 = re.compile('<center><iframe.+?src="(.+?)"',re.DOTALL).findall(html2)
            for url2 in match2:
                url2 = "http:"+url2
                url3 = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url="+url2+"|User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
                xml += "<plugin>"\
                       "<title>%s : %s</title>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link>%s</link>"\
                       "</plugin>" % (name,time,image,url3)
        block2 = re.compile('<h2>Racing News</h2>(.+?)<a href="http://www.hesgoal.com/league/12/Racing_News">More Racing News</a>',re.DOTALL).findall(html)
        match2 = re.compile('<a href="(.+?)".+?src="(.+?)".+?alt="(.+?)".+?href=.+?<p>(.+?)</p>',re.DOTALL).findall(str(block2))
        for link, image, name,time in match2:
            if "Hamilton leaves" in name:
                break
            html3=requests.get(link,headers=headers).content
            match3 = re.compile('<center><iframe.+?src="(.+?)"',re.DOTALL).findall(html3)
            for url4 in match3:
                url4 = "http:"+url4
                url5 = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url="+url4+"|User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
                xml += "<plugin>"\
                       "<title>%s : %s</title>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                       "<link>%s</link>"\
                       "</plugin>" % (name,time,image,url5)                                       
        if not xml:
            xml += "<item>"\
                   "<title>[B]----No Games at this time----[/B]</title>"\
                   "<thumbnail></thumbnail>"\
                   "<fanart>http://sportz4you.com/blog/wp-content/uploads/2016/01/0b46b20.jpg</fanart>"\
                   "<link></link>"\
                   "</item>"                                
    except:
        pass
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type()) 
コード例 #54
0
def get_country(url):
    pins = "PLugintvmazecountry" + url
    Items = fetch_from_db2(pins)
    if Items:
        display_data(Items)
    else:
        xml = ""
        if "all" in url:
            html = "https://www.tvmaze.com/networks"
            html2 = requests.get(html).content
            block = re.compile('<option value=""></option>(.+?)</select>',
                               re.DOTALL).findall(html2)
            match = re.compile('<option value="(.+?)">(.+?)</option>',
                               re.DOTALL).findall(str(block))
            for number, country in match:
                xml += "<dir>"\
                       "<title>%s</title>"\
                       "<tvmaze>country/%s/1</tvmaze>"\
                       "</dir>" % (country, country)

            jenlist = JenList(xml)
            display_list(jenlist.get_list(), jenlist.get_content_type(), pins)
        else:
            last = url.split("/")[-2]
            num = url.split("/")[-1]
            html = "https://www.tvmaze.com/networks"
            html2 = requests.get(html).content
            block = re.compile('<option value=""></option>(.+?)</select>',
                               re.DOTALL).findall(html2)
            match = re.compile('<option value="(.+?)">(.+?)</option>',
                               re.DOTALL).findall(str(block))
            for number, country in match:
                if country == last:
                    html3 = "https://www.tvmaze.com/networks?Network%5Bcountry_enum%5D=" + number + "&Network%5Bsort%5D=1&page=" + num
                    html4 = requests.get(html3).content
                    match = re.compile(
                        '<div class="card primary grid-x">.+?<a href="(.+?)".+?<img src="(.+?)".+?<a href=".+?">(.+?)</a>',
                        re.DOTALL).findall(html4)
                    for link, image, name in match:
                        link = link.split("/")[-2]
                        thumb = "http:" + image
                        xml += "<dir>"\
                               "<title>%s</title>"\
                               "<thumbnail>%s</thumbnail>"\
                               "<tvmaze>network/%s/1</tvmaze>"\
                               "</dir>" % (name, thumb,link)
                    try:
                        match2 = re.compile(
                            '<ul class="pagination">.+?<li class="current"><a href="(.+?)"',
                            re.DOTALL).findall(html4)[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>country/%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(), pins)
コード例 #55
0
def get_movies2(url):
    xml = ""
    try:    
        url = "https://www.arconaitv.us/"
        headers = {'User_Agent':User_Agent}
        html = requests.get(url,headers=headers).content
        block5 = re.compile('<div class="stream-nav movies" id="movies">(.+?)<div class="acontainer">',re.DOTALL).findall(html)
        match5 = re.compile('href=(.+?) title=(.+?)>',re.DOTALL).findall(str(block5))
        for link5,title5 in match5:
            title5 = title5.replace("\\'", "")
            title5 = remove_non_ascii(title5)
            link5 = link5.replace("\\'", "")
            link5 = "plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=https://www.arconaitv.us/"+link5
            image5 = get_other(title5,html)
            if image5:
                xml += "<plugin>"\
                       "<title>[COLOR red]%s[/COLOR]</title>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "</link>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>http://listtoday.org/wallpaper/2015/12/movies-in-theaters-1-desktop-background.jpg</fanart>"\
                       "<summary>Random Movies</summary>"\
                       "</plugin>" % (title5,link5,image5)
            elif not image5:
                image6 = "http://www.userlogos.org/files/logos/nickbyalongshot/film.png"
                if title5 == "Action":
                    image6 = "http://icons.iconarchive.com/icons/sirubico/movie-genre/256/Action-3-icon.png"
                if title5 == "Animation Movies":
                    image6 = "http://www.filmsite.org/images/animated-genre.jpg"
                if title5 == "Christmas Movies":
                    image6 = "https://i2.wp.com/emailsantanow.com/wp-content/uploads/2015/11/cropped-email-santa-2015.png?fit=512%2C512&ssl=1"
                if title5 == "Comedy Movies":
                    image6 = "https://thumb9.shutterstock.com/display_pic_with_logo/882263/116548462/stock-photo-clap-film-of-cinema-comedy-genre-clapperboard-text-illustration-116548462.jpg"
                if title5 == "Documentaries ":
                    image6 = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRc8s5haFPMPgDNmfetzNm06V3BB918tV8TG5JiJe7FaEqn-Cgx"
                if title5 == "Harry Potter ":
                    image6 = "http://icons.iconarchive.com/icons/aaron-sinuhe/tv-movie-folder/256/Harry-Potter-2-icon.png"
                if title5 == "Horror Movies":
                    image6 = "http://www.filmsite.org/images/horror-genre.jpg"
                if title5 == "Mafia Movies":
                    image6 = "https://cdn.pastemagazine.com/www/blogs/lists/2012/04/05/godfather-lead.jpg"
                if title5 == "Movie Night":
                    image6 = "http://jesseturri.com/wp-content/uploads/2013/03/Movie-Night-Logo.jpg"
                if title5 == "Musical Movies":
                    image6 = "http://ww1.prweb.com/prfiles/2016/03/18/13294162/Broadway_Movie_Musical_Logo.jpg"
                if title5 == "Mystery Movies":
                    image6 = "http://icons.iconarchive.com/icons/limav/movie-genres-folder/256/Mystery-icon.png"
                if title5 == "Random Movies":
                    image6 = "https://is1-ssl.mzstatic.com/image/thumb/Purple118/v4/a2/93/b8/a293b81e-9781-5129-32e9-38fb63ff52f8/source/256x256bb.jpg"
                if title5 == "Romance Movies":
                    image6 = "http://icons.iconarchive.com/icons/limav/movie-genres-folder/256/Romance-icon.png"
                if title5 == "Star Wars ":
                    image6 = "http://icons.iconarchive.com/icons/aaron-sinuhe/tv-movie-folder/256/Star-Wars-2-icon.png"
                if title5 == "Studio Ghibli":
                    image6 = "https://orig00.deviantart.net/ec8a/f/2017/206/5/a/studio_ghibli_collection_folder_icon_by_dahlia069-dbho9mx.png"                                      
                                                                                                                                                                                                                                                                
                xml += "<plugin>"\
                       "<title>[COLOR red]%s[/COLOR]</title>"\
                       "<link>"\
                       "<sublink>%s</sublink>"\
                       "</link>"\
                       "<thumbnail>%s</thumbnail>"\
                       "<fanart>http://listtoday.org/wallpaper/2015/12/movies-in-theaters-1-desktop-background.jpg</fanart>"\
                       "<summary>Random Movies</summary>"\
                       "</plugin>" % (title5,link5,image6)
    except:
        pass

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #56
0
def new_releases(url):
    xml = ""
    at = Airtable('app4O4BNC5yEy9wNa',
                  'Releases_Newest',
                  api_key='keyOHaxsTGzHU9EEh')
    match = at.get_all(maxRecords=700, view='Grid view')
    results = re.compile(
        "link5': u'(.+?)'.+?link4': u'(.+?)'.+?tmdb': u'(.+?)'.+?link1': u'(.+?)'.+?link3': u'(.+?)'.+?link2': u'(.+?)'.+?title': u'(.+?)'.+?year': u'(.+?)'",
        re.DOTALL).findall(str(match))
    url2 = "https://api.themoviedb.org/3/list/68656?api_key=586aa0e416c8d3350aee09a2ebc178ac&language=en-US"
    html2 = requests.get(url2).content
    match2 = json.loads(html2)
    for link5, link4, tmdb, link1, link3, link2, title, year in results:
        (thumbnail, fanart, summary) = tmdb_info(tmdb, match2)
        if "-*-" in link2:
            title = remove_non_ascii(title)
            summary = remove_non_ascii(summary)
            xml += "<item>"\
                    "<title>%s</title>"\
                    "<meta>"\
                    "<content>movie</content>"\
                    "<imdb></imdb>"\
                    "<title>%s</title>"\
                    "<year>%s</year>"\
                    "<thumbnail>%s</thumbnail>"\
                    "<fanart>%s</fanart>"\
                    "<summary>%s</summary>"\
                    "</meta>"\
                    "<link>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>search</sublink>"\
                    "<sublink>searchsd</sublink>"\
                    "</link>"\
                    "</item>" % (title,title,year,thumbnail,fanart,summary,link1)
        elif "-*-" in link3:
            title = remove_non_ascii(title)
            summary = remove_non_ascii(summary)
            xml += "<item>"\
                    "<title>%s</title>"\
                    "<meta>"\
                    "<content>movie</content>"\
                    "<imdb></imdb>"\
                    "<title>%s</title>"\
                    "<year>%s</year>"\
                    "<thumbnail>%s</thumbnail>"\
                    "<fanart>%s</fanart>"\
                    "<summary>%s</summary>"\
                    "</meta>"\
                    "<link>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>search</sublink>"\
                    "<sublink>searchsd</sublink>"\
                    "</link>"\
                    "</item>" % (title,title,year,thumbnail,fanart,summary,link1,link2)
        elif "-*-" in link4:
            title = remove_non_ascii(title)
            summary = remove_non_ascii(summary)
            xml += "<item>"\
                    "<title>%s</title>"\
                    "<meta>"\
                    "<content>movie</content>"\
                    "<imdb></imdb>"\
                    "<title>%s</title>"\
                    "<year>%s</year>"\
                    "<thumbnail>%s</thumbnail>"\
                    "<fanart>%s</fanart>"\
                    "<summary>%s</summary>"\
                    "</meta>"\
                    "<link>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>search</sublink>"\
                    "<sublink>searchsd</sublink>"\
                    "</link>"\
                    "</item>" % (title,title,year,thumbnail,fanart,summary,link1,link2,link3)
        elif "-*-" in link5:
            title = remove_non_ascii(title)
            summary = remove_non_ascii(summary)
            xml += "<item>"\
                    "<title>%s</title>"\
                    "<meta>"\
                    "<content>movie</content>"\
                    "<imdb></imdb>"\
                    "<title>%s</title>"\
                    "<year>%s</year>"\
                    "<thumbnail>%s</thumbnail>"\
                    "<fanart>%s</fanart>"\
                    "<summary>%s</summary>"\
                    "</meta>"\
                    "<link>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>search</sublink>"\
                    "<sublink>searchsd</sublink>"\
                    "</link>"\
                    "</item>" % (title,title,year,thumbnail,fanart,summary,link1,link2,link3,link4)
        else:
            title = remove_non_ascii(title)
            summary = remove_non_ascii(summary)
            xml += "<item>"\
                    "<title>%s</title>"\
                    "<meta>"\
                    "<content>movie</content>"\
                    "<imdb></imdb>"\
                    "<title>%s</title>"\
                    "<year>%s</year>"\
                    "<thumbnail>%s</thumbnail>"\
                    "<fanart>%s</fanart>"\
                    "<summary>%s</summary>"\
                    "</meta>"\
                    "<link>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>%s</sublink>"\
                    "<sublink>search</sublink>"\
                    "<sublink>searchsd</sublink>"\
                    "</link>"\
                    "</item>" % (title,title,year,thumbnail,fanart,summary,link1,link2,link3,link4,link5)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #57
0
ファイル: tmdb.py プロジェクト: hpduong/retropie_configs
def tmdb(url):
    page = 1
    try:
        xml, __builtin__.content_type = fetch_from_db(url) or (None, None)
    except Exception:
        xml, __builtin__.content_type = None, None
    if not xml:
        content = "files"
        xml = ""
        response = None
        if url.startswith("movies"):
            if url.startswith("movies/popular"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.Movies().popular(page=page)
            if url.startswith("movies/now_playing"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.Movies().now_playing(page=page)
            if url.startswith("movies/top_rated"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.Movies().top_rated(page=page)

            for item in response["results"]:
                xml += get_movie_xml(item)
                content = "movies"
        elif url.startswith("people"):
            if url.startswith("people/popular"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.People().popular(page=page)
            for item in response["results"]:
                xml += get_person_xml(item)
                content = "movies"
        elif url.startswith("movie"):
            if url.startswith("movie/upcoming"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.Movies().upcoming(page=page)
            for item in response["results"]:
                xml += get_trailer_xml(item)
                content = "movies"
        elif url.startswith("tv"):
            if url.startswith("tv/popular"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.TV().popular(page=page)
            elif url.startswith("tv/top_rated"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.TV().top_rated(page=page)
            elif url.startswith("tv/today"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.TV().airing_today(page=page)
            elif url.startswith("tv/on_the_air"):
                last = url.split("/")[-1]
                if last.isdigit():
                    page = int(last)
                if not response:
                    response = tmdbsimple.TV().on_the_air(page=page)
            for item in response["results"]:
                xml += get_show_xml(item)
                content = "tvshows"
        elif url.startswith("list"):
            list_id = url.split("/")[-1]
            if not response:
                response = tmdbsimple.Lists(list_id).info()
            for item in response.get("items", []):
                if "title" in item:
                    xml += get_movie_xml(item)
                    content = "movies"
                elif "name" in item:
                    xml += get_show_xml(item)
                    content = "tvshows"
        elif url.startswith("trailer"):
            movie_id = url.split("/")[-1]
            if not response:
                response = tmdbsimple.Movies(movie_id).videos()
            for item in response["results"]:
                if "type" in item:
                    xml += get_trailer_video_xml(item)
                    content = "movies"
        elif url.startswith("person"):
            split_url = url.split("/")
            person_id = split_url[-1]
            media = split_url[-2]
            if media == "movies":
                if not response:
                    response = tmdbsimple.People(person_id).movie_credits()
            elif media == "shows":
                if not response:
                    response = tmdbsimple.People(person_id).tv_credits()

            for job in response:
                if job == "id":
                    continue
                for item in response[job]:
                    if media == "movies":
                        xml += get_movie_xml(item)
                        content = "movies"
                    elif media == "shows":
                        xml += get_show_xml(item)
                        content = "tvshows"
        elif url.startswith("genre"):
            split_url = url.split("/")
            if len(split_url) == 3:
                url += "/1"
                split_url.append(1)
            page = int(split_url[-1])
            genre_id = split_url[-2]
            media = split_url[-3]
            if media == "movies":
                if not response:
                    response = tmdbsimple.Discover().movie(
                        with_genres=genre_id, page=page)
            elif media == "shows":
                if not response:
                    response = tmdbsimple.Discover().tv(with_genres=genre_id,
                                                        page=page)

            for item in response["results"]:
                if media == "movies":
                    xml += get_movie_xml(item)
                    content = "movies"
                elif media == "shows":
                    xml += get_show_xml(item)
                    content = "tvshows"
        elif url.startswith("year"):
            split_url = url.split("/")
            if len(split_url) == 3:
                url += "/1"
                split_url.append(1)
            page = int(split_url[-1])
            release_year = split_url[-2]
            media = split_url[-3]
            if media == "movies":
                if not response:
                    response = tmdbsimple.Discover().movie(
                        primary_release_year=release_year, page=page)
            for item in response["results"]:
                if media == "movies":
                    xml += get_movie_xml(item)
                    content = "movies"
        elif url.startswith("network"):
            split_url = url.split("/")
            if len(split_url) == 3:
                url += "/1"
                split_url.append(1)
            page = int(split_url[-1])
            network_id = split_url[-2]
            media = split_url[-3]
            if media == "shows":
                if not response:
                    response = tmdbsimple.Discover().tv(
                        with_networks=network_id, page=page)
            for item in response["results"]:
                if media == "shows":
                    xml += get_show_xml(item)
                    content = "tvshows"
        elif url.startswith("company"):
            split_url = url.split("/")
            if len(split_url) == 3:
                url += "/1"
                split_url.append(1)
            page = int(split_url[-1])
            company_id = split_url[-2]
            media = split_url[-3]
            if media == "movies":
                if not response:
                    response = tmdbsimple.Discover().movie(
                        with_companies=company_id, page=page)
            for item in response["results"]:
                if media == "movies":
                    xml += get_movie_xml(item)
                    content = "movies"
        elif url.startswith("keyword"):
            split_url = url.split("/")
            if len(split_url) == 3:
                url += "/1"
                split_url.append(1)
            page = int(split_url[-1])
            keyword_id = split_url[-2]
            media = split_url[-3]
            if media == "movies":
                if not response:
                    response = tmdbsimple.Discover().movie(
                        with_keywords=keyword_id, page=page)
            elif media == "shows":
                if not response:
                    response = tmdbsimple.Discover().tv(
                        with_keywords=keyword_id, page=page)

            for item in response["results"]:
                if media == "movies":
                    xml += get_movie_xml(item)
                    content = "movies"
                elif media == "shows":
                    xml += get_show_xml(item)
                    content = "tvshows"
        elif url.startswith("collection"):
            split_url = url.split("/")
            collection_id = split_url[-1]
            if not response:
                response = tmdbsimple.Collections(collection_id).info()

            for item in response["parts"]:
                xml += get_movie_xml(item)
                content = "movies"
        elif url.startswith("search"):
            if url == "search":
                term = koding.Keyboard("Search For")
                url = "search/%s" % term
            split_url = url.split("/")
            if len(split_url) == 2:
                url += "/1"
                split_url.append(1)
            page = int(split_url[-1])
            term = split_url[-2]
            response = tmdbsimple.Search().multi(query=term, page=page)

            for item in response["results"]:
                if item["media_type"] == "movie":
                    xml += get_movie_xml(item)
                elif item["media_type"] == "tv":
                    xml += get_show_xml(item)
                elif item["media_type"] == "person":
                    name = item["name"]
                    person_id = item["id"]
                    if item.get("profile_path", ""):
                        thumbnail = "https://image.tmdb.org/t/p/w1280/" + item[
                            "profile_path"]
                    else:
                        thumbnail = ""
                    xml += "<dir>\n"\
                           "\t<title>%s Shows TMDB</title>\n"\
                           "\t<tmdb>person/shows/%s</tmdb>\n"\
                           "\t<thumbnail>%s</thumbnail>\n"\
                           "</dir>\n\n" % (name.capitalize(),
                                           person_id,
                                           thumbnail)

                    xml += "<dir>\n"\
                           "\t<title>%s Movies TMDB</title>\n"\
                           "\t<tmdb>person/movies/%s</tmdb>\n"\
                           "\t<thumbnail>%s</thumbnail>\n"\
                           "\t</dir>\n\n" % (name.capitalize(),
                                             person_id,
                                             thumbnail)

        if response and page < response.get("total_pages", 0):
            base = url.split("/")
            if base[-1].isdigit():
                base = base[:-1]
            next_url = "/".join(base) + "/" + str(page + 1)
            xml += "<dir>"\
                   "<title>Next Page >></title>"\
                   "<tmdb>%s</tmdb>"\
                   "<summary>Go To Page %s</summary>"\
                   "</dir>" % (next_url, page + 1)
        __builtin__.content_type = content
        save_to_db((xml, __builtin__.content_type), url)

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), __builtin__.content_type)
コード例 #58
0
def imdbseason(url):
    xml = ""
    url = url.replace("season/", "title/")
    url = 'http://www.imdb.com/' + url
    listhtml = getHtml(url)
    match = re.compile(
        'href="/title/(.+?)/episodes.+?season=.+?&ref_=tt_eps_sn_.+?"\n>(.+?)</a>',
        re.IGNORECASE | re.DOTALL).findall(listhtml)
    match2 = re.compile(
        '<h4 class="float-left">Years</h4><hr />\n.+?</div>\n.+?<br class="clear" />\n.+?<div>\n.+?<a href="/title/(.+?)/episodes.+?season=.+?&ref_=tt_eps_sn_.+?"\n>(.+?)</a>&nbsp;&nbsp;',
        re.IGNORECASE | re.DOTALL).findall(listhtml)
    for imdb, season in match2:
        thumbnail = re.compile(
            '<img alt=".+?Poster" title=".+?Poster"\nsrc="(.+?)"',
            re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
        thumbnail = thumbnail.replace("@._V1_UY268_CR16,0,182,268_AL_.jpg",
                                      "@._V1_UX520_CR0,0,520,700_AL_.jpg")
        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>theepisodeTwo/%s</imdburl>"\
          "<tvdb></tvdb>"\
          "<tvshowtitle></tvshowtitle>"\
          "<year></year>"\
          "<season>%s</season>"\
          "</meta>"\
          "<link></link>"\
          "<thumbnail>%s</thumbnail>"\
          "<fanart></fanart>"\
          "</dir>" % (name, imdb, episodeURL, season, thumbnail)
    for imdb, season in match:
        if 'fallback' in imdb:
            pass
        else:
            thumbnail = re.compile(
                '<img alt=".+?Poster" title=".+?Poster"\nsrc="(.+?)"',
                re.DOTALL | re.IGNORECASE).findall(listhtml)[0]
            thumbnail = thumbnail.replace("@._V1_UY268_CR16,0,182,268_AL_.jpg",
                                          "@._V1_UX520_CR0,0,520,700_AL_.jpg")
            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>%s</thumbnail>"\
              "<fanart></fanart>"\
              "</dir>" % (name, imdb, episodeURL, season, thumbnail)
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #59
0
def sport_Replay_list():
    xml = ""
    at = Airtable('appWtf1GS8PBChZaN',
                  'Sports_replays',
                  api_key='keyOHaxsTGzHU9EEh')
    match = at.get_all(maxRecords=700, view='Grid view')
    results = re.compile(
        "link4': u'(.+?)'.+?link3': u'(.+?)'.+?link2': u'(.+?)'.+?fanart': u'(.+?)'.+?summary': u'(.+?)'.+?link': u'(.+?)'.+?thumbnail': u'(.+?)'.+?channel': u'(.+?)'",
        re.DOTALL).findall(str(match))
    for link4, link3, link2, fanart, summary, link, thumbnail, channel in results:
        channel = remove_non_ascii(channel)
        if link2 == "-":
            xml += "<item>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<meta>"\
                   "<thumbnail>%s</thumbnail>"\
                   "<fanart>%s</fanart>"\
                   "<summary></summary>"\
                   "</meta>"\
                   "<link>"\
                   "<sublink>%s</sublink>"\
                   "</link>"\
                   "</item>" % (channel,thumbnail,fanart,link)
        elif link3 == "-":
            xml += "<item>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<meta>"\
                   "<content>movie</content>"\
                   "<imdb></imdb>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<year></year>"\
                   "<thumbnail>%s</thumbnail>"\
                   "<fanart>%s</fanart>"\
                   "<summary></summary>"\
                   "</meta>"\
                   "<link>"\
                   "<sublink>%s</sublink>"\
                   "<sublink>%s</sublink>"\
                   "</link>"\
                   "</item>" % (channel,channel,thumbnail,fanart,link,link2)
        elif link4 == "-":
            xml += "<item>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<meta>"\
                   "<content>movie</content>"\
                   "<imdb></imdb>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<year></year>"\
                   "<thumbnail>%s</thumbnail>"\
                   "<fanart>%s</fanart>"\
                   "<summary></summary>"\
                   "</meta>"\
                   "<link>"\
                   "<sublink>%s</sublink>"\
                   "<sublink>%s</sublink>"\
                   "<sublink>%s</sublink>"\
                   "</link>"\
                   "</item>" % (channel,channel,thumbnail,fanart,link,link2,link3)
        else:
            xml += "<item>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<meta>"\
                   "<content>movie</content>"\
                   "<imdb></imdb>"\
                   "<title>[COLOR red]%s[/COLOR]</title>"\
                   "<year></year>"\
                   "<thumbnail>%s</thumbnail>"\
                   "<fanart>%s</fanart>"\
                   "<summary></summary>"\
                   "</meta>"\
                   "<link>"\
                   "<sublink>%s</sublink>"\
                   "<sublink>%s</sublink>"\
                   "<sublink>%s</sublink>"\
                   "<sublink>%s</sublink>"\
                   "</link>"\
                   "</item>" % (channel,channel,thumbnail,fanart,link,link2,link3,link4)

    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())
コード例 #60
0
def open_genre_movies(url):
    xml = ""
    genre = url.split("/")[-1]
    at = Airtable(table_id, table_name, api_key=workspace_api_key)
    try:
        match = at.search('type', genre)
        for field in match:
            res = field['fields']   
            name = res['name']
            name = remove_non_ascii(name)
            summary = res['summary']
            summary = remove_non_ascii(summary)
            fanart = res['fanart']
            thumbnail = res['thumbnail']
            link1 = res['link1']
            link2 = res['link2']
            link3 = res['link3']
            link4 = res['link4']
            link5 = res['link5'] 
            if link2 == "-":
                xml += "<item>"\
                     "<title>%s</title>"\
                     "<meta>"\
                     "<content>movie</content>"\
                     "<imdb></imdb>"\
                     "<title></title>"\
                     "<year></year>"\
                     "<thumbnail>%s</thumbnail>"\
                     "<fanart>%s</fanart>"\
                     "<summary>%s</summary>"\
                     "</meta>"\
                     "<link>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>(Trailer)</sublink>"\
                     "</link>"\
                     "</item>" % (name,thumbnail,fanart,summary,link1)
            elif link3 == "-":
                xml += "<item>"\
                     "<title>%s</title>"\
                     "<meta>"\
                     "<content>movie</content>"\
                     "<imdb></imdb>"\
                     "<title></title>"\
                     "<year></year>"\
                     "<thumbnail>%s</thumbnail>"\
                     "<fanart>%s</fanart>"\
                     "<summary>%s</summary>"\
                     "</meta>"\
                     "<link>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>(Trailer)</sublink>"\
                     "</link>"\
                     "</item>" % (name,thumbnail,fanart,summary,link1,link2) 
            elif link4 == "-":
                xml += "<item>"\
                     "<title>%s</title>"\
                     "<meta>"\
                     "<content>movie</content>"\
                     "<imdb></imdb>"\
                     "<title></title>"\
                     "<year></year>"\
                     "<thumbnail>%s</thumbnail>"\
                     "<fanart>%s</fanart>"\
                     "<summary>%s</summary>"\
                     "</meta>"\
                     "<link>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>(Trailer)</sublink>"\
                     "</link>"\
                     "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3)
            elif link5 == "-":
                xml += "<item>"\
                     "<title>%s</title>"\
                     "<meta>"\
                     "<content>movie</content>"\
                     "<imdb></imdb>"\
                     "<title></title>"\
                     "<year></year>"\
                     "<thumbnail>%s</thumbnail>"\
                     "<fanart>%s</fanart>"\
                     "<summary>%s</summary>"\
                     "</meta>"\
                     "<link>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>(Trailer)</sublink>"\
                     "</link>"\
                     "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3,link4)           
            else:
                xml += "<item>"\
                     "<title>%s</title>"\
                     "<meta>"\
                     "<content>movie</content>"\
                     "<imdb></imdb>"\
                     "<title></title>"\
                     "<year></year>"\
                     "<thumbnail>%s</thumbnail>"\
                     "<fanart>%s</fanart>"\
                     "<summary>%s</summary>"\
                     "</meta>"\
                     "<link>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>%s</sublink>"\
                     "<sublink>(Trailer)</sublink>"\
                     "</link>"\
                     "</item>" % (name,thumbnail,fanart,summary,link1,link2,link3,link4,link5)                   
    except:
        pass                  
    jenlist = JenList(xml)
    display_list(jenlist.get_list(), jenlist.get_content_type())