Пример #1
0
def Skin_String(menu, setting='Label'):
    final_list = {
        'comedy': 'Custom6HomeItem',
        'cooking': 'Custom3HomeItem',
        'fitness': 'Custom4HomeItem',
        'gaming': 'Custom5HomeItem',
        'kids': 'FavoritesHomeItem',
        'livetv': 'LiveTVHomeItem',
        'movies': 'MovieHomeItem',
        'news': 'ProgramsHomeItem',
        'sports': 'VideosHomeItem',
        'system': 'SettingsHomeItem',
        'technology': 'Custom2HomeItem',
        'travel': 'WeatherHomeItem',
        'tvshows': 'TVShowHomeItem',
        'world': 'PicturesHomeItem',
        'youtube': 'ShutdownHomeItem',
        'xxx': 'MusicVideoHomeItem'
    }

    home_menus = eval(
        Addon_Setting(addon_id='plugin.program.tbs', setting='home_menus'))
    mysettings = home_menus[menu]
    if mysettings[0].startswith('String('):
        menu_name = eval(mysettings[0])
    else:
        menu_name = mysettings[0]
    return menu_name
Пример #2
0
# plugin.program.tbs
# Total Revolution Maintenance (c) by whufclee ([email protected])

# Total Revolution Maintenance is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

# You should have received a copy of the license along with this
# work. If not, see http://creativecommons.org/licenses/by-nc-nd/4.0.

import os
import xbmc

from koding import dolog, Addon_Setting, Text_File
#---------------------------------------------------------------------------------------------------
AddonID = 'plugin.program.tbs'
cachecheck = Addon_Setting('cleancache')
flashsplash = '/flash/oemsplash.png'
newsplash = xbmc.translatePath('special://home/media/branding/Splash.png')
#---------------------------------------------------------------------------------------------------
if cachecheck == 'true':
    xbmc.executebuiltin(
        'XBMC.AlarmClock(cleancacheloop,XBMC.RunScript(special://home/addons/%s/cleancache.py,silent=true),12:00:00,silent,loop)'
        % AddonID)

# Update the boot screen splash
if os.path.exists(flashsplash):
    flashsize = os.path.getsize(flashsplash)
else:
    flashsize = 0

if os.path.exists(newsplash):
Пример #3
0
# -*- coding: utf-8 -*-

# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)

import urllib, urllib2, sys, re, os, unicodedata
import xbmc, xbmcgui, xbmcplugin, xbmcaddon, xbmcvfs

from koding import route, Addon_Setting, Add_Dir, Find_In_Text, Open_URL, OK_Dialog
from koding import Open_Settings, Play_Video, Run, Text_File

from resources.lib.modules.docula import *

debug = Addon_Setting(setting='debug')
addon_id = xbmcaddon.Addon().getAddonInfo('id')
artAddon = 'script.j1.artwork'

selfAddon = xbmcaddon.Addon(id=addon_id)
datapath = xbmc.translatePath(selfAddon.getAddonInfo('profile'))
plugin_handle = int(sys.argv[1])
dialog = xbmcgui.Dialog()
mysettings = xbmcaddon.Addon(id='plugin.video.docula')
profile = mysettings.getAddonInfo('profile')
home = mysettings.getAddonInfo('path')
fanart = xbmc.translatePath(os.path.join(home, 'fanart.jpg'))
icon = xbmc.translatePath(os.path.join(home, 'icon.png'))
mediapath = 'http://j1wizard.net/media/'
path = xbmcaddon.Addon().getAddonInfo('path').decode("utf-8")


@route(mode='main')
def Main():
Пример #4
0
# import re           # allows use of regex commands, if you're intending on scraping you'll need this
# import xbmcgui      # gui based functions, contains things like creating dialog pop-up windows

from koding import route, Add_Dir, Addon_Setting, Data_Type, Find_In_Text
from koding import Open_URL, OK_Dialog, Open_Settings, Play_Video, Run, Text_File

#----------------------------------------------------------------
"""
    SECTION 4:
    These are our global variables, anything we set here can be accessed by any of
    our functions later on. Please bare in mind though that if you change the value
    of a global variable from inside a function the value will revert back to the
    value set here once that function has completed.
"""
debug = Addon_Setting(
    setting='debug')  # Grab the setting of our debug mode in add-on settings
addon_id = xbmcaddon.Addon().getAddonInfo('id')  # Grab our add-on id
home = xbmc.translatePath(
    'special://home')  # Set the path of the home Kodi folder

# Our master XML we want to load up
#main_xml     = 'https://benolux.fr/kodi/xml/main%20menu.xml'

# Alternatively you could set a local XML but online obviously means less add-on updates to push
main_xml = os.path.join(home, 'addons', addon_id, 'resources', 'playlist',
                        'images.xml', 'video.xml')

#----------------------------------------------------------------
"""
    SECTION 5:
    Add our custom functions in here, it's VERY important these go in this section
Пример #5
0
# plugin.program.tbs
# Total Revolution Maintenance (c) by TOTALREVOLUTION LTD ([email protected])

# Total Revolution Maintenance is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

# You should have received a copy of the license along with this
# work. If not, see http://creativecommons.org/licenses/by-nc-nd/4.0.

import os
import xbmc

from koding import Addon_Setting, Open_Settings, OK_Dialog, String

storage_path = Addon_Setting('zip')
path = xbmc.translatePath(os.path.join(storage_path, 'testfolder'))


def check(direct):
    try:
        os.makedirs(path)
        os.removedirs(path)
        OK_Dialog(String(30334), String(30335))
        if direct != 'maintenance':
            Open_Settings()

    except:
        OK_Dialog(String(30336), String(30337))
        Open_Settings()
Пример #6
0
channel_xml = os.path.join(resources, 'chan.xml')
addremove_file = os.path.join(resources, '-_ADD_OR_REMOVE_CHANNELS')
addremove = os.path.join(chanpath, '-_ADD_OR_REMOVE_CHANNELS')
addremove_png = os.path.join(resources, 'add_remove.png')
addremove_dst = os.path.join(logopack_colour, '-_ADD_OR_REMOVE_CHANNELS.png')
xmlmaster = os.path.join(resources, 'chan.xml')
catsmaster = os.path.join(resources, 'cats.xml')
chanxml = os.path.join(datapath, 'chan.xml')
catsxml = os.path.join(datapath, 'cats.xml')
updateicon = os.path.join(ADDONS, AddonID, 'resources', 'update.png')
metalliq_ini_d = os.path.join(ADDONS, AddonID, 'resources', 'metalliq.ini')
metalliq_ini_l = os.path.join(datapath, 'ini', 'metalliq.ini')
dialog = xbmcgui.Dialog()
dp = xbmcgui.DialogProgress()

showSFchannels = Addon_Setting(setting='showSFchannels')
syncartwork = Addon_Setting(setting='syncartwork')
sf_channels = Addon_Setting(setting='SF_CHANNELS')
add_sf_items = Addon_Setting(setting='add_sf_items')
sf_metalliq = Addon_Setting(setting='SF_METALLIQ')
firstrun = Addon_Setting(setting='FIRSTRUN')
sf_folder = Addon_Setting(setting='FOLDER')

cont = 1


#--------------------------------------------------------------------
# Run the update command to make sure all files are downloaded
def Check_Updates():
    try:
        xbmc.executebuiltin(
Пример #7
0
from koding import dolog, converthex, Addon_Genre, Addon_Setting, Keyboard, String, System, Text_File

if os.path.exists(
        xbmc.translatePath(
            'special://home/userdata/addon_data/script.trtv/skip.txt')):
    tvgskip = 1
else:
    tvgskip = 0

dialog = xbmcgui.Dialog()
success = True
runcode = ''
redirects = xbmc.translatePath(
    'special://home/userdata/addon_data/plugin.program.tbs/redirects')
ADDONS = xbmc.translatePath('special://home/addons')
BASE = Addon_Setting(addon_id='script.openwindow', setting='base')
BASE2 = '687474703a2f2f6e6f6f6273616e646e657264732e636f6d2f'
settings_clean = sys.argv[1].replace('_DIALOG_PLUS_USER', '').replace(
    '_DIALOG_USER', '').replace('_EXEC_USER', '').replace('_SF', '')

# If it's a home menu convert addon setting into redirect file
if sys.argv[1].startswith('HOME_'):
    redirect_setting = Addon_Setting(setting=settings_clean,
                                     addon_id='plugin.program.tbs')
    if redirect_setting == 'tvg_dialog_plus':
        redirect_setting = sys.argv[1] + '_TVG_DIALOG_PLUS'
    elif redirect_setting == 'dialog_plus':
        redirect_setting = sys.argv[1] + '_DIALOG_PLUS'
    elif redirect_setting == 'dialog':
        redirect_setting = sys.argv[1] + '_DIALOG'
    elif redirect_setting == 'executable':
Пример #8
0
# plugin.program.tbs
# Total Revolution Maintenance (c) by whufclee ([email protected])

# Total Revolution Maintenance is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

# You should have received a copy of the license along with this
# work. If not, see http://creativecommons.org/licenses/by-nc-nd/4.0.

import os

from koding import dolog, converthex, Addon_Setting
from default import Grab_Updates, Check_My_Shares

start_option = 'normal'
BASE = Addon_Setting(addon_id='script.openwindow', setting='base')
mastercheck = Addon_Setting('master')

try:
    if sys.argv[1] == 'shares' and mastercheck == 'false':
        start_option = 'shares'
except:
    start_option = 'normal'

if start_option == 'shares':
    dolog('### Checking for any updated local shares')
    Check_My_Shares()

else:
    dolog('### checknews initiated, checking for updates')
    Grab_Updates(
Пример #9
0
# script.openwindow
# Startup Wizard (c) by TOTALREVOLUTION LTD ([email protected])

# Total Revolution Startup Wizard is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

# You should have received a copy of the license along with this
# work. If not, see http://creativecommons.org/licenses/by-nc-nd/4.0.

import xbmc
import os

from koding import Addon_Setting, Physical_Path

AddonID = 'script.openwindow'
sleep = Addon_Setting('sleep')
offline = Addon_Setting('offline')
PROFILE = Physical_Path('special://profile')
OPENWINDOW_DATA = os.path.join(PROFILE, 'addon_data', AddonID)
NON_REGISTERED = os.path.join(OPENWINDOW_DATA, 'unregistered')
Addon_Setting(addon_id='script.openwindow',
              setting='base',
              value='http://totalrevolution.xyz/')

autoexec = xbmc.translatePath('special://profile/autoexec.py')
if os.path.exists(autoexec):
    readfile = open(autoexec, 'r')
    contents = readfile.read()
    readfile.close()
    if 'RUN_WIZARD' in contents:
        os.remove(autoexec)