PK ;VKY~ ~ plugin.video.kidsnation/addon.py#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. - Muad'Dib
# ----------------------------------------------------------------------------
#######################################################################
# Addon Name: Kids Nation
# Addon id: plugin.video.kidsnation
# Addon Provider: MuadDib
#######################################################################
#Import Modules Section
import urllib, urllib2, re, xbmcplugin, xbmcgui, os, sys, datetime
from resources.lib.glo_var import *
from resources.lib.menu import *
from resources.lib.tools import *
#######################################################################
###################################################################################
# Categories/Default Menu
def Main_Menu():
addMenuItem('[COLOR springgreen][B]News and Updates[/B][/COLOR]', 'popup', 101, DEFAULTICON, DEFAULTFANART)
addMenuItem('[COLOR snow][B]Tools[/B][/COLOR]', 'tools', 150, DEFAULTICON, DEFAULTFANART)
addSectionItem(' ', DEFAULTBLANK, DEFAULTFANART)
menuItems = processMenuFile(MAINMENUFILE)
for name,section,searchid,subid,playlistid,channelid,videoid,iconimage,fanart,description in menuItems:
if not subid == 'false': # Means this item points to a submenu
url = subid
addMenuItem(name, url, 50, iconimage, fanart, description)
elif not searchid == 'false': # Means this is a search term
addSearchItem(name, searchid, iconimage, fanart)
elif not videoid == 'false': # Means this is a video id entry
addVideoItem(name, videoid, iconimage, fanart)
elif not channelid == 'false': # Means this is a channel id entry
addChannelItem(name, channelid, iconimage, fanart)
elif not playlistid == 'false': # Means this is a playlist id entry
addPlaylistItem(name, playlistid, iconimage, fanart)
elif not section == 'false': # Means this is a section placeholder/info line
addSectionItem(name, DEFAULTBLANK, DEFAULTFANART)
xbmc.executebuiltin('Container.SetViewMode(50)')
###################################################################################
###################################################################################
# Sub Menu
def Sub_Menu(subid):
thisMenuFile = BASEURL + subid + '.txt'
menuItems = processMenuFile(thisMenuFile)
for name,section,searchid,subid,playlistid,channelid,videoid,iconimage,fanart,description in menuItems:
if not subid == 'false': # Means this item points to a submenu
url = subid
addMenuItem(name, url, 50, iconimage, fanart, description)
elif not searchid == 'false': # Means this is a search term
addSearchItem(name, searchid, iconimage, fanart)
elif not videoid == 'false': # Means this is a video id entry
addVideoItem(name, videoid, iconimage, fanart)
elif not channelid == 'false': # Means this is a channel id entry
addChannelItem(name, channelid, iconimage, fanart)
elif not playlistid == 'false': # Means this is a playlist id entry
addPlaylistItem(name, playlistid, iconimage, fanart)
elif not section == 'false': # Means this is a section placeholder/info line
addSectionItem(name, DEFAULTBLANK, DEFAULTFANART)
xbmc.executebuiltin('Container.SetViewMode(50)')
###################################################################################
###################################################################################
# Tools Menu
def Tools_Menu():
addMenuItem('Apply ' + ADDONTITLE + ' API to YouTube (Daily Limit Fix)', 'dailylimit', 151, DEFAULTICON, DEFAULTFANART)
addSectionItem(' ', DEFAULTBLANK, DEFAULTFANART)
xbmc.executebuiltin('Container.SetViewMode(50)')
###################################################################################
#######################################################################
# News and Update Code
def Update_News():
message=open_news_url(NEWSFILE)
localnewsfile = os.path.join(KNADDONPATH, 'whatsnew.txt')
r = open(localnewsfile)
compfile = r.read()
if len(message)>1:
if compfile == message:pass
else:
text_file = open(localnewsfile, "w")
text_file.write(message)
text_file.close()
compfile = message
showText('[B][COLOR springgreen]Latest Updates and Information[/COLOR][/B]', compfile)
def open_news_url(url):
req = urllib2.Request(url)
req.add_header('User-Agent', 'klopp')
response = urllib2.urlopen(req)
link=response.read()
response.close()
print link
return link
def showText(heading, text):
id = 10147
xbmc.executebuiltin('ActivateWindow(%d)' % id)
xbmc.sleep(500)
win = xbmcgui.Window(id)
retry = 50
while (retry > 0):
try:
xbmc.sleep(10)
retry -= 1
win.getControl(1).setLabel(heading)
win.getControl(5).setText(text)
quit()
return
except: pass
#######################################################################
def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (params[len(params)-1]=='/'):
params=params[0:len(params)-2]
pairsofparams=cleanedparams.split('&')
param={}
for i in range(len(pairsofparams)):
splitparams={}
splitparams=pairsofparams[i].split('=')
if (len(splitparams))==2:
param[splitparams[0]]=splitparams[1]
return param
params=get_params()
url=None
name=None
mode=None
iconimage=None
page = None
token = None
try: url=urllib.unquote_plus(params["url"])
except: pass
try: name=urllib.unquote_plus(params["name"])
except: pass
try: mode=int(params["mode"])
except:
try:
mode=params["mode"]
except: pass
try: iconimage=urllib.unquote_plus(params["iconimage"])
except: pass
try: token=urllib.unquote_plus(params["token"])
except: token=0
try: page=int(params["page"])
except: page = 1
if mode==None or url==None or len(url)<1:
Main_Menu() # Duh
elif mode==50:
Sub_Menu(url) # Derka
elif mode==100:
pass # Placeholder, no action as this is for "Section" or "Info Text" used in menu lines
elif mode==101:
Update_News() # In today's news, an increase in sandworm attacks
elif mode==150:
Tools_Menu() # Load Tools Menu
elif mode==151:
Apply_API() # Apply Custom API To YouTube for this Addon
xbmcplugin.endOfDirectory(int(sys.argv[1]))
PK W)L ! plugin.video.kidsnation/addon.xml
video
en
Top content aimed at learning and development for children.
No Content Is Hosted By Us. Any Issues With The Add-On Or You Have A Request Hit Me Up On Twitter
The author does not own or host any content found within this Addon. The author is not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation.
kids
all
PK TK e % plugin.video.kidsnation/changelog.txtv0.0.3
Added Tools menu with Kid Nation API Fix
v0.0.2a
Fixed issue for submenu creation where menus are 2 or more deep
v0.0.1
Initial ReleasePK ty\K5(
(
" plugin.video.kidsnation/fanart.jpgExif MM * b j( 1 r2 i x ' x 'Adobe Photoshop CS6 (Windows) 2017:10:28 15:11:36 8 &( . H H Adobe_CM Adobe d
Z "
?
3 !1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw 5 !1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ? *[+ `4K 7.9T:u2,csKe5ߢQ#tj)p+{ovI%Vkmw9j<4p$Li|}*:F>>KX+Hֺ~[i{{l@alk{]D~ѰN5$б$nm͊TunE6{1}ŀ;Y|}du Qh4uq2sntly;c1?e,<6c{ȫ)X-
{mL}TQʵʋkkmm3ޭtLl\\[9HsL?7齈nƦ+! QzUWێ\V2,!HuK+}q۱Xwmf +T 3_Q̳ۺOkbEV_-և3~ { " _Mum5q_u{4j罿,l,eF MѻTnrohkv
.۽c5cz0.}e4C`
=!ZtŬ@0&ҠE0O
"؍Sm
P jBhP0qGUGB1(ZRǸ
oOzBX_>)x
sD7Jn4]OMwY ]ֻuQW\nK߲̿T 5zp"W$CGͩ3!hpm0ǵ1gc*kX}9kK "n2^n\|Unsj ~r Ǵwnh#"VɁ.0;y
Vnv=l ZM!o;>œv]-n0iE{quN{7mkǵftN-~9euMuQe~XWe?ٽIG䄌ڻ .?vzkfl(QK)2vVΦ" =eUm
A4^]UƉs` ^)qqg2 @d"dR(Ę1xtIU`T4nl\'jݐݶAOoS\4v跃'b_zM=16 GcWzY_gk*P&oZy"}{1 dGa13" Їo]Ȼ2j{\~3evYW;(n^`^\.wmS_Kҷ5阤f9<\ =W:n--?{k`*_<+2r2H:D~|q|[y!S66gnvzԬFnKX\U_U85
=7
sCgߏ;y?@b|9\|z] 4 A |{VeXFhn]7?VnN