Пример #1
0
import xbmc
import xbmcgui
# import xbmcplugin
import xbmcaddon

from match import League

########################################################################
__ScriptName__ = "BBC Football Score Scraper"
__ScriptVersion__ = "0.2.0"
__Author__ = "el_Paraguayo"
__Website__ = "https://github.com/elParaguayo/"
########################################################################

# Set the addon environment
_A_ = xbmcaddon.Addon("script.bbcfootballscores")
_S_ = _A_.getSetting

# Load some user settings
alarminterval = str(_S_("alarminterval"))
pluginPath = _A_.getAddonInfo("path")
showchanges = _S_("showchanges") == "true"

try:
    watchedleagues = json.loads(str(_S_("watchedleagues")))
except:
    watchedleagues = []

rundate = str(_S_("rundate"))
gamedate = datetime.date.today().strftime("%y%m%d")
leaguedata = League()
Пример #2
0
import datetime
import os
import xbmc
import xbmcgui, xbmcaddon, xbmcvfs
import re
import source as src

from strings import *

ADDON = xbmcaddon.Addon(id='script.tvsupertugaguide')

if __name__ == '__main__':
    database = src.Database()

    def onAutoplaysCleared():
        pass

    def onInitialized(success):
        if success:
            channelList = database.getChannelList(onlyVisible=False)
            xbmcvfs.mkdirs(
                "special://profile/addon_data/script.tvsupertugaguide/channel_logos/"
            )
            for channel in channelList:
                from_file = channel.logo
                regex = '[%s]' % re.escape('[]/\:')
                xbmc.log(regex)
                to_file = "special://profile/addon_data/script.tvsupertugaguide/channel_logos/%s.png" % re.sub(
                    regex, ' ', channel.title)
                xbmcvfs.copy(from_file, to_file)
            database.close(onAutoplaysCleared)
Пример #3
0
# -*- coding: utf-8 -*-

'''
Created on 30/04/2011

@author: shai
'''
__USERAGENT__ = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'



import urllib,urllib2,re,xbmc,xbmcplugin,xbmcgui,xbmcaddon,os,sys,time

__settings__ = xbmcaddon.Addon(id='plugin.video.hotVOD.video')
__cachePeriod__ = __settings__.getSetting("cache")
__PLUGIN_PATH__ = __settings__.getAddonInfo('path')
__DEBUG__ = __settings__.getSetting("DEBUG") == "true"

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

def getMatches(url, pattern):
        page = getData(url)
        matches=re.compile(pattern).findall(page)
        return matches   

def getParams(arg):
        param=[]
        paramstring=arg
        if len(paramstring)>=2:
            params=arg
Пример #4
0
def do_search(term=None):
    import os
    import xbmc
    import xbmcgui
    import time
    import datetime
    import urllib2
    import shutil

    search_term = term.lower()

    result = run_hook("do_search", search_term)
    if result:
        display_list(result, "videos")
        return
    jenlist = JenList("")
    jenlist.list_image = xbmcaddon.Addon().getAddonInfo('icon')
    theme = xbmcaddon.Addon().getSetting('theme')
    if theme and theme != 'DEFAULT' and theme != 'none':
        jenlist.list_fanart = jenlist.set_theme(theme)
    else:
        jenlist.list_fanart = xbmcaddon.Addon().getAddonInfo('fanart')
    result_list = []
    exact_result_list = []
    item_xml_result_list = []
    exact_item_xml_result_list = []
    dest_file = os.path.join(
        xbmc.translatePath(xbmcaddon.Addon().getSetting("cache_folder")),
        "search.db")

    url = __builtin__.search_db_location
    request = urllib2.Request(url)
    response = urllib2.urlopen(request)
    try:
        changed = response.headers["Last-Modified"]
        changed_struct = time.strptime(changed, "%a, %d %b %Y %H:%M:%S GMT")
        epoch_changed = int(time.mktime(changed_struct))
        if not os.path.exists(dest_file) or \
           int(os.path.getmtime(dest_file)) < epoch_changed:
            dp = xbmcgui.DialogProgress()
            dp.create(_('Loading database file'), _('Please Wait'))
            if response.getcode() == 200:
                with open(dest_file, 'wb') as out_file:
                    shutil.copyfileobj(response, out_file)
                if os.path.getsize(dest_file) == 0:
                    koding.dolog("0 size db: " + repr(dest_file))
                    os.remove(dest_file)
            dp.close()
    except:  # server down
        if not os.path.exists(dest_file):
            import xbmcgui
            addon_name = xbmcaddon.Addon().getAddonInfo('name')
            xbmcgui.Dialog().ok(
                addon_name, _("no local file found, and server seems down"))
            dp.close()
    response.close()

    results = koding.DB_Query(
        dest_file,
        'SELECT * from search where item like "%%%s%%"' % search_term)
    for result in results:
        item = jenlist.process_item(result["item"])
        playlister = result["poster"]
        title = item["label"].lower()
        if search_term in title:
            item["info"] = {}
            try:
                item['label'] = '{0} - {1}'.format(playlister, item["label"])
            except:
                import xbmc
                koding.dolog("playlister: " + repr(playlister))
                koding.dolog("label:" + repr(item["lable"]))
                koding.dolog("item: " + repr(item))
                raise Exception()
            if title.startswith(search_term + " "):
                exact_result_list.append(item)
                exact_item_xml_result_list.append(result["item"])
                continue
            result_list.append(item)
            item_xml_result_list.append(result["item"])
    meta = xbmcaddon.Addon().getSetting("metadata") == "true"
    if meta:
        # TODO find way to get it all in single cal
        info = get_info(exact_item_xml_result_list)
        if info:
            for index, item in enumerate(exact_result_list):
                item["info"].update(info[index])

        info = get_info(item_xml_result_list)
        if info:
            for index, item in enumerate(result_list):
                item["info"].update(info[index])
    exact_result_list = sorted(exact_result_list, key=lambda item: title)
    exact_result_list.extend(sorted(result_list, key=lambda item: title))
    display_list(exact_result_list, "videos")
Пример #5
0
KEY_BUTTON_BACK = 275
KEY_KEYBOARD_ESC = 61467

ACTION_PARENT_DIR = 9
ACTION_PREVIOUS_MENU = 10
ACTION_NAV_BACK = 92

TEXT_ALIGN_LEFT = 0
TEXT_ALIGN_RIGHT = 1
TEXT_ALIGN_CENTER_X = 2
TEXT_ALIGN_CENTER_Y = 4
TEXT_ALIGN_RIGHT_CENTER_Y = 5
TEXT_ALIGN_CENTER_X_CENTER_Y = 6

# Get global paths
addon = xbmcaddon.Addon(id="script.audio.BT_BC127_HFP")
resourcesPath = os.path.join(addon.getAddonInfo('path'), 'resources') + '/'
clientScript = os.path.join(addon.getAddonInfo('path'), 'resources',
                            'jamboree_client.py')
mediaPath = os.path.join(addon.getAddonInfo('path'), 'resources',
                         'media') + '/'

# Open socket for communication with the gpio-manager UDP server
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
addonW = 1280
addonH = 720

# Buttons Configuration
BUTTON_H = 105
BUTTON_W = 105
Пример #6
0
 def clear_cache(self):
     dialog = xbmcgui.Dialog()
     if dialog.yesno(xbmcaddon.Addon().getAddonInfo('name'), "Clear PodcastOne Plugin Cache?"):
         koding.Remove_Table("pcastone_com_plugin")
Пример #7
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib, urllib2, re, xbmcaddon, xbmcplugin, xbmcgui, xbmc
from stream import *

dbg = False
pluginhandle = int(sys.argv[1])
itemcnt = 0
baseurl = 'http://movie-paradise.tv'
settings = xbmcaddon.Addon(id='plugin.video.movie_paradise_tv')
maxitems = (int(settings.getSetting("items_per_page"))+1)*15
filterUnknownHoster = settings.getSetting("filterUnknownHoster") == 'true'
forceViewMode = settings.getSetting("forceViewMode") == 'true'
viewMode = str(settings.getSetting("viewMode"))
userAgent = 'Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0'

def START():
	addDir('Neue Filme', prepUrl('/?page_id=5&more=recent'), 1, '', True)
	addDir('Kategorien', baseurl, 2, '', True)
	addDir('Suche...', prepUrl('/?page_id=5&video_search='), 4, '', True)
	if forceViewMode: xbmc.executebuiltin("Container.SetViewMode("+viewMode+")")

def CATEGORIES(url):
	data = getUrl(url)
	for (href, genre) in re.findall('<td[^>]*>[^<]*<a[^>]*href="([^"]*)"[^>]*><button[^>]*>([^<]+)</button></a></td>', data, re.S|re.I):
		addDir(clean(genre), prepUrl(href), 1, '', True)
	if forceViewMode: xbmc.executebuiltin("Container.SetViewMode("+viewMode+")")

def INDEX(caturl):
	if (dbg): print caturl
	global itemcnt
Пример #8
0
# (at your option) any later version.
#
# Kitchen Service 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 Kitchen Service.  If not, see <http://www.gnu.org/licenses/>.

import os, xbmc, xbmcgui, xbmcaddon, xbmcvfs, string, re
from datetime import datetime, time

# Plugin Info
ADDON_ID = 'script.kitchen.service'
REAL_SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
ADDON_ID = REAL_SETTINGS.getAddonInfo('id')
ADDON_NAME = REAL_SETTINGS.getAddonInfo('name')
ADDON_PATH = REAL_SETTINGS.getAddonInfo('path')
ADDON_VERSION = REAL_SETTINGS.getAddonInfo('version')
SETTINGS_LOC = REAL_SETTINGS.getAddonInfo('profile')
THUMB = (xbmc.translatePath(os.path.join(ADDON_PATH, 'resources', 'images')) +
         '/' + 'icon.png')
NIGHTTIME = False
MUTE = False


def log(msg, level=xbmc.LOGDEBUG):
    xbmc.log(ADDON_ID + '-' + ADDON_VERSION + '-' + uni(msg), level)

Пример #9
0
# -*- coding: utf-8 -*-

import xbmc, xbmcgui, xbmcplugin, xbmcaddon
import urllib, os, sys
import datetime as dt
from collections import namedtuple
import resources.lib.localization as l

try:
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context
except:
    pass

__version__ = '1.0.19'
__settings__ = xbmcaddon.Addon(id='plugin.video.soap4.me')

DEBUG = False

if DEBUG:
    sys.path.append('/Users/ufian/tests/soap4me/debug-eggs/pycharm-debug')

try:
    import json
except:
    import simplejson as json
import sys
try:
    import hashlib
except:
    import md5 as hashlib
Пример #10
0
import urllib, urllib2, re, xbmcplugin, xbmcgui, sys, xbmc, xbmcaddon, os, random, urlparse, time, net
from t0mm0.common.addon import Addon
from metahandler import metahandlers
from resources.lib.jsbeautifier.unpackers import packer
net = net.Net()
addon_id = 'plugin.video.xmovies8'
selfAddon = xbmcaddon.Addon(id=addon_id)
datapath = xbmc.translatePath(selfAddon.getAddonInfo('profile'))
metaget = metahandlers.MetaData(preparezip=False)
addon = Addon(addon_id, sys.argv)
fanart = xbmc.translatePath(
    os.path.join('special://home/addons/' + addon_id, 'fanart.jpg'))
icon = xbmc.translatePath(
    os.path.join('special://home/addons/' + addon_id, 'icon.png'))
metaset = selfAddon.getSetting('enable_meta')

def CATEGORIES():
    addDir2('Cinema Movies', 'http://xmovies8.tv/cinema-movies/page/1', 1,
            icon, '', fanart)
    addDir2('New Movies', 'http://xmovies8.tv/new/page/1', 1, icon, '', fanart)
    addDir2('HD Movies', 'http://xmovies8.tv/movie-quality/720hd/page/1', 1,
            icon, '', fanart)
    addDir2('Movies By Year', 'http://xmovies8.tv/', 2, icon, '', fanart)
    addDir2('Movies By Genre', 'http://xmovies8.tv/', 4, icon, '', fanart)
    addDir2('Search', 'URL', 3, icon, '', fanart)
    xbmc.executebuiltin('Container.SetViewMode(50)')

def GETYEARS(url):
    link = open_url(url)
    link = link.replace('\n', '').replace('  ', '')
Пример #11
0
REMOTE_0 = 58
REMOTE_1 = 59
REMOTE_2 = 60
REMOTE_3 = 61
REMOTE_4 = 62
REMOTE_5 = 63
REMOTE_6 = 64
REMOTE_7 = 65
REMOTE_8 = 66
REMOTE_9 = 67

MAXCAMS = 9

# Set plugin variables
__addon__ = xbmcaddon.Addon()
__addon_id__ = __addon__.getAddonInfo('id')
__addon_path__ = __addon__.getAddonInfo('path')
__profile__ = __addon__.getAddonInfo('profile')
__localize__ = __addon__.getLocalizedString
__settings__ = os.path.join(__profile__, 'settings.xml')
__black__ = os.path.join(__addon_path__, 'resources', 'media', 'black.png')
__loading__ = os.path.join(__addon_path__, 'resources', 'media', 'loading.gif')
__btnTextureFO__ = os.path.join(__addon_path__, 'resources', 'media',
                                'buttonFO.png')
__btnTextureNF__ = os.path.join(__addon_path__, 'resources', 'media',
                                'buttonNF.png')

CAMERAS = []

ffmpeg_exec = 'ffmpeg.exe' if platform.system() == 'Windows' else 'ffmpeg'
Пример #12
0
import urllib,urllib2,sys,re,xbmcplugin,xbmcgui,xbmcaddon,xbmc,os
from datetime import datetime,tzinfo,timedelta
import json
import base64

import net

net=net.Net()

ADDON = xbmcaddon.Addon(id='plugin.video.tvplayer')

datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
cookie_path = os.path.join(datapath, 'cookies')
cookie_jar = os.path.join(cookie_path, 'tvplayer.lwp')
if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)

    
class Zone(tzinfo):
    
    def __init__(self,offset,isdst,name):
        self.offset = offset
        self.isdst = isdst
        self.name = name
    def utcoffset(self, dt):
        return timedelta(hours=self.offset) + self.dst(dt)
    def dst(self, dt):
            return timedelta(hours=1) if self.isdst else timedelta(0)
    def tzname(self,dt):
         return self.name
Пример #13
0
from parser.ehp import Html
from provider import process
from providers.definitions import definitions, longest
from filtering import apply_filters, Filtering
from client import USER_AGENT, Client
from utils import ADDON_ICON, notify, translation, sizeof, get_icon_path, get_enabled_providers

provider_names = []
provider_results = []
available_providers = 0
request_time = time.time()
timeout = get_setting("timeout", int)
auto_timeout = get_setting("auto_timeout", bool)

if auto_timeout:
    quasar_addon = xbmcaddon.Addon(id='plugin.video.quasar')
    if quasar_addon:
        if quasar_addon.getSetting(
                'custom_provider_timeout_enabled') == "true":
            timeout = int(
                quasar_addon.getSetting('custom_provider_timeout')) - 2
            log.debug("Using timeout from Quasar: %d seconds" % (timeout))
        else:
            timeout = 9


def search(payload, method="general"):
    """ Main search entrypoint

    Args:
        payload (dict): Search payload from Quasar.
Пример #14
0
def refreshAddonSettings():
    global __addon__
    __addon__ = xbmcaddon.Addon()
Пример #15
0
    def __init__(self, addon_id, handle, base_url):
        self.addon_id = addon_id
        self.addon = xbmcaddon.Addon(addon_id)
        self.language = self.addon.getLocalizedString
        self.base_url = base_url
        self.handle = handle
        self.DEBUG_ID_STRING = "[" + str(self.addon_id) + "] "
        self.SESSION_VALIDITY = int(
            self.addon.getSetting('sessionvalid'))  # stored session valid

        self.base_addon_cat = ""
        self.cur_loc = ""

        self.md = xbmc.translatePath(
            self.addon.getAddonInfo('path') + "/resources/media/")
        self.resources = xbmc.translatePath(
            self.addon.getAddonInfo('path') + "/resources/")
        self.search_string = urllib.unquote_plus(
            self.addon.getSetting('lastsearch'))
        xbmcplugin.setPluginFanart(self.handle,
                                   image=self.resources + "fanart.jpg")

        # LABELS

        self.LB_SEARCH_DESC = self.language(33700).encode('utf-8')
        self.LB_SEARCH_NORES = self.language(33701).encode('utf-8')
        self.LB_ERROR = self.language(33702).encode('utf-8')
        self.LB_INFO = self.language(33713).encode('utf-8')
        self.LB_SUCESS = self.language(33727).encode('utf-8')
        self.LB_EPISODE_UNTILL = self.language(33703).encode('utf-8')
        self.LB_FILM_UNTILL = self.language(33704).encode('utf-8')
        self.LB_EPISODE = self.language(33705).encode('utf-8')
        self.LB_SEASON = self.language(33706).encode('utf-8')
        self.LB_MYPLAYLIST = self.language(33707).encode('utf-8')
        self.LB_NOLOGIN = self.language(33708).encode('utf-8')
        self.LB_LOGIN_ERROR = self.language(33709).encode('utf-8')
        self.LB_NO_OPERATOR = self.language(33710).encode('utf-8')
        self.LB_SEARCH = self.language(33711).encode('utf-8')

        self.use_content_type = "episodes"

        self.force_original_names = self.addon.getSetting('origtitles')
        if self.force_original_names == "true":
            self.force_original_names = True
        else:
            self.force_original_names = False

        self.force_scraper_names = self.addon.getSetting('forcescrap')
        if self.force_scraper_names == "true":
            self.force_scraper_names = True
        else:
            self.force_scraper_names = False

        self.sensitive_debug = self.addon.getSetting('sensitivedebug')
        if self.sensitive_debug == "true":
            self.sensitive_debug = True
        else:
            self.sensitive_debug = False

        if self.sensitive_debug:
            ret = xbmcgui.Dialog().yesno(self.LB_INFO,
                                         self.language(33712).encode('utf-8'),
                                         self.language(33714).encode('utf-8'),
                                         self.language(33715).encode('utf-8'))
            if not ret:
                sys.exit()

        self.loggedin_headers = None  #DEFINE IN SPECIFIC HANDLER
        self.API_PLATFORM = 'COMP'
Пример #16
0
import urllib2, urllib, xbmcgui, xbmcplugin, xbmc, re, sys, os, dandy
import xbmcaddon
from addon.common.addon import Addon
from md_request import open_url
addon_id = 'plugin.video.openloadmovies'
selfAddon = xbmcaddon.Addon(id=addon_id)
datapath = xbmc.translatePath(selfAddon.getAddonInfo('profile'))
addon = Addon(addon_id, sys.argv)
addon_name = selfAddon.getAddonInfo('name')
ART = xbmc.translatePath(
    os.path.join('special://home/addons/' + addon_id + '/resources/art/'))
ICON = xbmc.translatePath(
    os.path.join('special://home/addons/' + addon_id, 'icon.png'))
FANART = xbmc.translatePath(
    os.path.join('special://home/addons/' + addon_id, 'fanart.jpg'))
User_Agent = 'Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0'

# SITE = selfAddon.getSetting('website')
# SITE = SITE.replace('PopNow','http://getmypopcornnow.xyz/')
# SITE = SITE.replace('Oload','http://openloadmovies.net/')
# SITE = SITE.replace('PubOnline','http://pubfilmonline.net/')

BASEURL = 'http://pubfilmonline.net/'


def MENU():
    addDir('[B][COLOR cornflowerblue]Trending[/COLOR][/B]',
           BASEURL + 'trending/?get=movies', 5, ART + 'trend.jpg', FANART, '')
    addDir('[B][COLOR cornflowerblue]Featured[/COLOR][/B]',
           BASEURL + 'genre/featured/', 5, ART + 'feature.jpg', FANART, '')
    addDir('[B][COLOR cornflowerblue]All Movies[/COLOR][/B]',
Пример #17
0
import __builtin__
import base64,time
import json,re,requests,os,traceback,urlparse
import koding
import xbmc,xbmcaddon,xbmcgui
from koding import route
from resources.lib.plugin import Plugin
from resources.lib.util import dom_parser
from resources.lib.util.context import get_context_items
from resources.lib.util.xml import JenItem, JenList, display_list
from unidecode import unidecode

CACHE_TIME = 10800  # change to wanted cache time in seconds

addon_fanart = xbmcaddon.Addon().getAddonInfo('fanart')
addon_icon   = xbmcaddon.Addon().getAddonInfo('icon')
User_Agent   = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36'

pcobase_link = 'https://www.podcastone.com/'
pcoplay_link = 'https://www.podcastone.com/downloadsecurity?url=%s'
pcoepisodes_link = 'https://www.podcastone.com/pg/jsp/program/pasteps_cms.jsp?size=1000&amountToDisplay=1000&page=1&infiniteScroll=true&progID=%s&showTwitter=false&pmProtect=false&displayPremiumEpisodes=false&startAt=0'

class WatchCartoon(Plugin):
    name = "podcastone"

    def process_item(self, item_xml):
        if "<podcastone>" in item_xml:
            item = JenItem(item_xml)
            if "pcocategory/" in item.get("podcastone", ""):
                result_item = {
Пример #18
0
# -*- coding: utf-8 -*-
# Universal Scrapers

import re,requests,time,urlparse
import xbmc,xbmcaddon
from universalscrapers.scraper import Scraper
from universalscrapers.common import clean_search,clean_title,send_log,error_log

dev_log = xbmcaddon.Addon('script.module.universalscrapers').getSetting("dev_log")
User_Agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'


class Animetoon(Scraper):
    domains = ['animetoon.org']
    name = "AnimeToon"
    sources = []


    def __init__(self):
        self.base_link_cartoons = 'http://www.animetoon.org/cartoon'
        self.dubbed_link_cartoons = 'http://www.animetoon.org/dubbed-anime'


    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid = False):
        start_time = time.time()
        if season == "19":
            season = "1"
        try:
            uniques = []
            for base in [self.base_link_cartoons,self.dubbed_link_cartoons]:
                html = requests.get(base,timeout=5).content
Пример #19
0
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# http://www.youtube.com/user/MidweekPolitics
#------------------------------------------------------------
# Based on code from youtube addon
#------------------------------------------------------------

import os
import sys
import plugintools
import xbmc, xbmcaddon
from addon.common.addon import Addon

addonID = 'plugin.video.davidpakmanshow'
addon = Addon(addonID, sys.argv)
local = xbmcaddon.Addon(id=addonID)
icon = local.getAddonInfo('icon')

YOUTUBE_CHANNEL_ID = "MidweekPolitics"


# Entry point
def run():
    plugintools.log("davidpakmanshow.run")
    # Get params
    params = plugintools.get_params()

    if params.get("action") is None:
        main_list(params)
    else:
        pass
Пример #20
0
def playVid(id,
            filename=None,
            season=None,
            episode=None,
            show=None,
            folder=None,
            type=''):
    import time
    import json

    #Check if its PseudoTV that's playing this file, if so, we shouldn't do anything else than play the video
    if xbmcgui.Window(10000).getProperty('PseudoTVRunning') == 'True':
        dev.log('PseudoTV is running, so just play the video')
        return playYoutubeVid(id)

    #Prepare the information
    loadingTime = time.time()
    totalTime = 0
    currentTime = 0
    folderPath = xbmc.getInfoLabel('Container.FolderPath')
    name = filename
    filename = filename + '.strm'
    filename = filename.translate(None, '\/:*?"<>|').strip('.')

    #Grab the metadata of this episode
    if type == 'movies':
        #meta = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter":{"field": "studio", "operator": "is", "value": "Youtube"}, "properties": ["title", "runtime", "rating", "director", "writer", "plot", "thumbnail", "file"]}, "id": 1}' % (filename))
        query = '{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "path", "value": "%s"}, "properties": ["title", "art", "file", "thumbnail", "runtime", "rating", "plot"]}, "method": "VideoLibrary.GetMovies", "id": "libMovies"}' % (
            folder)
        dev.log('trying meta query now: ' + query)
        meta = xbmc.executeJSONRPC(query)

    else:
        meta = xbmc.executeJSONRPC(
            '{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"filter":{"and": [{"field": "season", "operator": "is", "value": "%s"}, {"field": "episode", "operator": "is", "value": "%s"}]}, "properties": ["title", "season", "episode", "showtitle", "firstaired", "runtime", "rating", "director", "writer", "plot", "thumbnail", "file"]}, "id": 1}'
            % (season, episode))
    meta = unicode(meta, 'utf-8', errors='ignore')
    dev.log('Meta: ' + meta)
    if 'episodes' in json.loads(meta)['result'] or 'movies' in json.loads(
            meta)['result']:
        if type == 'movies':
            meta = json.loads(meta)['result']['movies']
        else:
            meta = json.loads(meta)['result']['episodes']
        for i in meta:
            dev.log('Meta: ' + i['file'].encode('utf8'))
            dev.log('Looking for :' + filename)
            dev.log('File :' + i['file'])
            i['file'] = i['file'].encode('utf-8')
            if i['file'].endswith(filename):
                dev.log('Found the episode we are looking for')
                meta = i
                break

        if type == 'movies':
            DBID = meta['movieid']
            thumb = meta['thumbnail']

            meta = {
                'title': meta['title'].encode('utf-8'),
                'duration': meta['runtime'],
                'rating': meta['rating'],
                'plot': meta['plot'].encode('utf-8')
            }
            poster = 'Default.png'
            #poster = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"filter": {"field": "title", "operator": "is", "value": "%s"}, "properties": ["thumbnail"]}, "id": 1}' % showtitle.encode('utf-8'))
            #poster = unicode(poster, 'utf-8', errors='ignore')
            #poster = json.loads(poster)['result']['tvshows'][0]['thumbnail']
        else:
            DBID = meta['episodeid']
            thumb = meta['thumbnail']
            showtitle = meta['showtitle']

            meta = {
                'title': meta['title'].encode('utf-8'),
                'season': meta['season'],
                'episode': meta['episode'],
                'tvshowtitle': meta['showtitle'].encode('utf-8'),
                'premiered': meta['firstaired'].encode('utf-8'),
                'duration': meta['runtime'],
                'rating': meta['rating'],
                'director': str(' / '.join(meta['director']).encode('utf-8')),
                'writer': str(' / '.join(meta['writer']).encode('utf-8')),
                'plot': meta['plot'].encode('utf-8')
            }

            poster = xbmc.executeJSONRPC(
                '{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"filter": {"field": "title", "operator": "is", "value": "%s"}, "properties": ["thumbnail"]}, "id": 1}'
                % showtitle.encode('utf-8'))
            poster = unicode(poster, 'utf-8', errors='ignore')
            poster = json.loads(poster)['result']['tvshows'][0]['thumbnail']

        #If resume playback is set in the settings, display a resume menu
        try:
            if xbmcaddon.Addon().getSetting('resume_playback') == 'true':
                dev.log('Resume Playback is turned on. Grab resume point..')
                offset = bookmarks.getBookmark(name)
                dev.log('Offset is %s' % offset)
                if offset == '0': raise Exception()
                dev.log('Grabbing minutes and seconds')
                minutes, seconds = divmod(float(offset), 60)
                hours, minutes = divmod(minutes, 60)
                dev.log('Showing yesno. Minutes: %s, seconds: %s' %
                        (minutes, seconds))
                #yes = yesnoDialog('%s %02d:%02d:%02d' % ('Resume from ', hours, minutes, seconds), '', '', self.name, 'Resume', 'Start From Beginning')
                yes = xbmcgui.Dialog().yesno(
                    'Resume',
                    '%s %02d:%02d:%02d' %
                    ('Resume from ', hours, minutes, seconds),
                    nolabel='Resume',
                    yeslabel='Start From Beginning')
                dev.log('Chose option: %s' % yes)
                if yes: offset = '0'
        except:
            pass

        #Play the youtube video with the meta data just acquired
        playYoutubeVid(id, meta, poster)
    else:
        dev.log(
            'Error: Could not retrieve meta information from the database!',
            True)
        return playYoutubeVid(
            id
        )  #Just play the video, since we could not retrieve meta information

    #Check if the video is still playing and store the time it is currently playing
    for i in range(0, 300):
        if xbmc.Player().isPlayingVideo():
            #Set the offset of the video
            try:
                if offset == '0': raise Exception()
                xbmc.Player().seekTime(float(offset))
            except:
                pass
            break
        xbmc.sleep(100)
    while xbmc.Player().isPlayingVideo():
        try:
            totalTime = xbmc.Player().getTotalTime()
        except:
            pass
        try:
            currentTime = xbmc.Player().getTime()
        except:
            pass
        xbmc.sleep(1000)

    diff = currentTime / totalTime  #Calculate how much of the video has been watched
    #The video has stopped playing
    dev.log('Ended Video Playback (%s) @ %s (percentage: %s)' %
            (totalTime, currentTime, diff))

    #Delete the previous bookmark where we were and store the new one
    try:
        bookmarks.deleteBookmark(name)  #Delete the previous saved bookmark
        dev.log('Deleted the previous bookmark')
        ok = int(currentTime) > 120 and (
            currentTime / totalTime
        ) <= .9  #Has the video been playing long enough and is it viewed less then 90%?
        if ok:
            bookmarks.addBookmark(currentTime, name)  #Add the new bookmark
            dev.log('Added new bookmark @ %s' % currentTime)
    except:
        pass

    #Mark the episode as watched if enough was watched
    ok = diff >= .9  #Did the episode get watched for 90% or more?
    if int(currentTime) < 120:
        ok = diff >= .75  #Since the runtime is very short, we'll accept a view through as 75%
    if ok:
        dev.log('Episode has been watched for %s, mark as watched' % diff)
        bookmarks.mark_as_watched(DBID,
                                  folderPath)  #Mark the episode as watched
    else:
        dev.log('Episode has been watched for %s, dont mark as watched' % diff)
Пример #21
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
import requests
import __builtin__
import koding
import xbmc
import xbmcaddon
from koding import route
from resources.lib.util.info import get_info
from resources.lib.util.url import get_addon_url, replace_url
from resources.lib.util.xml import JenList, display_list
from resources.lib.plugin import run_hook
from language import get_string as _

theme = xbmcaddon.Addon().getSetting('theme')
if theme and theme != 'DEFAULT' and theme != 'none':
    fanart = JenList.set_theme(theme)
else:
    fanart = xbmcaddon.Addon().getAddonInfo('fanart')

icon = xbmcaddon.Addon().getAddonInfo('icon')


@route(mode="Search")
def search():
    """
    Open root search directory
    """
    versionspec = {"columns": {"version": "TEXT"}}
    koding.Create_Table("version", versionspec)
Пример #22
0
    import urllib as ul
import json
import datetime
import time
import re
import resources.lib.common as common
from sendung import Sendung
import tvnow

apiBase = "https://bff.apigw.tvnow.de"
formatImageURL = "https://ais.tvnow.de/tvnow/format/{fid}_formatlogo/408x229/image.jpg"
episodeImageURL = "https://ais.tvnow.de/tvnow/movie/{eid}/408x229/image.jpg"
addon_handle = int(sys.argv[1])
try:
    #py2
    icon_file = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path') +
                                   '/icon.png').decode('utf-8')
except:
    icon_file = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path') +
                                   '/icon.png')
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
addon = xbmcaddon.Addon()
plotEnabled = addon.getSetting('plot_enabled') == "true"


def parseDateTime(str):
    try:
        m = re.search(
            r'[A-z]+\.\s+([0-9]+).([0-9]+).([0-9]+),\s+([0-9]+):([0-9]+)', str)
        if m:
Пример #23
0
import os,threading
import xbmc,xbmcgui,xbmcplugin,xbmcaddon

addon = xbmcaddon.Addon()
dimEnabled = True if addon.getSetting('dim_enabled') == 'true' else False
dimTime = 60 * int('5' if addon.getSetting('dim_time') == '' else addon.getSetting('dim_time'))
sleepEnabled = True if addon.getSetting('sleep_enabled') == 'true' else False
sleepTime = 60 * int('30' if addon.getSetting('sleep_time') == '' else addon.getSetting('sleep_time'))


img = xbmc.translatePath( os.path.join( addon.getAddonInfo('path'), 'rain.jpg' ) )
img_dim = xbmc.translatePath( os.path.join( addon.getAddonInfo('path'), 'rain-dim.jpg' ) )
url = ["http://rainymood.com/audio1110/" + str(i) + ".ogg" for i in range(1, 8)]
# short ogg file to test loop:
# url = "http://images.wikia.com/starwars/images/f/f5/A_little_short.ogg"

class MyPlayer(xbmc.Player):
  def __init__(self):
    self.noiseIndex = 0
    self.playNoise()

  def onPlayBackEnded(self):
    self.noiseIndex = 0 if self.noiseIndex >= 7 else self.noiseIndex + 1
    self.playNoise()

  def playNoise(self):
    self.play(url[self.noiseIndex])

class MyWindow(xbmcgui.WindowDialog):
  def __init__(self):
    self.imgNormal = xbmcgui.ControlImage(1, 1, 1280, 720, img)
import xbmcaddon

import os

#########################################################
#         Global Variables - DON'T EDIT!!!              #
#########################################################
ADDON_ID = xbmcaddon.Addon().getAddonInfo('id')
PATH = xbmcaddon.Addon().getAddonInfo('path')
ART = os.path.join(PATH, 'resources', 'media')
#########################################################

#########################################################
#        User Edit Variables                            #
#########################################################
ADDONTITLE = '[COLORred]Biggerfootwizard'
BUILDERNAME = 'Bigfootbeeker'
EXCLUDES = [ADDON_ID, 'repository.biggerfootwizard']
# Text File with build info in it.
BUILDFILE = 'http://'
# How often you would like it to check for build updates in days
# 0 being every startup of kodi
UPDATECHECK = 0
# Text File with apk info in it.  Leave as 'http://' to ignore
APKFILE = 'http://'
# Text File with Youtube Videos urls.  Leave as 'http://' to ignore
YOUTUBETITLE = ''
YOUTUBEFILE = 'http://'
# Text File for addon installer.  Leave as 'http://' to ignore
ADDONFILE = 'http://'
# Text File for advanced settings.  Leave as 'http://' to ignore
Пример #25
0
# -*- coding: utf-8 -*-

import os, sys, urllib2
import settings
import time
#-----------------------------------------
prov = 'lada'
serv_id = '37'
provider = 'ILD_TLT'
port = 4022

udpxylist = []

try:
	import xbmcaddon
	addon = xbmcaddon.Addon(id='ptv3')
	root_dir = addon.getAddonInfo('path')
except:
	root_dir = os.getcwd()


from threading import Thread
class MyThread(Thread):
	def __init__(self, param={}):
		Thread.__init__(self)
	
	def run(self):
		upd_xy()

def update():
		my_thread = MyThread()
Пример #26
0
# -*- coding: utf-8 -*-
import urllib, urllib2, re, os, sys, math
import xbmcgui, xbmc, xbmcaddon, xbmcplugin
from urlparse import urlparse, parse_qs
import urlparser, urllib

scriptID = 'plugin.video.mrknow'
scriptname = "Filmy online www.mrknow.pl - zalukajseriale"
ptv = xbmcaddon.Addon(scriptID)

BASE_RESOURCE_PATH = os.path.join(ptv.getAddonInfo('path'), "../resources")
sys.path.append(os.path.join(BASE_RESOURCE_PATH, "lib"))

import mrknow_pLog, mrknow_pCommon, mrknow_Parser, mrknow_Player

log = mrknow_pLog.pLog()

mainUrl = 'http://zalukaj.tv/seriale'
#popularneUrl = 'http://www.zalukajseriale.eu/polecane/'

MENU_TAB = {1: "Najnowsze", 2: "Polecane", 3: "Kategorie", 4: "Szukaj"}


class zalukajseriale:
    def __init__(self):
        log.info('Starting zalukajseriale.pl')
        self.cm = mrknow_pCommon.common()
        self.parser = mrknow_Parser.mrknow_Parser()
        self.up = urlparser.urlparser()
        self.player = mrknow_Player.mrknow_Player()
Пример #27
0
#########################################
if 64 - 64: i11iIiiIii
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, urllib, urllib2, os, re, sys, base64
from resources.libs.common_addon import Addon
import requests
import resolveurl
from metahandler import metahandlers
from HTMLParser import HTMLParser
if 65 - 65: O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
o0OO00 = 'plugin.video.sexuria.com'
oi1000 = 'plugin.video.sexuria.com'
oo = Addon(o0OO00, sys.argv)
i1iII1IiiIiI1 = xbmcaddon.Addon(id=o0OO00)
iIiiiI1IiI1I1 = '[COLOR blue][B]Sexuria[/B][/COLOR]'
iIiiiI1IiI1I2 = '[COLOR blue][B]Sexuria[/B][/COLOR]'
o0OoOoOO00 = os.path.join(
    os.path.join(xbmc.translatePath('special://home'), 'addons'),
    'plugin.video.sexuria.com')
I11i = xbmc.translatePath(
    os.path.join('special://home/addons/' + o0OO00, 'fanart.jpg'))
O0O = xbmc.translatePath(
    os.path.join('special://home/addons/' + o0OO00, 'fanart.jpg'))
Oo = xbmc.translatePath(
    os.path.join('special://home/addons/' + o0OO00, 'icon.png'))
I1ii11iIi11i = 'https://img3.picload.org/image/dlgcaigw/nextpage.png'
I1IiI = xbmc.translatePath(
    os.path.join('special://home/userdata/addon_data/' + oi1000, 'favs.xml'))
o0OOO = xbmc.translatePath(
    os.path.join('special://home/userdata/addon_data/' + oi1000,
                 'settings.xml'))
iIiiiI = xbmc.translatePath(
Пример #28
0
# -*- coding: utf8 -*-

# Copyright (C) 2015 - Philipp Temminghoff <*****@*****.**>
# This program is Free Software see LICENSE file for details

from Utils import *
import xbmcaddon
from dialogs.BaseClasses import *

from local_db import get_imdb_id_from_db
ADDON = xbmcaddon.Addon()
ADDON_ID = ADDON.getAddonInfo('id')
ADDON_ICON = ADDON.getAddonInfo('icon')
ADDON_NAME = ADDON.getAddonInfo('name')
ADDON_PATH = ADDON.getAddonInfo('path').decode("utf-8")
INFO_DIALOG_FILE_CLASSIC = u'%s-DialogVideoInfo.xml' % (ADDON_ID)
LIST_DIALOG_FILE_CLASSIC = u'%s-VideoList.xml' % (ADDON_ID)
ACTOR_DIALOG_FILE_CLASSIC = u'%s-DialogInfo.xml' % (ADDON_ID)
if SETTING("force_native_layout") == "true":
    INFO_DIALOG_FILE = u'%s-DialogVideoInfo-classic.xml' % (ADDON_ID)
    LIST_DIALOG_FILE = u'%s-VideoList-classic.xml' % (ADDON_ID)
    ACTOR_DIALOG_FILE = u'%s-DialogInfo-classic.xml' % (ADDON_ID)
    path = os.path.join(ADDON_PATH, "resources", "skins", "Default", "1080i")
    if not xbmcvfs.exists(os.path.join(path, INFO_DIALOG_FILE)):
        xbmcvfs.copy(strSource=os.path.join(path, INFO_DIALOG_FILE_CLASSIC),
                     strDestnation=os.path.join(path, INFO_DIALOG_FILE))
    if not xbmcvfs.exists(os.path.join(path, LIST_DIALOG_FILE)):
        xbmcvfs.copy(strSource=os.path.join(path, LIST_DIALOG_FILE_CLASSIC),
                     strDestnation=os.path.join(path, LIST_DIALOG_FILE))
    if not xbmcvfs.exists(os.path.join(path, ACTOR_DIALOG_FILE)):
        xbmcvfs.copy(strSource=os.path.join(path, ACTOR_DIALOG_FILE_CLASSIC),
Пример #29
0
#!/usr/bin/python
#
#
# Written by MetalChris
# Released under GPL(v2) or Later

import urllib, urllib2, xbmcplugin, xbmcaddon, xbmcgui, re, xbmcplugin, sys
from bs4 import BeautifulSoup
import html5lib

youtube = 'youtube'
vimeo = 'vimeo'
artbase = 'special://home/addons/plugin.video.docstorm/resources/media/'
_addon = xbmcaddon.Addon()
_addon_path = _addon.getAddonInfo('path')
selfAddon = xbmcaddon.Addon(id='plugin.video.docstorm')
translation = selfAddon.getLocalizedString
usexbmc = selfAddon.getSetting('watchinxbmc')
settings = xbmcaddon.Addon(id="plugin.video.docstorm")
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
confluence_views = [500, 501, 502, 503, 504, 508]

plugin = "Documentary Storm"

defaultimage = 'special://home/addons/plugin.video.docstorm/icon.png'
defaultfanart = 'special://home/addons/plugin.video.docstorm/fanart.jpg'
#defaultvideo = 'special://home/addons/plugin.video.docstorm/icon.png'
defaulticon = 'special://home/addons/plugin.video.docstorm/icon.png'
#fanart = 'special://home/addons/plugin.video.docstorm/fanart.jpg'
back = ''
Пример #30
0
import urllib,urllib2,re,xbmcplugin,xbmcgui,urlresolver,sys,xbmc,xbmcaddon,os
from t0mm0.common.addon import Addon
from metahandler import metahandlers

addon_id = 'plugin.video.moviexk'
selfAddon = xbmcaddon.Addon(id=addon_id)
metaget = metahandlers.MetaData(preparezip=False)
addon = Addon(addon_id, sys.argv)
ADDON2=xbmcaddon.Addon(id='plugin.video.moviexk')
fanart = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id , 'fanart.jpg'))
icon = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id, 'icon.png'))
metaset = selfAddon.getSetting('enable_meta')

def CATEGORIES():
        addDir2('Latest Cinema Releases','http://www.moviexk.net/cinema/',1,icon,'',fanart)
        addDir2('Recently Added','http://www.moviexk.net/new-movies/',1,icon,'',fanart)
        addDir2('Most Viewed','http://www.moviexk.net/popular-movies/',1,icon,'',fanart)
        addDir2('HD Movies','http://www.moviexk.net/movies-hd/',1,icon,'',fanart)
        addDir2('Genres','http://www.moviexk.net',2,icon,'',fanart)      
        addDir2('Search','url',3,icon,'',fanart)
        xbmc.executebuiltin('Container.SetViewMode(50)')
               
def GETMOVIES(url,name):
        metaset = selfAddon.getSetting('enable_meta')
        link = open_url(url)
        match=re.compile('<a href="(.+?)" title="Movie (.+?)"><img class="lazy"').findall(link)
        for url,name in match:
                name=cleanHex(name)
                if metaset=='false':
                        addDir(name,url,100,icon,len(match),isFolder=False)
                else: addDir(name,url,100,'',len(match),isFolder=False)