コード例 #1
0
ファイル: db_utils.py プロジェクト: c0ns0le/YCBuilds
 def init_database(self, db_version):
     try:
         cur_version = kodi.get_version()
         if db_version is not None and cur_version != db_version:
             log_utils.log('DB Upgrade from %s to %s detected.' % (db_version, cur_version))
             self.progress = xbmcgui.DialogProgress()
             self.progress.create('SALTS', line1='Migrating from %s to %s' % (db_version, cur_version), line2='Saving current data.')
             self.progress.update(0)
             self.__prep_for_reinit()
 
         log_utils.log('Building SALTS Database', log_utils.LOGDEBUG)
         if self.db_type == DB_TYPES.MYSQL:
             self.__execute('CREATE TABLE IF NOT EXISTS url_cache (url VARBINARY(%s) NOT NULL, data VARBINARY(%s) NOT NULL, response MEDIUMBLOB, res_header TEXT, timestamp TEXT, PRIMARY KEY(url, data))' % (MYSQL_URL_SIZE, MYSQL_DATA_SIZE))
             self.__execute('CREATE TABLE IF NOT EXISTS function_cache (name VARCHAR(255) NOT NULL, args VARCHAR(64), result MEDIUMBLOB, timestamp TEXT, PRIMARY KEY(name, args))')
             self.__execute('CREATE TABLE IF NOT EXISTS db_info (setting VARCHAR(255) NOT NULL, value TEXT, PRIMARY KEY(setting))')
             self.__execute('CREATE TABLE IF NOT EXISTS rel_url \
             (video_type VARCHAR(15) NOT NULL, title VARCHAR(255) NOT NULL, year VARCHAR(4) NOT NULL, season VARCHAR(5) NOT NULL, episode VARCHAR(5) NOT NULL, source VARCHAR(49) NOT NULL, rel_url VARCHAR(255), \
             PRIMARY KEY(video_type, title, year, season, episode, source))')
             self.__execute('CREATE TABLE IF NOT EXISTS other_lists (section VARCHAR(10) NOT NULL, username VARCHAR(68) NOT NULL, slug VARCHAR(255) NOT NULL, name VARCHAR(255), \
             PRIMARY KEY(section, username, slug))')
             self.__execute('CREATE TABLE IF NOT EXISTS saved_searches (id INTEGER NOT NULL AUTO_INCREMENT, section VARCHAR(10) NOT NULL, added DOUBLE NOT NULL,query VARCHAR(255) NOT NULL, \
             PRIMARY KEY(id))')
             self.__execute('CREATE TABLE IF NOT EXISTS bookmark (slug VARCHAR(255) NOT NULL, season VARCHAR(5) NOT NULL, episode VARCHAR(5) NOT NULL, resumepoint DOUBLE NOT NULL, \
             PRIMARY KEY(slug, season, episode))')
         else:
             self.__create_sqlite_db()
             self.__execute('PRAGMA journal_mode=WAL')
             self.__execute('CREATE TABLE IF NOT EXISTS url_cache (url VARCHAR(255) NOT NULL, data VARCHAR(255), response, res_header, timestamp, PRIMARY KEY(url, data))')
             self.__execute('CREATE TABLE IF NOT EXISTS function_cache (name VARCHAR(255) NOT NULL, args VARCHAR(64), result, timestamp, PRIMARY KEY(name, args))')
             self.__execute('CREATE TABLE IF NOT EXISTS db_info (setting VARCHAR(255), value TEXT, PRIMARY KEY(setting))')
             self.__execute('CREATE TABLE IF NOT EXISTS rel_url \
             (video_type TEXT NOT NULL, title TEXT NOT NULL, year TEXT NOT NULL, season TEXT NOT NULL, episode TEXT NOT NULL, source TEXT NOT NULL, rel_url TEXT, \
             PRIMARY KEY(video_type, title, year, season, episode, source))')
             self.__execute('CREATE TABLE IF NOT EXISTS other_lists (section TEXT NOT NULL, username TEXT NOT NULL, slug TEXT NOT NULL, name TEXT, PRIMARY KEY(section, username, slug))')
             self.__execute('CREATE TABLE IF NOT EXISTS saved_searches (id INTEGER PRIMARY KEY, section TEXT NOT NULL, added DOUBLE NOT NULL,query TEXT NOT NULL)')
             self.__execute('CREATE TABLE IF NOT EXISTS bookmark (slug TEXT NOT NULL, season TEXT NOT NULL, episode TEXT NOT NULL, resumepoint DOUBLE NOT NULL, \
             PRIMARY KEY(slug, season, episode))')
 
         # reload the previously saved backup export
         if db_version is not None and cur_version != db_version:
             log_utils.log('Restoring DB from backup at %s' % (self.mig_path), log_utils.LOGDEBUG)
             self.import_into_db(self.mig_path)
             log_utils.log('DB restored from %s' % (self.mig_path))
 
         sql = 'REPLACE INTO db_info (setting, value) VALUES(?,?)'
         self.__execute(sql, ('version', kodi.get_version()))
     finally:
         if self.progress is not None:
             self.progress.close()
コード例 #2
0
 def init_database(self, db_version):
     try:
         cur_version = kodi.get_version()
         if db_version is not None and cur_version != db_version:
             log_utils.log('DB Upgrade from %s to %s detected.' % (db_version, cur_version))
             self.progress = xbmcgui.DialogProgress()
             self.progress.create('SALTS', line1='Migrating from %s to %s' % (db_version, cur_version), line2='Saving current data.')
             self.progress.update(0)
             self.__prep_for_reinit()
 
         log_utils.log('Building SALTS Database', log_utils.LOGDEBUG)
         if self.db_type == DB_TYPES.MYSQL:
             self.__execute('CREATE TABLE IF NOT EXISTS url_cache (url VARBINARY(%s) NOT NULL, data VARBINARY(%s) NOT NULL, response MEDIUMBLOB, res_header TEXT, timestamp TEXT, PRIMARY KEY(url, data))' % (MYSQL_URL_SIZE, MYSQL_DATA_SIZE))
             self.__execute('CREATE TABLE IF NOT EXISTS function_cache (name VARCHAR(255) NOT NULL, args VARCHAR(64), result MEDIUMBLOB, timestamp TEXT, PRIMARY KEY(name, args))')
             self.__execute('CREATE TABLE IF NOT EXISTS db_info (setting VARCHAR(255) NOT NULL, value TEXT, PRIMARY KEY(setting))')
             self.__execute('CREATE TABLE IF NOT EXISTS rel_url \
             (video_type VARCHAR(15) NOT NULL, title VARCHAR(255) NOT NULL, year VARCHAR(4) NOT NULL, season VARCHAR(5) NOT NULL, episode VARCHAR(5) NOT NULL, source VARCHAR(49) NOT NULL, rel_url VARCHAR(255), \
             PRIMARY KEY(video_type, title, year, season, episode, source))')
             self.__execute('CREATE TABLE IF NOT EXISTS other_lists (section VARCHAR(10) NOT NULL, username VARCHAR(68) NOT NULL, slug VARCHAR(255) NOT NULL, name VARCHAR(255), \
             PRIMARY KEY(section, username, slug))')
             self.__execute('CREATE TABLE IF NOT EXISTS saved_searches (id INTEGER NOT NULL AUTO_INCREMENT, section VARCHAR(10) NOT NULL, added DOUBLE NOT NULL,query VARCHAR(255) NOT NULL, \
             PRIMARY KEY(id))')
             self.__execute('CREATE TABLE IF NOT EXISTS bookmark (slug VARCHAR(255) NOT NULL, season VARCHAR(5) NOT NULL, episode VARCHAR(5) NOT NULL, resumepoint DOUBLE NOT NULL, \
             PRIMARY KEY(slug, season, episode))')
         else:
             self.__create_sqlite_db()
             self.__execute('PRAGMA journal_mode=WAL')
             self.__execute('CREATE TABLE IF NOT EXISTS url_cache (url VARCHAR(255) NOT NULL, data VARCHAR(255), response, res_header, timestamp, PRIMARY KEY(url, data))')
             self.__execute('CREATE TABLE IF NOT EXISTS function_cache (name VARCHAR(255) NOT NULL, args VARCHAR(64), result, timestamp, PRIMARY KEY(name, args))')
             self.__execute('CREATE TABLE IF NOT EXISTS db_info (setting VARCHAR(255), value TEXT, PRIMARY KEY(setting))')
             self.__execute('CREATE TABLE IF NOT EXISTS rel_url \
             (video_type TEXT NOT NULL, title TEXT NOT NULL, year TEXT NOT NULL, season TEXT NOT NULL, episode TEXT NOT NULL, source TEXT NOT NULL, rel_url TEXT, \
             PRIMARY KEY(video_type, title, year, season, episode, source))')
             self.__execute('CREATE TABLE IF NOT EXISTS other_lists (section TEXT NOT NULL, username TEXT NOT NULL, slug TEXT NOT NULL, name TEXT, PRIMARY KEY(section, username, slug))')
             self.__execute('CREATE TABLE IF NOT EXISTS saved_searches (id INTEGER PRIMARY KEY, section TEXT NOT NULL, added DOUBLE NOT NULL,query TEXT NOT NULL)')
             self.__execute('CREATE TABLE IF NOT EXISTS bookmark (slug TEXT NOT NULL, season TEXT NOT NULL, episode TEXT NOT NULL, resumepoint DOUBLE NOT NULL, \
             PRIMARY KEY(slug, season, episode))')
 
         # reload the previously saved backup export
         if db_version is not None and cur_version != db_version:
             log_utils.log('Restoring DB from backup at %s' % (self.mig_path), log_utils.LOGDEBUG)
             self.import_into_db(self.mig_path)
             log_utils.log('DB restored from %s' % (self.mig_path))
 
         sql = 'REPLACE INTO db_info (setting, value) VALUES(?,?)'
         self.__execute(sql, ('version', kodi.get_version()))
     finally:
         if self.progress is not None:
             self.progress.close()
コード例 #3
0
ファイル: default.py プロジェクト: AsvpArchie/daisy_tulip
def main(argv=None):
    if sys.argv: argv = sys.argv
    logger.log('Version: |%s|' % (kodi.get_version()))
    logger.log('Args: |%s|' % (argv))
    title = None
    year = None
    media_type = __get_media_type()
    path = xbmc.getInfoLabel('ListItem.FileNameAndPath')
    if not path:
        path = xbmc.getInfoLabel('ListItem.Path')

    # assume this is a widget if we couldn't get a path infolabel
    if not path:
        filename = sys.listitem.getfilename()  # @UndefinedVariable
        title = sys.listitem.getVideoInfoTag().getTitle()  # @UndefinedVariable
        year = sys.listitem.getVideoInfoTag().getYear()  # @UndefinedVariable
        if filename.startswith('videodb://'):
            media_type, path = __get_widget_details(filename, title, year)

    if __is_salts_listitem(path):
        dialog = xbmcgui.Dialog()
        tools = __get_tools(path, media_type, title, year)
        try:
            ret = dialog.contextmenu([i[0] for i in tools])
        except:
            ret = dialog.select('SALTS Tools', [i[0] for i in tools])
        if ret > -1:
            tools[ret][1](*tools[ret][2])
    else:
        kodi.notify(msg='Not a SALTS Library Item')
コード例 #4
0
def mainMenu():

    try:
        run = client.request(base64.b64decode('aHR0cDovL2JiYy5pbi8yd2MzYTho'))
    except:
        pass

    art = xbmc.translatePath(
        os.path.join(
            'special://home/addons/script.xxxodus.artwork/resources/art/',
            'main/%s.png'))

    dirlst = []
    c = []

    c += [
         (kodi.giveColor('Welcome to XXX-O-DUS Version %s' % kodi.get_version() ,'blue',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'icon','All issues must be reported at https://github.com/echocoderxbmc/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         (kodi.giveColor(kodi.countGitHubIssues('https://github.com/echocoderxbmc/plugin.video.xxx-o-dus/issues'),'blue',True) + kodi.giveColor(' | Click To View Issues','white',True),None,34,'report','All issues must be reported at https://github.com/echocoderxbmc/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         ('Search...',None,29,'search','Search XXX-O-DUS',True), \
         ('Live Cams',None,37,'webcams','Live Cams',True), \
         ('Tubes',None,4,'tubes','Videos',True), \
         ('Scenes',None,36,'scenes','XXX Scenes',True), \
         ('Movies',None,43,'movies','XXX Movies',True), \
         ('Virtual Reality',None,42,'vr','XXX Virtual Reality',True), \
         ('Hentai',None,39,'hentai','Hentai',True), \
         ('Vintage',None,270,'vintage','Vintage',True), \
         ('Fetish',None,40,'fetish','Fetish',True), \
         ('Pictures',None,35,'pics','Pictures',True), \
         ('Comics',None,41,'comics','Comics',True), \
         ('Parental Controls',None,5,'parental_controls','View/Change Parental Control Settings.',True), \
         ('Your History',None,20,'history','View Your History.',True), \
         ('Your Favourites',None,23,'favourites','View Your Favourites.',True), \
         ('Your Downloads',None,27,'downloads','View Your Downloads.',True), \
         ('Your Settings',None,19,'settings','View/Change Addon Settings.',False), \
         ('View Disclaimer',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/disclaimer.txt')),17,'disclaimer','View XXX-O-DUS Disclaimer.',False), \
         ('View Addon Information',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'addon_info','View XXX-O-DUS Information.',False), \
         ('View Changelog',xbmc.translatePath(os.path.join(kodi.addonfolder, 'changelog.txt')),17,'changelog','View XXX-O-DUS Changelog.',False), \
         ('Debug Versions',None,45,'addon_info','View the versions of XXXODUS and its dependencies for debugging.',True), \
         ('RESET XXX-O-DUS',None,18,'reset','Reset XXX-O-DUS to Factory Settings.',False), \
         (kodi.giveColor('Report Issues @ https://github.com/echocoderxbmc/plugin.video.xxx-o-dus/issues','violet',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'report','All issues must be reported at https://github.com/echocoderxbmc/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         ]

    for i in c:
        icon = art % i[3]
        fanart = kodi.addonfanart
        dirlst.append({
            'name': kodi.giveColor(i[0], 'white'),
            'url': i[1],
            'mode': i[2],
            'icon': icon,
            'fanart': fanart,
            'description': i[4],
            'folder': i[5]
        })

    buildDirectory(dirlst, cache=False)
コード例 #5
0
def _update_db():
    db_ver = None
    if xbmcvfs.exists(DB_PATH):
        db_connection = db_utils.DBCache(DB_PATH)
        db_ver = db_connection.get_setting('db_version')
        db_connection.close()

    if db_ver != kodi.get_version():
        try:
            zip_path = os.path.join(kodi.translate_path(kodi.get_path()),
                                    'tmdb_cache.zip')
            zip_file = zipfile.ZipFile(zip_path, 'r')
            zip_file.extract(DB_NAME, DB_FOLDER)
            db_connection = db_utils.DBCache(DB_PATH)
            db_connection.set_setting('db_version', kodi.get_version())
        finally:
            try:
                zip_file.close()
            except UnboundLocalError:
                pass
コード例 #6
0
def main(argv=None):
    if sys.argv:
        argv = sys.argv
    queries = kodi.parse_query(sys.argv[2])
    log_utils.log(
        'Version: |%s| Queries: |%s|' % (kodi.get_version(), queries),
        log_utils.LOGDEBUG)
    log_utils.log('Args: |%s|' % argv, log_utils.LOGDEBUG)

    mode = queries.get('mode', None)
    DISPATCHER.dispatch(mode, queries)
コード例 #7
0
def mainMenu():

    art = translatePath(
        os.path.join(
            'special://home/addons/script.xxxodus.artwork/resources/art/',
            'main/%s.png'))
    popup()
    dirlst = []
    c = []
    c += [
         (kodi.giveColor('Welcome to XXX-O-DUS Version %s' % kodi.get_version() ,'blue',True),translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'icon','Original Code by EchoCoder, Please Report All issues to @Nemzzy668',False), \
         (kodi.giveColor('Official Version Now Maintained By [COLOR yellow]@Nemzzy668[/COLOR]','blue',True),translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'icon','Please Report any issues to @Nemzzy668 On Twitter',False), \
         ('[COLOR yellow]View Changelog[/COLOR]',translatePath(os.path.join(kodi.addonfolder, 'changelog.txt')),17,'changelog','View XXX-O-DUS Changelog.',False), \
         ('[COLOR orange]Check XXX-O-DUS Health',None,46,'icon','Versions',True), \
         ('Search...',None,29,'search','Search XXX-O-DUS',True), \
         ('[COLOR pink]Live Cams',None,37,'webcams','Live Cams',True), \
         ('[COLOR pink]Tubes',None,4,'tubes','Videos',True), \
         #('[COLOR pink]Scenes',None,36,'scenes','XXX Scenes',True), \
         ('[COLOR pink]Movies',None,43,'movies','XXX Movies',True), \
         #('[COLOR pink]Films With Sex In',None,48,'sexfilms','Videos',True), \
         ('[COLOR pink]Virtual Reality',None,42,'vr','XXX Virtual Reality',True), \
         ('[COLOR pink]Hentai',None,39,'hentai','Hentai',True), \
         #('Vintage',None,270,'vintage','Vintage',True), \
         #('[COLOR pink]Fetish',None,40,'fetish','Fetish',True), \
         ('[COLOR pink]Pictures',None,35,'pics','Pictures',True), \
         ('[COLOR pink]For Gay Men',None,47,'gaymen','Videos',True), \
         #('Comics',None,41,'comics','Comics',True), \
         ('[COLOR red]Parental Controls',None,5,'parental_controls','View/Change Parental Control Settings.',True), \
         ('[COLOR red]Your History',None,20,'history','View Your History.',True), \
         ('[COLOR red]Your Favourites',None,23,'favourites','View Your Favourites.',True), \
         ('[COLOR red]Your Downloads',None,27,'downloads','View Your Downloads.',True), \
         ('[COLOR red]Your Settings',None,19,'settings','View/Change Addon Settings.',False), \
         #('View Disclaimer',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/disclaimer.txt')),17,'disclaimer','View XXX-O-DUS Disclaimer.',False), \
         #('View Addon Information',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'addon_info','View XXX-O-DUS Information.',False), \
         #('Debug Versions',None,45,'addon_info','View the versions of XXXODUS and its dependencies for debugging.',True), \
         ('RESET XXX-O-DUS',None,18,'reset','Reset XXX-O-DUS to Factory Settings.',False), \
         #(kodi.giveColor('Report Issues @ https://github.com/Colossal1/plugin.video.xxx-o-dus/issues','violet',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'report','All issues must be reported at https://github.com/Colossal1/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         ]

    for i in c:
        icon = art % i[3]
        fanart = kodi.addonfanart
        dirlst.append({
            'name': kodi.giveColor(i[0], 'white'),
            'url': i[1],
            'mode': i[2],
            'icon': icon,
            'fanart': fanart,
            'description': i[4],
            'folder': i[5]
        })
    #dialog.ok("DIRLIST",str(dirlst))
    buildDirectory(dirlst, cache=False)
コード例 #8
0
ファイル: default.py プロジェクト: tknorris/Link-Tester
def main(argv=None):
    if sys.argv: argv = sys.argv
    queries = kodi.parse_query(sys.argv[2])
    log_utils.log('Version: |%s| Queries: |%s|' % (kodi.get_version(), queries))
    log_utils.log('Args: |%s|' % (argv))

    # don't process params that don't match our url exactly. (e.g. plugin://plugin.video.1channel/extrafanart)
    plugin_url = 'plugin://%s/' % (kodi.get_id())
    if argv[0] != plugin_url:
        return

    mode = queries.get('mode', None)
    url_dispatcher.dispatch(mode, queries)
コード例 #9
0
def main(argv=None):
    if sys.argv: argv = sys.argv
    queries = kodi.parse_query(sys.argv[2])
    logger.log('Version: |%s| Queries: |%s|' % (kodi.get_version(), queries))
    logger.log('Args: |%s|' % (argv))

    # don't process params that don't match our url exactly. (e.g. plugin://plugin.video.1channel/extrafanart)
    plugin_url = 'plugin://%s/' % (kodi.get_id())
    if argv[0] != plugin_url:
        return

    mode = queries.get('mode', None)
    url_dispatcher.dispatch(mode, queries)
コード例 #10
0
def main(argv=None):  # @UnusedVariable
    if sys.argv: argv = sys.argv  # @UnusedVariable
    MAX_ERRORS = 10
    errors = 0
    last_label = ''
    sf_begin = 0
    cd_begin = 0
    was_on = False

    logger.log('Service: Installed Version: %s' % (kodi.get_version()),
               log_utils.LOGNOTICE)
    monitor = xbmc.Monitor()
    proxy = image_proxy.ImageProxy()
    service = Service()

    salts_utils.do_startup_task(MODES.UPDATE_SUBS)
    salts_utils.do_startup_task(MODES.PRUNE_CACHE)

    while not monitor.abortRequested():
        try:
            is_playing = service.isPlaying()
            salts_utils.do_scheduled_task(MODES.UPDATE_SUBS, is_playing)
            salts_utils.do_scheduled_task(MODES.PRUNE_CACHE, is_playing)
            if service.tracked and service.isPlayingVideo():
                service._lastPos = service.getTime()

            was_on = disable_global_cx(was_on)
            cd_begin = check_cooldown(cd_begin)
            if not proxy.running: proxy.start_proxy()

            if kodi.get_setting('show_next_up') == 'true':
                last_label, sf_begin = show_next_up(last_label, sf_begin)
        except Exception as e:
            errors += 1
            if errors >= MAX_ERRORS:
                logger.log(
                    'Service: Error (%s) received..(%s/%s)...Ending Service...'
                    % (e, errors, MAX_ERRORS), log_utils.LOGERROR)
                break
            else:
                logger.log(
                    'Service: Error (%s) received..(%s/%s)...Continuing Service...'
                    % (e, errors, MAX_ERRORS), log_utils.LOGERROR)
        else:
            errors = 0

        if monitor.waitForAbort(.5):
            break

    proxy.stop_proxy()
    logger.log('Service: shutting down...', log_utils.LOGNOTICE)
コード例 #11
0
ファイル: menus.py プロジェクト: troywillett/xxxbones
def mainMenu():

    art = xbmc.translatePath(
        os.path.join(
            'special://home/addons/script.wankbank.artwork/resources/art/',
            'main/%s.png'))
    popup()
    dirlst = []
    c = []
    c += [
         (kodi.giveColor('Welcome to wankbank Version %s' % kodi.get_version() ,'blue',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'icon','Original Code by EchoCoder, Please Report All issues to @Nemzzy668',False), \
         ('[COLOR yellow]View Changelog[/COLOR]',xbmc.translatePath(os.path.join(kodi.addonfolder, 'changelog.txt')),17,'changelog','View wankbank Changelog.',False), \
         ('Search...',None,29,'search','Search wankbank',True), \
         ('Live Cams',None,37,'webcams','Live Cams',True), \
         ('Tubes',None,4,'tubes','Videos',True), \
         ('Scenes',None,36,'scenes','XXX Scenes',True), \
         ('Movies',None,43,'movies','XXX Movies',True), \
         ('Virtual Reality',None,42,'vr','XXX Virtual Reality',True), \
         ('Hentai',None,39,'hentai','Hentai',True), \
         #('Vintage',None,270,'vintage','Vintage',True), \
         ('Fetish',None,40,'fetish','Fetish',True), \
         ('Pictures',None,35,'pics','Pictures',True), \
         #('Comics',None,41,'comics','Comics',True), \
         ('Parental Controls',None,5,'parental_controls','View/Change Parental Control Settings.',True), \
         ('Your History',None,20,'history','View Your History.',True), \
         ('Your Favourites',None,23,'favourites','View Your Favourites.',True), \
         ('Your Downloads',None,27,'downloads','View Your Downloads.',True), \
         ('Your Settings',None,19,'settings','View/Change Addon Settings.',False), \
         ('View Disclaimer',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/disclaimer.txt')),17,'disclaimer','View wankbank Disclaimer.',False), \
         ('View Addon Information',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'addon_info','View wankbank Information.',False), \
         ('Debug Versions',None,45,'addon_info','View the versions of XXXODUS and its dependencies for debugging.',True), \
         ('RESET wankbank',None,18,'reset','Reset wankbank to Factory Settings.',False), \
         #(kodi.giveColor('Report Issues @ https://github.com/Colossal1/plugin.video.wankbank/issues','violet',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'report','All issues must be reported at https://github.com/Colossal1/plugin.video.wankbank/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         ]

    for i in c:
        icon = art % i[3]
        fanart = kodi.addonfanart
        dirlst.append({
            'name': kodi.giveColor(i[0], 'white'),
            'url': i[1],
            'mode': i[2],
            'icon': icon,
            'fanart': fanart,
            'description': i[4],
            'folder': i[5]
        })

    buildDirectory(dirlst, cache=False)
コード例 #12
0
def main(argv=None):
    if sys.argv: argv = sys.argv
    queries = kodi.parse_query(sys.argv[2])
    log_utils.log('Version: |%s| Queries: |%s|' % (kodi.get_version(), queries), log_utils.LOGNOTICE)
    log_utils.log('Args: |%s|' % (argv), log_utils.LOGNOTICE)

    # don't process params that don't match our url exactly. (e.g. plugin://plugin.video.1channel/extrafanart)
    plugin_url = 'plugin://%s/' % (kodi.get_id())
    if argv[0] != plugin_url:
        return

    try:
        mode = queries.get('mode', None)
        url_dispatcher.dispatch(mode, queries)
    except (TransientTraktError, TraktError, TraktAuthError) as e:
        log_utils.log(str(e), log_utils.LOGERROR)
        kodi.notify(msg=str(e), duration=5000)
コード例 #13
0
ファイル: service.py プロジェクト: CYBERxNUKE/xbmc-addon
def main(argv=None):  # @UnusedVariable
    if sys.argv: argv = sys.argv  # @UnusedVariable
    MAX_ERRORS = 10
    errors = 0
    last_label = ''
    sf_begin = 0
    cd_begin = 0
    was_on = False
    
    logger.log('Service: Installed Version: %s' % (kodi.get_version()), log_utils.LOGNOTICE)
    monitor = xbmc.Monitor()
    proxy = image_proxy.ImageProxy()
    service = Service()
    
    salts_utils.do_startup_task(MODES.UPDATE_SUBS)
    salts_utils.do_startup_task(MODES.PRUNE_CACHE)
    
    while not monitor.abortRequested():
        try:
            is_playing = service.isPlaying()
            salts_utils.do_scheduled_task(MODES.UPDATE_SUBS, is_playing)
            salts_utils.do_scheduled_task(MODES.PRUNE_CACHE, is_playing)
            if service.tracked and service.isPlayingVideo():
                service._lastPos = service.getTime()
    
            was_on = disable_global_cx(was_on)
            cd_begin = check_cooldown(cd_begin)
            if not proxy.running: proxy.start_proxy()
            
            if kodi.get_setting('show_next_up') == 'true':
                last_label, sf_begin = show_next_up(last_label, sf_begin)
        except Exception as e:
            errors += 1
            if errors >= MAX_ERRORS:
                logger.log('Service: Error (%s) received..(%s/%s)...Ending Service...' % (e, errors, MAX_ERRORS), log_utils.LOGERROR)
                break
            else:
                logger.log('Service: Error (%s) received..(%s/%s)...Continuing Service...' % (e, errors, MAX_ERRORS), log_utils.LOGERROR)
        else:
            errors = 0
    
        if monitor.waitForAbort(.5):
            break
        
    proxy.stop_proxy()
    logger.log('Service: shutting down...', log_utils.LOGNOTICE)
コード例 #14
0
ファイル: menus.py プロジェクト: AsvpArchy/naughty
def mainMenu():

    art = xbmc.translatePath(
        os.path.join(
            'special://home/addons/script.xxxodus.artwork/resources/art/',
            'main/%s.png'))

    dirlst = []
    c = []

    if kodi.get_setting('mobile_mode') == 'true':
        c += [(
            kodi.giveColor('Mobile Mode ON', 'deeppink', True), None, 19, None,
            'Mobile Mode auto selects low bandwidth files to limit mobile data usage.',
            False)]
    c += [
         (kodi.giveColor('Welcome to XXX-O-DUS Version %s' % kodi.get_version() ,'dodgerblue',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'icon','All issues must be reported at https://github.com/xibalba10/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         (kodi.giveColor(kodi.countGitHubIssues('https://github.com/xibalba10/plugin.video.xxx-o-dus/issues'),'dodgerblue',True) + kodi.giveColor(' | Click To View Issues','white',True),None,34,'report','All issues must be reported at https://github.com/xibalba10/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         ('Search...',None,29,'search','Search XXX-O-DUS',True), \
         ('Chaturbate',None,300,'chaturbate','Chaturbate',True), \
         ('Tubes',None,4,'tubes','Videos',True), \
         ('Parental Controls',None,5,'parental_controls','View/Change Parental Control Settings.',True), \
         ('Your History',None,20,'history','View Your History.',True), \
         ('Your Favourites',None,23,'favourites','View Your Favourites.',True), \
         ('Your Downloads',None,27,'downloads','View Your Downloads.',True), \
         ('Your Settings',None,19,'settings','View/Change Addon Settings.',False), \
         #('View Disclaimer',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/disclaimer.txt')),17,'disclaimer','View XXX-O-DUS Disclaimer.',False), \
         ('View Addon Information',xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'addon_info','View XXX-O-DUS Information.',False), \
         ('RESET XXX-O-DUS',None,18,'reset','Reset XXX-O-DUS to Factory Settings.',False), \
         (kodi.giveColor('Report Issues @ https://github.com/xibalba10/plugin.video.xxx-o-dus/issues','white',True),xbmc.translatePath(os.path.join(kodi.addonfolder, 'resources/files/information.txt')),17,'report','All issues must be reported at https://github.com/xibalba10/plugin.video.xxx-o-dus/issues or I will not know the issues exist. I will not provide support at any other location as one central place for everyone to see and discuss issues benefits everyone.',False), \
         ]

    for i in c:
        icon = art % i[3]
        fanart = kodi.addonfanart
        dirlst.append({
            'name': kodi.giveColor(i[0], 'white'),
            'url': i[1],
            'mode': i[2],
            'icon': icon,
            'fanart': fanart,
            'description': i[4],
            'folder': i[5]
        })

    buildDirectory(dirlst, cache=False)
コード例 #15
0
def main(argv=None):
    if sys.argv: argv = sys.argv
    queries = kodi.parse_query(sys.argv[2])
    logger.log('Version: |%s| Queries: |%s|' % (kodi.get_version(), queries),
               log_utils.LOGNOTICE)
    logger.log('Args: |%s|' % (argv), log_utils.LOGNOTICE)

    # don't process params that don't match our url exactly. (e.g. plugin://plugin.video.1channel/extrafanart)
    plugin_url = 'plugin://%s/' % (kodi.get_id())
    if argv[0] != plugin_url:
        return

    try:
        mode = queries.get('mode', None)
        url_dispatcher.dispatch(mode, queries)
    except (TransientTraktError, TraktError, TraktAuthError) as e:
        logger.log(str(e), log_utils.LOGERROR)
        kodi.notify(msg=str(e), duration=5000)
コード例 #16
0
    def __init__(self,
                 ip_address=None,
                 port=None,
                 username=None,
                 password=None):
        self.ip_address = kodi.get_setting(
            'remote-ip') if ip_address is None else ip_address
        self.port = kodi.get_setting('remote-port') if port is None else port
        self.username = kodi.get_setting(
            'remote-username').strip() if username is None else username
        self.password = kodi.get_setting(
            'remote-password') if password is None else password
        self.has_connection_details = self.ip_address and self.port and self.username and self.password
        self.url = 'http://%s:%s/jsonrpc' % (
            self.ip_address,
            self.port) if self.has_connection_details else None
        self.authorization = base64.b64encode(
            self.username + b':' +
            self.password) if self.has_connection_details else None
        self.headers = {
            'User-Agent': '%s/%s' % (kodi.get_name(), kodi.get_version()),
            'Content-Type': 'application/json'
        }
        if self.authorization:
            self.headers.update(
                {'Authorization': b'Basic ' + self.authorization})

        self.connection_details_error = ''
        if not self.has_connection_details:
            self.connection_details_error = 'Missing connection details:'
            if not self.ip_address:
                self.connection_details_error += ' |IP address|'
            if not self.port:
                self.connection_details_error += ' |Port|'
            if not self.username:
                self.connection_details_error += ' |Username|'
            if not self.password:
                self.connection_details_error += ' |Password|'
コード例 #17
0
import re
import urllib
import urlparse
import log_utils  # @UnusedImport
import kodi
import dom_parser2
from salts_lib import scraper_utils
from salts_lib.constants import FORCE_NO_MATCH
from salts_lib.constants import SHORT_MONS
from salts_lib.constants import VIDEO_TYPES
from salts_lib.utils2 import i18n
import scraper

BASE_URL = 'http://wrzcraft.net'
CATEGORIES = {VIDEO_TYPES.MOVIE: '/movies/', VIDEO_TYPES.TVSHOW: '/tv-shows/'}
LOCAL_UA = 'Stream All The Sources for Kodi/%s' % (kodi.get_version())


class Scraper(scraper.Scraper):
    base_url = BASE_URL

    def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
        self.timeout = timeout
        self.base_url = kodi.get_setting('%s-base_url' % (self.get_name()))

    @classmethod
    def provides(cls):
        return frozenset(
            [VIDEO_TYPES.TVSHOW, VIDEO_TYPES.EPISODE, VIDEO_TYPES.MOVIE])

    @classmethod
コード例 #18
0
import re
import urllib
import urlparse
import log_utils  # @UnusedImport
import kodi
import dom_parser2
from salts_lib import scraper_utils
from salts_lib.constants import FORCE_NO_MATCH
from salts_lib.constants import SHORT_MONS
from salts_lib.constants import VIDEO_TYPES
from salts_lib.utils2 import i18n
import scraper

BASE_URL = 'http://www.ddlvalley.cool'
CATEGORIES = {VIDEO_TYPES.MOVIE: '/category/movies/', VIDEO_TYPES.TVSHOW: '/category/tv-shows/'}
LOCAL_UA = 'SALTS for Kodi/%s' % (kodi.get_version())

class Scraper(scraper.Scraper):
    base_url = BASE_URL

    def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
        self.timeout = timeout
        self.base_url = kodi.get_setting('%s-base_url' % (self.get_name()))

    @classmethod
    def provides(cls):
        return frozenset([VIDEO_TYPES.TVSHOW, VIDEO_TYPES.EPISODE, VIDEO_TYPES.MOVIE])

    @classmethod
    def get_name(cls):
        return 'DDLValley'
コード例 #19
0
import log_utils  # @UnusedImport
import kodi
import dom_parser2
from salts_lib import scraper_utils
from salts_lib.constants import FORCE_NO_MATCH
from salts_lib.constants import SHORT_MONS
from salts_lib.constants import VIDEO_TYPES
from salts_lib.utils2 import i18n
import scraper

BASE_URL = 'https://www.ddlvalley.me'
CATEGORIES = {
    VIDEO_TYPES.MOVIE: '/category/movies/',
    VIDEO_TYPES.TVSHOW: '/category/tv-shows/'
}
LOCAL_UA = 'Death Streams for Kodi/%s' % (kodi.get_version())


class Scraper(scraper.Scraper):
    base_url = BASE_URL

    def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
        self.timeout = timeout
        self.base_url = kodi.get_setting('%s-base_url' % (self.get_name()))

    @classmethod
    def provides(cls):
        return frozenset(
            [VIDEO_TYPES.TVSHOW, VIDEO_TYPES.EPISODE, VIDEO_TYPES.MOVIE])

    @classmethod
コード例 #20
0
ファイル: premiumize_api.py プロジェクト: uguer30/Project
"""
import urllib2
import urllib
import json
import log_utils
import kodi


def __enum(**enums):
    return type('Enum', (), enums)


BASE_URL = 'premiumize.me'
TIMEOUT = 30
BOUNDARY = 'X-X-X'
USER_AGENT = 'Premiumize Addon for Kodi/%s' % (kodi.get_version())
DOWN_TYPES = __enum(NZB='nzb', TORRENT='torrent')


class PremiumizeError(Exception):
    pass


class Premiumize_API():
    def __init__(self, customer_id, pin, use_https=False):
        self.customer_id = customer_id
        self.pin = pin
        if use_https:
            scheme = 'https'
            prefix = 'www'
        else:
コード例 #21
0
import log_utils  # @UnusedImport
import kodi
import dom_parser2
from deaths_lib import scraper_utils
from deaths_lib.constants import FORCE_NO_MATCH
from deaths_lib.constants import SHORT_MONS
from deaths_lib.constants import VIDEO_TYPES
from deaths_lib.utils2 import i18n
import scraper

BASE_URL = 'http://www.ddlvalley.cool'
CATEGORIES = {
    VIDEO_TYPES.MOVIE: '/category/movies/',
    VIDEO_TYPES.TVSHOW: '/category/tv-shows/'
}
LOCAL_UA = 'REMNANT for Kodi/%s' % (kodi.get_version())


class Scraper(scraper.Scraper):
    base_url = BASE_URL

    def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
        self.timeout = timeout
        self.base_url = kodi.get_setting('%s-base_url' % (self.get_name()))

    @classmethod
    def provides(cls):
        return frozenset(
            [VIDEO_TYPES.TVSHOW, VIDEO_TYPES.EPISODE, VIDEO_TYPES.MOVIE])

    @classmethod
コード例 #22
0
import log_utils  # @UnusedImport
import kodi
import dom_parser2
from sigsaur_lib import scraper_utils
from sigsaur_lib.constants import FORCE_NO_MATCH
from sigsaur_lib.constants import SHORT_MONS
from sigsaur_lib.constants import VIDEO_TYPES
from sigsaur_lib.utils2 import i18n
import scraper

BASE_URL = 'http://www.ddlvalley.cool'
CATEGORIES = {
    VIDEO_TYPES.MOVIE: '/category/movies/',
    VIDEO_TYPES.TVSHOW: '/category/tv-shows/'
}
LOCAL_UA = 'sigsaur for Kodi/%s' % (kodi.get_version())


class Scraper(scraper.Scraper):
    base_url = BASE_URL

    def __init__(self, timeout=scraper.DEFAULT_TIMEOUT):
        self.timeout = timeout
        self.base_url = kodi.get_setting('%s-base_url' % (self.get_name()))

    @classmethod
    def provides(cls):
        return frozenset(
            [VIDEO_TYPES.TVSHOW, VIDEO_TYPES.EPISODE, VIDEO_TYPES.MOVIE])

    @classmethod