def play():
    with utils.busy_dialog():
        suffix = 'force_dialog=True'
        tmdb_id, season, episode = None, None, None
        dbtype = sys.listitem.getVideoInfoTag().getMediaType()

        if dbtype == 'episode':
            tmdb_id = sys.listitem.getProperty('tvshow.tmdb_id')
            season = sys.listitem.getVideoInfoTag().getSeason()
            episode = sys.listitem.getVideoInfoTag().getEpisode()
            suffix += ',season={},episode={}'.format(season, episode)

        elif dbtype == 'movie':
            tmdb_id = sys.listitem.getProperty('tmdb_id') or sys.listitem.getUniqueID('tmdb')

        # Try to lookup ID if we don't have it
        if not tmdb_id and dbtype == 'episode':
            id_details = TraktAPI().get_item_idlookup(
                'episode', parent=True, tvdb_id=sys.listitem.getUniqueID('tvdb'),
                tmdb_id=sys.listitem.getUniqueID('tmdb'), imdb_id=sys.listitem.getUniqueID('imdb'))
            tmdb_id = id_details.get('show', {}).get('ids', {}).get('tmdb')

        elif not tmdb_id and dbtype == 'movie':
            tmdb_id = Plugin().get_tmdb_id(
                itemtype='movie', imdb_id=sys.listitem.getUniqueID('imdb'),
                query=sys.listitem.getVideoInfoTag().getTitle(), year=sys.listitem.getVideoInfoTag().getYear())

        if not tmdb_id or not dbtype:
            return xbmcgui.Dialog().ok('TheMovieDb Helper', _addon.getLocalizedString(32157))

        xbmc.executebuiltin('RunScript(plugin.video.themoviedb.helper,play={},tmdb_id={},{})'.format(dbtype, tmdb_id, suffix))
def browse():
    
    info = sys.listitem.getVideoInfoTag()
    type = info.getMediaType()
    title = info.getTVShowTitle()   

    params = utils.parse_paramstring(sys.argv[0])
    type = 'tv'
    season = info.getSeason() 
#   xbmc.log(str(season)+str(title)+'===>TMDBHelper', level=xbmc.LOGNOTICE)
    tmdb_id_no = Plugin().get_tmdb_id(query=title, itemtype='tv')
    xbmc.log(str(tmdb_id_no)+'===>TMDBHelper', level=xbmc.LOGNOTICE)
#    if type == 'episode' or type == 'tv':
#   	params['type'] = 'tv'
#	    tmdb_id_no = Plugin().get_tmdb_id(**params)

    tmdb_id = sys.listitem.getProperty('tvshow.tmdb_id')
    if tmdb_id == '' or tmdb_id == None:
	tmdb_id = tmdb_id_no
    tmdb_id = sys.listitem.getProperty('tvshow.tmdb_id')
    path = 'plugin://plugin.video.themoviedb.helper/'
    path = path + '?info=seasons&type=tv&nextpage=True&tmdb_id={}'.format(tmdb_id)
    path = path + '&fanarttv=True' if _addon.getSettingBool('fanarttv_lookup') else path
    command = 'Container.Update({})' if xbmc.getCondVisibility("Window.IsMedia") else 'ActivateWindow(videos,{},return)'
    xbmc.executebuiltin(command.format(path))
import sys
import xbmc
import xbmcvfs
import xbmcaddon
import xbmcgui
import datetime
import simplecache
from resources.lib.plugin import Plugin
from resources.lib.traktapi import TraktAPI
from resources.lib.constants import LIBRARY_ADD_LIMIT_TVSHOWS, LIBRARY_ADD_LIMIT_MOVIES
import resources.lib.utils as utils
_addon = xbmcaddon.Addon('plugin.video.themoviedb.helper')
_plugin = Plugin()
_debuglogging = _addon.getSettingBool('debug_logging')
_cache = simplecache.SimpleCache()
_basedir_movie = _addon.getSettingString('movies_library') or 'special://profile/addon_data/plugin.video.themoviedb.helper/movies/'
_basedir_tv = _addon.getSettingString('tvshows_library') or 'special://profile/addon_data/plugin.video.themoviedb.helper/tvshows/'


def replace_content(content, old, new):
    content = content.replace(old, new)
    return replace_content(content, old, new) if old in content else content


def clean_content(content, details='info=play'):
    content = content.replace('info=flatseasons', details)
    content = content.replace('info=details', details)
    content = content.replace('fanarttv=True', '')
    content = content.replace('widget=True', '')
    content = content.replace('localdb=True', '')
    content = content.replace('nextpage=True', '')
from resources.lib.plugin import Plugin
import resources.lib.ltl_api as api

plugin_id = 'plugin.video.latelelibre_fr'

localized_strings = {
    'Next page': 30010,
    'Type not suported': 30011,
    'Video not located': 30012,
    'Previous page': 30013,
    'All videos': 30014,
    'Search': 30015,
}

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag)


def get_located_string(string_name):
    """This function returns the localized string if it is available."""
    return translation(localized_strings.get(string_name)).encode(
        'utf-8'
    ) or string_name if string_name in localized_strings else string_name
from resources.lib.plugin import Plugin
import resources.lib.ltl_api as api

plugin_id = 'plugin.video.latelelibre_fr'

localized_strings =  {
        'Next page'         : 30010,
        'Type not suported' : 30011,
        'Video not located' : 30012,
        'Previous page'     : 30013,
        'All videos'        : 30014,
        'Search'            : 30015,
        }

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag, p.log)

st_release = settings.getSetting('version')
current_release = settings.getAddonInfo('version')
update_settings = False

# This is to make it sure that settings are correctly setup on every addon
# update if required or on first time of update settings either.
from resources.lib.plugin import Plugin 
import resources.lib.ffa_api as api

plugin_id = 'plugin.video.filmsforaction'

localized_strings =  {
        'Next page': 30010,
        'Type not suported': 30011,
        'Video not located': 30012,
        'Previous page': 30013,
        'All videos': 30014,
        'Search': 30015,
        }

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag, p.log)

# By default, both, the website and the add-on are setup to show only the best videos.
all_filter = '&quality=all' if settings.getSetting("show_best") == "false" else '&quality=best'
sort_param = '&sort=new' if settings.getSetting("views") == "false" else '&sort=views'

if all_filter == '&quality=all':
    p.log("ffa.main: 'all videos' filter is explicit setup.")
Exemple #7
0
from resources.lib.plugin import Plugin 
import resources.lib.rne_api as api

plugin_id = 'plugin.audio.rne'

localized_strings =  {
        'Next page'         : 30010,
        'Type not suported' : 30011,
        'Audio not located' : 30012,
        'Previous page'     : 30013,
        'Search'            : 30014,
        'Search result'     : 30015,
        }

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"
all_programmes_flag = settings.getSetting("all_programmes") == "1"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag)

p.log("rne %s flag is set" % {True : 'all_the_programmes', False : 'only_emission'}[all_programmes_flag])


def get_located_string(string_name):
    """This function returns the localized string if it is available."""
Exemple #8
0
from resources.lib.plugin import Plugin
import resources.lib.rne_api as api

plugin_id = 'plugin.audio.rne'

localized_strings = {
    'Next page': 30010,
    'Type not suported': 30011,
    'Audio not located': 30012,
    'Previous page': 30013,
    'Search': 30014,
    'Search result': 30015,
}

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"
all_programmes_flag = settings.getSetting("all_programmes") == "1"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag, p.log)

p.log("rne %s flag is set" % {
    True: 'all_the_programmes',
    False: 'only_emission'
}[all_programmes_flag])
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
    This file is part of XBMC Mega Pack Addon.

    Copyright (C) 2014 Wolverine ([email protected])

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program.  If not, see http://www.gnu.org/licenses/gpl-3.0.html
"""

from resources.lib.plugin import Plugin
from resources.lib.menu import Menu

plugin = Plugin()
menu = Menu(plugin)
plugin.run(menu)
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

'''

from resources.lib.plugin import Plugin
import resources.lib.api as api

plugin_id = 'plugin.audio.pureradio'

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

localized_strings = {
    'Play': 30001,
    'Podcasts': 30002,
}


# Entry point
def run():
    """This function is the entry point to the add-on.
    It gets the add-on parameters and call the 'action' function.
    """
Exemple #11
0
from resources.lib.plugin import Plugin 
import resources.lib.ltl_api as api

plugin_id = 'plugin.video.latelelibre_fr'

localized_strings =  {
        'Next page'         : 30010,
        'Type not suported' : 30011,
        'Video not located' : 30012,
        'Previous page'     : 30013,
        'All videos'        : 30014,
        'Search'            : 30015,
        }

p = Plugin(plugin_id)

settings = p.get_plugin_settings()
translation = p.get_plugin_translation()

debug_flag = settings.getSetting("debug") == "true"

p.set_debug_mode(debug_flag)
api.set_debug(debug_flag)


def get_located_string(string_name):
    """This function returns the localized string if it is available."""
    return translation(localized_strings.get(string_name)).encode('utf-8') or string_name if string_name in localized_strings else string_name
            
Exemple #12
0
'''
plugin.video.nowtv

A simple Kodi add-on which wraps 'NOW TV Player' to integrate with Kodi.

This script functions as the entrypoint into the plugin, however as we want to
keep this as simple as posible. As a result, this script simply sets up and
calls an instance of our plugin.
'''

from resources.lib.plugin import Plugin

# Kick it.
if __name__ == '__main__':
    instance = Plugin(sys.argv)  # noqa: F821
    instance.run()