Ejemplo n.º 1
0
def get_torrent2http_binary():
    binary = "torrent2http%s" % (PLATFORM["os"] == "windows" and ".exe" or "")

    platform = PLATFORM.copy()
    if platform["os"] == "darwin": # 64 bits anyway on Darwin
        platform["arch"] = "x64"
    elif platform["os"] == "windows": # 32 bits anyway on Windows
        platform["arch"] = "x86"

    binary_dir = os.path.join(RESOURCES_PATH, "bin", "%(os)s_%(arch)s" % platform)
    binary_path = os.path.join(binary_dir, binary)

    st = os.stat(binary_path)
    os.chmod(binary_path, st.st_mode | stat.S_IEXEC)

    return binary_dir, binary_path
Ejemplo n.º 2
0
def get_torrent2http_binary():
    binary = "torrent2http%s" % (PLATFORM["os"] == "windows" and ".exe" or "")

    platform = PLATFORM.copy()
    if platform["os"] == "darwin":  # 64 bits anyway on Darwin
        platform["arch"] = "x64"
    elif platform["os"] == "windows":  # 32 bits anyway on Windows
        platform["arch"] = "x86"

    binary_dir = os.path.join(RESOURCES_PATH, "bin",
                              "%(os)s_%(arch)s" % platform)
    binary_path = os.path.join(binary_dir, binary)

    st = os.stat(binary_path)
    os.chmod(binary_path, st.st_mode | stat.S_IEXEC)

    return binary_dir, binary_path
Ejemplo n.º 3
0
from concurrent import futures
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'resources', 'lib'))
from kodipopcorntime.common import plugin, PLATFORM, RESOURCES_PATH, AnErrorOccurred
from kodipopcorntime.utils import ensure_fanart, SafeDialogProgress
from kodipopcorntime.providers import PROVIDERS
from kodipopcorntime.magnet import from_meta_data
from kodipopcorntime.player import TorrentPlayer

if __name__ == '__main__':
    try:
        plugin.run()
    except Exception, e:
        map(xbmc.log, traceback.format_exc().split("\n"))
        sys.exit(0)

if not PLATFORM.get('os'):
    plugin.notify(plugin.addon.getLocalizedString(30302), delay=15000)
    plugin.log.error(plugin.addon.getLocalizedString(30302))
    sys.exit(0)

LIMIT = 20
QUALITY = 'all'


@plugin.route("/")
@ensure_fanart
def index():
    try:
        items = []

        if len(PROVIDERS['movies']) == 1:
Ejemplo n.º 4
0
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'resources', 'lib'))
from kodipopcorntime.common import plugin, PLATFORM, RESOURCES_PATH, AnErrorOccurred
from kodipopcorntime.utils import ensure_fanart, SafeDialogProgress
from kodipopcorntime.providers import PROVIDERS
from kodipopcorntime.magnet import from_meta_data
from kodipopcorntime.player import TorrentPlayer


if __name__ == '__main__':
    try:
        plugin.run()
    except Exception, e:
        map(xbmc.log, traceback.format_exc().split("\n"))
        sys.exit(0)

if not PLATFORM.get('os'):
    plugin.notify(plugin.addon.getLocalizedString(30302), delay=15000)
    plugin.log.error(plugin.addon.getLocalizedString(30302))
    sys.exit(0)

LIMIT = 20
QUALITY = 'all'

@plugin.route("/")
@ensure_fanart
def index():
    try:
        items = []

        if len(PROVIDERS['movies']) == 1:
            sys_kwargs = {