Exemple #1
0
    def __init__(self, name=None, addon_id=None, filepath=None, info_type=None):
        self._name = name
        self._routes = []
        self._view_functions = {}

        # addon_id is no longer required as it can be parsed from addon.xml
        if addon_id:
            self._addon = xbmcaddon.Addon(id=addon_id)
        else:
            self._addon = xbmcaddon.Addon()

        self._addon_id = addon_id or self._addon.getAddonInfo('id')
        self._name = name or self._addon.getAddonInfo('name')

        self._info_type = info_type
        if not self._info_type:
            types = {
                'video': 'video',
                'audio': 'music',
                'image': 'pictures',
            }
            self._info_type = types.get(self._addon_id.split('.')[1], 'video')

        # Keeps track of the added list items
        self._current_items = []

        # Gets initialized when self.run() is called
        self._request = None

        # A flag to keep track of a call to xbmcplugin.endOfDirectory()
        self._end_of_directory = False

        # Keep track of the update_listing flag passed to
        # xbmcplugin.endOfDirectory()
        self._update_listing = False

        # The plugin's named logger
        self._log = setup_log(self._addon_id)

        # The path to the storage directory for the addon
        self._storage_path = xbmc.translatePath(
            'special://profile/addon_data/%s/.storage/' % self._addon_id)
        if not os.path.isdir(self._storage_path):
            os.makedirs(self._storage_path)

        # If we are runing in CLI, we need to load the strings.xml manually
        # Since xbmcswift2 currently relies on execution from an addon's root
        # directly, we can rely on cwd for now...
        if xbmcswift2.CLI_MODE:
            from xbmcswift2.mockxbmc import utils
            if filepath:
                addon_dir = os.path.dirname(filepath)
            else:
                addon_dir = os.getcwd()
            strings_fn = os.path.join(addon_dir, 'resources', 'language',
                                      'English', 'strings.xml')
            utils.load_addon_strings(self._addon, strings_fn)
Exemple #2
0
    def _inside(self, num):
        if num == -1:
            self._inside_root(select=self.insideIndex)
            return

        with self.lock:
            source, links = self.items[num]

            if len(links) == 1:
                self.selection = links[0]
                self.close()
                return

            self.list.reset()
            for item in links:
                listitem = xbmcgui.ListItem(item['label'])
                listitem.setProperty("Path", item['path'])

                try:
                    pluginid = item['path'].split("/")[2]
                    icon = xbmcaddon.Addon(id=pluginid).getAddonInfo('icon')
                    listitem.setIconImage(icon)
                except:
                    pass

                self.list.addItem(listitem)

            self.insideIndex = num
Exemple #3
0
def IIi1IiiiI1Ii():
    I11i11Ii("None", "None")
    oO00oOo = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    oO00oOo = xbmc.translatePath(os.path.join(oO00oOo, "temp.jpg"))
    # urllib . urlretrieve ( 'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/anhtrang.jpg' , oO00oOo )
    # OOOo0 = xbmcgui . ControlImage ( 0 , 0 , 1280 , 720 , oO00oOo )
    # Oooo000o = xbmcgui . WindowDialog ( )
    # Oooo000o . addControl ( OOOo0 )
    # Oooo000o . doModal ( )
    # IiIi11iIIi1Ii = ""
    # Oo0O = ( "Busy" , "Bận" , "Band" , "Beschäftigt" , "Bezig" , "忙" , "忙碌" )
    # while True :
    # IiI = urllib . quote ( xbmc . getInfoLabel ( "System.KernelVersion" ) . strip ( ) )
    # if not any ( b in IiI for b in Oo0O ) : break
    # while True :
    # ooOo = urllib . quote ( xbmc . getInfoLabel ( "System.FriendlyName" ) . strip ( ) )
    # if not any ( b in ooOo for b in Oo0O ) : break
    # try :
    # IiIi11iIIi1Ii = open ( '/sys/class/net/eth0/address' ) . read ( ) . strip ( )
    # except :
    # while True :
    # IiIi11iIIi1Ii = xbmc . getInfoLabel ( "Network.MacAddress" ) . strip ( )
    # if re . match ( "[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$" , IiIi11iIIi1Ii . lower ( ) ) : break
    # Oo = urllib2 . urlopen ( "http://www.viettv24.com/main/checkActivation.php?MacID=%s&app_id=%s&sys=%s&dev=%s" % ( IiIi11iIIi1Ii , "2" , IiI , ooOo ) ) . read ( )
    if True:
        o0O = [{
            'label':
            'Phim mới',
            'path':
            '%s/latest/%s/%s' %
            (ii,
             urllib.quote_plus(
                 'http://phim.anhtrang.org/danh-sach/new/trang-%s.html'), 1)
        }, {
            'label':
            'Phim HD',
            'path':
            '%s/hd/%s/%s' %
            (ii,
             urllib.quote_plus(
                 'http://phim.anhtrang.org/danh-sach/phim-hd/trang-%s.html'),
             1)
        }, {
            'label': 'Thể loại',
            'path': '%s/genres' % ii
        }, {
            'label': 'Quốc gia',
            'path': '%s/nations' % ii
        }, {
            'label': 'Tìm kiếm',
            'path': '%s/search' % ii
        }]
        return oo000.finish(o0O)
    else:
        IiiIII111iI = xbmcgui.Dialog()
        IiiIII111iI.ok("Chú ý", Oo)
        if 34 - 34:
            iii1I1I / O00oOoOoO0o0O.O0oo0OO0 + Oo0ooO0oo0oO.I1i1iI1i - II
        if 100 - 100: i11Ii11I1Ii1i.ooO - OOoO / ooo0Oo0 * i1 - OOooo0000ooo
Exemple #4
0
    def _inside(self, num):
        if num == -1:
            self._inside_root(select=self.insideIndex)
            return

        with self.lock:
            source, links = self.items[num]

            if len(links) == 1:
                self.selection = links[0]
                self.close()
                return
            self.list.reset()
            for item in links:
                listitem = xbmcgui.ListItem(item['label'])
                listitem.setProperty("Path", item['path'])
                try:
                    if "plugin://" in links[0]['path']:
                        icon = xbmcaddon.Addon(id=links[0]['path'].split("/")
                                               [2]).getAddonInfo('icon')
                    else:
                        icon = xbmc.translatePath("{0}/folder.jpg".format(
                            links[0]['path'].rsplit("/", 2)[0]))
                    listitem.setIconImage(icon)
                    listitem.setThumbnailImage(icon)
                except:
                    pass
                self.list.addItem(listitem)
            self.insideIndex = num
Exemple #5
0
 def __init__(self):
     self.logger.info('[UpdateService] - initialized')
     self.api_url = 'https://api.github.com/repos/wackerl91/luna/releases'
     self.current_version = re.match(
         self.regexp,
         xbmcaddon.Addon().getAddonInfo('version')).group()
     self.update_version = None
     self.asset_url = None
     self.asset_name = None
     self.changelog = None
Exemple #6
0
 def __init__(self, plugin, core, logger):
     self.plugin = plugin
     self.core = core
     self.logger = logger
     self.current_version = re.match(
         self.regexp,
         xbmcaddon.Addon().getAddonInfo('version')).group()
     self.update_version = None
     self.asset_url = None
     self.asset_name = None
     self.changelog = None
Exemple #7
0
def dir(url, title=""):
    oO00oOo = []
    i1IIi11111i("Browse Menu [%s]" % title, "/dir/%s/%s" % (title, url))
    try:
        if "://" in url:
            pass
        else:
            oO00oOo = IiII("%s/dir/%s" % (oooo, urllib.quote_plus(url)))
            for iII11i in oO00oOo:
                if "plugin://" not in iII11i["path"]:
                    iII11i["path"] = iI11I1II1I1I + iII11i["path"]
                elif "plugin://plugin.video.f4mTester" in iII11i["path"]:
                    iII11i[
                        "path"] = iI11I1II1I1I + "/execbuiltin/" + urllib.quote_plus(
                            iII11i["path"])
                    if 70 - 70: IiIi1Iii1I1 * ooO00oOoo
                    if 46 - 46: i1iIIIiI1I / o0OIiiIII111iI
                    if 52 - 52: iiI1i1 - O0O + I1Ii + I1Ii - iiI1i1 / Ooooo
                    if 44 - 44:
                        i1iIIIiI1I.oo000i1iIi11iIIi1 - ooO00oOoo.ooO0OO000o - i1iIIIiI1I
                    if 92 - 92: IiIi1Iii1I1.i1iIIII + iiI1i1
                    if 28 - 28:
                        oo000i1iIi11iIIi1 * Oo - iiI1i1 * O0O0O0O00OooO * I1Ii / o0OIiiIII111iI
                    if 94 - 94: Iii1IIIiiI % ooO00oOoo / Ii11111i * I11i11Ii
                    if 54 - 54: iiI1i1 - iI + O0O
                    if 70 - 70: I1Ii / i1iIIII.IiIi1Iii1I1 % Oo
                    if 67 - 67:
                        Ii11111i * iiI1i1.O0O0O0O00OooO - o0OIiiIII111iI * iiI1i1
                    if 46 - 46:
                        i1iII1I1i1i1 + Ii11111i.iI * O0OOo % O0O0O0O00OooO
                    if 86 - 86: iI + I1Ii % ii1I * O0OOo.i1iIIIiI1I * i1iIIII
    except:
        oo000 = xbmc.translatePath(
            xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
        i1I11i1iI = xbmc.translatePath(os.path.join(oo000, "error_icon.jpg"))
        I1ii1Ii1 = xbmc.translatePath(os.path.join(oo000, "error_bg.jpg"))
        iii11 = xbmc.translatePath(os.path.join(oo000, "error_fullscreen.jpg"))
        if 68 - 68: o0OIiiIII111iI
        IIi1iIIiI = [{
            "label":
            "Connection Error! OK Here for more details",
            "path":
            "%s/showimage/%s" % (iI11I1II1I1I, urllib.quote_plus(iii11)),
            "thumbnail":
            i1I11i1iI,
            "properties": {
                'fanart_image': I1ii1Ii1
            }
        }]
        oO00oOo += IIi1iIIiI
    return O0.finish(oO00oOo)
    if 58 - 58:
        i1iIIIiI1I / Iii1IIIiiI - i1iII1I1i1i1 - ii1I % Ii11111i - Ooooo
Exemple #8
0
def IIi1IiiiI1Ii():
    I11i11Ii = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    I11i11Ii = xbmc.translatePath(os.path.join(I11i11Ii, "temp.jpg"))
    #urllib . urlretrieve ( 'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/kenh108.jpg' , I11i11Ii )
    #oO00oOo = xbmcgui . ControlImage ( 0 , 0 , 1280 , 720 , I11i11Ii )
    #OOOo0 = xbmcgui . WindowDialog ( )
    #OOOo0 . addControl ( oO00oOo )
    #OOOo0 . doModal ( )
    #Oooo000o = ""
    #IiIi11iIIi1Ii = ( "Busy" , "Bận" , "Band" , "Beschäftigt" , "Bezig" , "忙" , "忙碌" )
    #while True :
    #Oo0O = urllib . quote ( xbmc . getInfoLabel ( "System.KernelVersion" ) . strip ( ) )
    #if not any ( b in Oo0O for b in IiIi11iIIi1Ii ) : break
    #while True :
    #IiI = urllib . quote ( xbmc . getInfoLabel ( "System.FriendlyName" ) . strip ( ) )
    #if not any ( b in IiI for b in IiIi11iIIi1Ii ) : break
    #try :
    #Oooo000o = open ( '/sys/class/net/eth0/address' ) . read ( ) . strip ( )
    #except :
    #while True :
    #Oooo000o = xbmc . getInfoLabel ( "Network.MacAddress" ) . strip ( )
    #if re . match ( "[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$" , Oooo000o . lower ( ) ) : break
    #ooOo = urllib2 . urlopen ( "http://www.viettv24.com/main/checkActivation.php?MacID=%s&app_id=%s&sys=%s&dev=%s" % ( Oooo000o , "6" , Oo0O , IiI ) ) . read ( )
    if True:
        Oo = [{
            'label':
            'Recently Updated Videos',
            'path':
            '%s/updated/%s/%s' %
            (ii,
             urllib.quote_plus(
                 'http://www.lsb-movies.net/kenh108/index.php?do=list&type=recently_updated&page=%s'
             ), 1)
        }, {
            'label':
            'Recently Added Videos',
            'path':
            '%s/added/%s/%s' %
            (ii,
             urllib.quote_plus(
                 'http://www.lsb-movies.net/kenh108/index.php?do=list&type=more&page=%s'
             ), 1)
        }, {
            'label': 'Search',
            'path': '%s/search' % ii
        }]
        return oo000.finish(Oo)
    else:
        o0O = xbmcgui.Dialog()
        o0O.ok("Chú ý", ooOo)
        if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * o00O0oo
        if 97 - 97: oO0o0ooO0 - IIII / O0oO - o0oO0
Exemple #9
0
def select_ext(title, populator, tasks_count):
    addonPath = xbmcaddon.Addon().getAddonInfo('path').decode('utf-8')
    dlg = SelectorDialog("DialogSelect.xml",
                         addonPath,
                         title=title,
                         populator=populator,
                         steps=tasks_count)

    with ExtendedDialogHacks():
        dlg.doModal()
        selection = dlg.get_selection()
        del dlg

    return selection
Exemple #10
0
def man_control():
    xmod = xbmcaddon.Addon('plugin.video.interactivelighting')
    sport = xmod.getSetting('serial port')
    try:
        serport = serial.Serial(sport, '57600', timeout=2)
        while True:
            lvals = utils.getlightvals()
            plvals = utils.package_bytes(lvals, 32)
            print 'writing to channels'
            serport.write(bytearray(plvals))
            xbmc.sleep(100)
        serport.close()
    except Exception:
        print "serial port failed"
Exemple #11
0
    def do_update(self, update):
        file_path = update.file_path
        with open(file_path, 'wb') as asset:
            asset.write(urllib2.urlopen(update.asset_url).read())
            asset.close()
        zip_file = zipfile.ZipFile(file_path)
        zip_file.extractall(xbmcaddon.Addon().getAddonInfo('path'),
                            self._get_members(zip_file))

        xbmcgui.Dialog().ok(
            self.core.string('name'),
            'Luna has been updated to version %s and will now relaunch.' %
            update.update_version)

        xbmc.executebuiltin('RunPlugin(\'script.luna\')')
Exemple #12
0
def o0O0O00(url):
    O0oo0OO0 = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    o000o = xbmc.translatePath(os.path.join(O0oo0OO0, "tmp"))
    if os.path.exists(o000o):
        shutil.rmtree(o000o)
    os.makedirs(o000o)
    if ".zip" in url:
        I11IiI1I11i1i = xbmc.translatePath(os.path.join(o000o, "temp.zip"))
        urllib.urlretrieve(url, I11IiI1I11i1i)
        IiiIII111iI(I11IiI1I11i1i, o000o)
    else:
        iI1ii1Ii = xbmc.translatePath(os.path.join(o000o, "temp.jpg"))
        urllib.urlretrieve(url, iI1ii1Ii)
    xbmc.executebuiltin("SlideShow(%s,recursive)" % o000o)
    if 92 - 92: Ooo0O
Exemple #13
0
def IIi1IiiiI1Ii():
    I11i11Ii("None", "None")
    oO00oOo = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    #oO00oOo = xbmc . translatePath ( os . path . join ( oO00oOo , "temp.jpg" ) )
    #urllib . urlretrieve ( 'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/phim60s.jpg' , oO00oOo )
    #OOOo0 = xbmcgui . ControlImage ( 0 , 0 , 1280 , 720 , oO00oOo )
    #Oooo000o = xbmcgui . WindowDialog ( )
    #Oooo000o . addControl ( OOOo0 )
    #Oooo000o . doModal ( )
    if 6 - 6: i1 * ii1IiI1i % OOooOOo / I11i / o0O / IiiIII111iI
    IiII = [{
        'label':
        'Phim mới',
        'path':
        '%s/latest/%s/%s' %
        (ii, urllib.quote_plus('http://m.phim60s.info/film-new.html?p=%s'), 1)
    }, {
        'label':
        'Phim hot',
        'path':
        '%s/hottest/%s/%s' %
        (ii, urllib.quote_plus('http://m.phim60s.info/film-hot.html?p=%s'), 1)
    }, {
        'label':
        'Phim lẻ',
        'path':
        '%s/movies/%s/%s' %
        (ii, urllib.quote_plus('http://m.phim60s.info/film-le.html?p=%s'), 1)
    }, {
        'label':
        'Phim bộ',
        'path':
        '%s/series/%s/%s' %
        (ii, urllib.quote_plus('http://m.phim60s.info/film-bo.html?p=%s'), 1)
    }, {
        'label': 'Theo thể loại',
        'path': '%s/genres' % ii
    }, {
        'label': 'Theo Quốc gia',
        'path': '%s/nations' % ii
    }, {
        'label': 'Tìm kiếm',
        'path': '%s/search' % ii
    }]
    return oo000.finish(IiII)
    if 28 - 28: Ii11111i * iiI1i1
Exemple #14
0
def Iii1I1():
    OOO0O0O0ooooo = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    if 49 - 49:
        OOO0O0O0ooooo = xbmc.translatePath(
            os.path.join(OOO0O0O0ooooo, "temp.jpg"))
    if 49 - 49:
        urllib.urlretrieve(
            'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/donggiao.jpg',
            OOO0O0O0ooooo)
    if 49 - 49:
        iIIii1IIi = xbmcgui.ControlImage(0, 0, 1280, 720, OOO0O0O0ooooo)
    if 49 - 49: o0OO00 = xbmcgui.WindowDialog()
    if 49 - 49: o0OO00.addControl(iIIii1IIi)
    if 49 - 49: o0OO00.doModal()
    oo = [{
        'label':
        'Đồng Giao Official',
        'path':
        'plugin://plugin.video.youtube/channel/UCZTjI84dMcWPLMDd7HjzFnA/',
        'thumbnail':
        'https://yt3.ggpht.com/-5TD-pJoIQRY/AAAAAAAAAAI/AAAAAAAAAAA/oBUSns1u68U/s256-c-k-no/photo.jpg'
    }, {
        'label':
        'Dong Giao Pro',
        'path':
        'plugin://plugin.video.youtube/channel/UCkRLTtpdJj-8Of10-N9E9Ug/',
        'thumbnail':
        'https://yt3.ggpht.com/-S280zJuQrK0/AAAAAAAAAAI/AAAAAAAAAAA/qrXrrcjVT28/s256-c-k-no/photo.jpg'
    }, {
        'label':
        'Giang Nguyen',
        'path':
        'plugin://plugin.video.youtube/channel/UCfxY1HzwvH1gBfAG8O-kNwA/',
        'thumbnail':
        'https://yt3.ggpht.com/-FDJoaZ4E_MU/AAAAAAAAAAI/AAAAAAAAAAA/0F0jKAmhaP0/s256-c-k-no/photo.jpg'
    }, {
        'label':
        'MrBeGiang',
        'path':
        'plugin://plugin.video.youtube/channel/UC1L_0MbpbkPRPE01t8neBZg/',
        'thumbnail':
        'https://yt3.ggpht.com/-WbQ8qe3augw/AAAAAAAAAAI/AAAAAAAAAAA/u3YVPUd0U4o/s256-c-k-no/photo.jpg'
    }]
    return oo000.finish(oo)
    if 27 - 27: oO0OooOoO * o0Oo
    if 5 - 5: OoO0O00
Exemple #15
0
    def _inside_root(self, select=-1):
        with self.lock:
            self.list.reset()

            for source, links in self.items:
                if len(links) > 1:
                    source += " >>"
                listitem = xbmcgui.ListItem(source)
                try:
                    icon = xbmcaddon.Addon(
                        id=links[0]['path'].split("/")[2]).getAddonInfo('icon')
                    listitem.setIconImage(icon)
                except:
                    pass
                self.list.addItem(listitem)

            if select >= 0:
                self.list.selectItem(select)
            self.insideIndex = -1
Exemple #16
0
def OOooOoooOoOo(url):
    oo000 = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    o0OOOO00O0Oo = xbmc.translatePath(os.path.join(oo000, "tmp"))
    if os.path.exists(o0OOOO00O0Oo):
        shutil.rmtree(o0OOOO00O0Oo)
    os.makedirs(o0OOOO00O0Oo)
    if ".zip" in url:
        iioOooOOOoOo = xbmc.translatePath(
            os.path.join(o0OOOO00O0Oo, "temp.zip"))
        urllib.urlretrieve(url, iioOooOOOoOo)
        i1I1ii1II1iII(iioOooOOOoOo, o0OOOO00O0Oo)
        xbmc.executebuiltin("SlideShow(%s,recursive)" % o0OOOO00O0Oo)
        if 41 - 41: I1Ii - ooO0OO000o - ooO0OO000o
        if 68 - 68: i1iII1I1i1i1 % Ooooo
    else:
        ooO00OO0 = xbmcgui.WindowDialog()
        i11111IIIII = xbmcgui.ControlImage(0, 0, 1280, 720, url)
        ooO00OO0.addControl(i11111IIIII)
        ooO00OO0.doModal()
        if 19 - 19: Ii11111i * oo000i1iIi11iIIi1
Exemple #17
0
    def _login(self):
        settings = xbmcaddon.Addon(id='plugin.video.mlbbasesloaded')
        username = str(settings.getSetting(id="username"))
        password = str(settings.getSetting(id="password"))
        if not username or not password:
            msg = "Please set your username and password in the settings"
            dialog = xbmcgui.Dialog()
            ok = dialog.ok('Invalid Login', msg)
            sys.exit()

        url = 'https://securea.mlb.com/authenticate.do'
        login_data = {
            'password': password,
            'emailAddress': username,
            'uri': '/account/login_register.jsp',
            'registrationAction': 'identify'
        }
        headers = {
            "Accept":
            "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
            "Accept-Encoding": "gzip, deflate",
            "Accept-Language": "en-US,en;q=0.8",
            "Content-Type": "application/x-www-form-urlencoded",
            "Origin": "https://securea.mlb.com",
            "Connection": "keep-alive",
            "Cookie":
            "SESSION_1=wf_forwardUrl%3D%3D%3Dhttp%3A%2F%2Fm.mlb.com%2Ftv%2Fe14-469412-2016-03-02%2Fv545147283%2F%3F%26media_type%3Dvideo%26clickOrigin%3DMedia%2520Grid%26team%3Dmlb%7Ewf_flowId%3D%3D%3Dregistration.dynaindex%7Ewf_template%3D%3D%3Dmp5default%7Ewf_mediaTypeTemplate%3D%3D%3Dvideo%7Estage%3D%3D%3D3%7EflowId%3D%3D%3Dregistration.dynaindex%7EforwardUrl%3D%3D%3Dhttp%3A%2F%2Fm.mlb.com%2Ftv%2Fe14-469412-2016-03-02%2Fv545147283%2F%3F%26media_type%3Dvideo%26clickOrigin%3DMedia%2520Grid%26team%3Dmlb%3B",
            "User-Agent": UA_PC
        }
        session = requests.Session()
        response = session.post(url, data=login_data, headers=headers)
        if response.url == url:
            msg = "Please check that your username and password are correct"
            dialog = xbmcgui.Dialog()
            ok = dialog.ok('Invalid Login', msg)
            sys.exit()
        else:
            xbmc.log("_login cookies response {0}".format(session.cookies))
            self._write_cookies(session.cookies)
Exemple #18
0
    def _inside_root(self, select=-1):
        with self.lock:
            self.list.reset()

            for source, links in self.items:
                if len(links) > 1:
                    source += " > {0}".format(_("Found %i items") % len(links))
                listitem = xbmcgui.ListItem(source)
                try:
                    if "plugin://" in links[0]['path']:
                        icon = xbmcaddon.Addon(id=links[0]['path'].split("/")
                                               [2]).getAddonInfo('icon')
                    else:
                        icon = xbmc.translatePath("{0}/folder.jpg".format(
                            links[0]['path'].rsplit("/", 2)[0]))
                    listitem.setIconImage(icon)
                    listitem.setThumbnailImage(icon)
                except:
                    pass
                self.list.addItem(listitem)

            if select >= 0:
                self.list.selectItem(select)
            self.insideIndex = -1
Exemple #19
0
        o00OO0OOO0.close()
        if "gzip" in o00OO0OOO0.info().getheader('Content-Encoding'):
            oo0O0oOOO00oO = zlib.decompress(oo0O0oOOO00oO, 16 + zlib.MAX_WBITS)
        return oo0O0oOOO00oO
    else:
        o00OO0OOO0 = urllib2.urlopen(Ii)
        oo0O0oOOO00oO = o00OO0OOO0.read()
        o00OO0OOO0.close()
        if "gzip" in o00OO0OOO0.info().getheader('Content-Encoding'):
            oo0O0oOOO00oO = zlib.decompress(oo0O0oOOO00oO, 16 + zlib.MAX_WBITS)
        return oo0O0oOOO00oO
        if 83 - 83: iII111iiiii11


Iii111II = xbmc.translatePath(
    xbmcaddon.Addon('plugin.video.moviebox').getAddonInfo('profile'))
if 9 - 9: I11i
if os.path.exists(Iii111II) == False:
    os.mkdir(Iii111II)
i11 = os.path.join(Iii111II, 'visitor')
if 58 - 58: o0oo0o * Oo0Ooo / o0O % O0OOo - Ii11111i / iiI1i1
if os.path.exists(i11) == False:
    from random import randint
    ii11i1 = open(i11, "w")
    ii11i1.write(str(randint(0, 0x7fffffff)))
    ii11i1.close()
    if 29 - 29:
        Ii11111i % ii1IiI1i + OOo000 / IiiIII111iI + o0oo0o * IiiIII111iI


def i1I1iI(utm_url):
#!/usr/bin/python
#coding=utf-8
import httplib2, json, re, urllib, os, uuid, contextlib, zipfile, random, base64, time
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from xbmcswift2 import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path = xbmc.translatePath(
    xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin = Plugin()
addon = xbmcaddon.Addon("plugin.video.HieuHien.vn")
pluginrootpath = "plugin://plugin.video.HieuHien.vn"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
    "User-Agent":
    "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
    "Accept-Encoding": "gzip, deflate, sdch, br"
}


def GetSheetIDFromSettings():
    '''
	Hàm lấy url chuyển tiếp
	Parameters
	----------
	url_path : string
Exemple #21
0
# -*- coding: utf8 -*-

from xbmcswift2 import Plugin, CLI_MODE, xbmcaddon, ListItem, xbmc, xbmcgui, xbmcplugin
import os
import sys

try:
    from ChineseKeyboard import Keyboard
except Exception, e:
    print e
    from xbmc import Keyboard

CATE = ["喜剧", "科幻", "恐怖", "剧情", "魔幻", "罪案", "冒险", "动作", "悬疑"]

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")
ADDON_VERSION = ADDON.getAddonInfo('version')
ADDON_DATA_PATH = xbmc.translatePath("special://profile/addon_data/%s" %
                                     ADDON_ID).decode("utf-8")
sys.path.append(os.path.join(ADDON_PATH, 'resources', 'lib'))
from rrmj import *
from common import *

plugin = Plugin()
Meiju = RenRenMeiJu()
PAGE_ROWS = plugin.get_setting("page_rows")
SEASON_CACHE = plugin.get_storage('season')
HISTORY = plugin.get_storage('history')
Exemple #22
0
#!/usr/bin/python
#coding=utf-8
import httplib2, json, re, urllib, os, uuid, contextlib, zipfile, random, base64, time, thread
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from xbmcswift2 import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path = xbmc.translatePath(
    xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin = Plugin()
addon = xbmcaddon.Addon("plugin.video.family")
pluginrootpath = "plugin://plugin.video.family"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
    "User-Agent":
    "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
    "Accept-Encoding": "gzip, deflate, sdch, br"
}


def GetSheetIDFromSettings():
    sid = "13eYVS7eVDdzMjUeCQeGsQoYajUntmVSq7uCrtOTAxl4"
    resp, content = http.request(plugin.get_setting("GSheetURL"), "HEAD")
    try:
        sid = re.compile("/d/(.+?)/").findall(resp["content-location"])[0]
#!/usr/bin/python
#coding=utf-8
import httplib2, json, re, urllib, os, uuid, contextlib, zipfile, random, base64, time, thread
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from xbmcswift2 import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path          = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path') ).decode("utf-8")
cache         = xbmc.translatePath(os.path.join(path,".cache"))
tmp           = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image         = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin         = Plugin()
addon          = xbmcaddon.Addon("plugin.video.salemmax.gshare")
pluginrootpath = "plugin://plugin.video.salemmax.gshare"
http           = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url      = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers  = {
	"User-Agent"      : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
	"Accept-Encoding" : "gzip, deflate, sdch, br"
}

def GetSheetIDFromSettings():
	sid = "1Jg4T1y4oi2vjTId0TnMVNBsOItHhf-u0TVplB7AkZtM"
	resp, content = http.request(plugin.get_setting("GSheetURL"),"HEAD")
	try:
		sid = re.compile("/d/(.+?)/").findall(resp["content-location"])[0]
	except: pass
	return sid
Exemple #24
0
def IIi1IiiiI1Ii():
    I11i11Ii = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    if 49 - 49:
        I11i11Ii = xbmc.translatePath(os.path.join(I11i11Ii, "temp.jpg"))
    if 49 - 49:
        urllib.urlretrieve(
            'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/vtvplus.jpg',
            I11i11Ii)
    if 49 - 49: oO00oOo = xbmcgui.ControlImage(0, 0, 1280, 720, I11i11Ii)
    if 49 - 49: OOOo0 = xbmcgui.WindowDialog()
    if 49 - 49: OOOo0.addControl(oO00oOo)
    if 49 - 49: OOOo0.doModal()
    if 54 - 54: i1 - o0 * i1oOo0OoO * iIIIiiIIiiiIi % Oo
    o0O = [
        {
            'label': 'NatGeo Wild HD',
            'path': '%s/play/%s' % (ii, '48'),
            'is_playable': True,
            'thumbnail':
            'http://vtvplus.vn/vtv/thumb.php?src=https://api.vtvplus.vn/pro/files/channel/48.jpg&a=t&w=291&h=163',
            'info': {
                'plot': ''
            }
        },
        {
            'label': 'National Geographic HD',
            'path': '%s/play/%s' % (ii, '46'),
            'is_playable': True,
            'thumbnail':
            'http://vtvplus.vn/vtv/thumb.php?src=https://api.vtvplus.vn/pro/files/channel/46.jpg&a=t&w=291&h=163',
            'info': {
                'plot': ''
            }
        },
        {
            'label': 'Star Movies HD',
            'path': '%s/play/%s' % (ii, '18'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/StarMoviesHD.jpg',
            'info': {
                'plot': 'Kênh phim truyện nước ngoài của Fox Corporation'
            }
        },
        {
            'label': 'Star World HD',
            'path': '%s/play/%s' % (ii, '44'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/StarworldHD.jpg',
            'info': {
                'plot': 'Kênh giải trí StarWorld HD'
            }
        },
        {
            'label': 'VTVcab 16 - Bóng Đá TV HD',
            'path': '%s/play/%s' % (ii, '11'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab16-BongdaHD.jpg',
            'info': {
                'plot':
                'VTVcab 16 - Bóng đá TV phát sóng trực tiếp 5 Giải bóng đá hàng đầu Châu Âu gồm Ngoại hạng Anh (EPL), Tây Ban Nha (La Liga), Đức (Bundesliga), Ý (Serie A) và Pháp (Ligue 1). \nNgoài ra, Bóng Đá TV còn đem đến cho khán giả rất nhiều nội dung thể thao đặc sắc khác.'
            }
        },
        {
            'label': 'SCTV Hài HD',
            'path': '%s/play/%s' % (ii, '36'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/SCTV-HaiHD.jpg',
            'info': {
                'plot': 'Kênh Hài SCTV chất lượng cao'
            }
        },
        {
            'label': 'SCTV Thể thao HD',
            'path': '%s/play/%s' % (ii, '8'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/SCTV-TheThaoHD.jpg',
            'info': {
                'plot':
                'SCTV HD Thể Thao là kênh thể thao chuyên biệt của Công ty Truyền hình cáp Saigontourist. Trực tiếp thể thao tổng hợp, bóng đá, tennis, cầu lông, bóng bàn… Xem trực tiếp bóng đá trên kênh SCTV HD Thể Thao với bình luận tiếng Việt'
            }
        },
        {
            'label': 'VTV6 HD',
            'path': '%s/play/%s' % (ii, '5'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/1Logo-VTV6.jpg',
            'info': {
                'plot':
                'Kênh truyền hình dành cho thanh thiếu niên, nhi đồng, tập trung vào đời sống văn hóa trẻ, cuộc sống đời thường, các vấn đề xã hội cập nhật, hướng dẫn kỹ năng sống, văn hóa thế giới và Việt Nam của Truyền hình Việt Nam'
            }
        },
        {
            'label': 'VTV3 HD',
            'path': '%s/play/%s' % (ii, '1'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/VTV3HD.jpg',
            'info': {
                'plot':
                'VTV3 là kênh truyền hình thông tin thể thao, giải trí và thông tin kinh tế của Đài Truyền hình Việt Nam. Đây là kênh truyền hình phổ biến nhất tại Việt Nam với các chương trình phong phú nhằm phục vụ nhu cầu giải trí của khán giả mọi lứa tuổi. '
            }
        },
        {
            'label': 'VTVcab 2 - Phim Việt',
            'path': '%s/play/%s' % (ii, '20'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab2-PhimViet.jpg',
            'info': {
                'plot':
                'VTVcab 2 - Phim Việt là kênh phim truyện Việt Nam của Truyền hình cáp Việt Nam . Nội dung các bộ phim trên kênh Phim Việt phù hợp với mọi lứa tuổi. Phim Việt đề cập đến những vấn đề gần gũi với đời sống người dân, nội dung hấp dẫn, mang hơi thở thời đại.'
            }
        },
        {
            'label': 'VTVcab 5 - Echannel',
            'path': '%s/play/%s' % (ii, '21'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab5-Echannel.jpg',
            'info': {
                'plot':
                'VTVcab 5 - Echannel là kênh giải trí tổng hợp hướng thực tế cho khán giả nữ độ tuổi từ 18 đến 45.\nVới phương châm cung cấp nội dung “Mới mỗi ngày”, E-Channel là một “món ăn tinh thần” mới cho khán giả với những bộ phim đặc sắc của điện ảnh thế giới và chương trình giải trí tổng hợp vui nhộn.'
            }
        },
        {
            'label': 'VTVcab 7 - D Dramas',
            'path': '%s/play/%s' % (ii, '19'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab7-DDramas.jpg',
            'info': {
                'plot':
                'VTVcab 7 - D-Dramas là kênh phim truyện châu Á với khẩu hiệu “Yêu Drama, sống cùng Drama”. Kênh mang đến cho khán giả yêu thích phim ảnh trên cả nước, đặc biệt tại Hà Nội và TP.HCM, những bộ phim giải trí hiện đại, đặc sắc trong lẫn ngoài nước.'
            }
        },
        {
            'label': 'VTVcab 8 - Bibi',
            'path': '%s/play/%s' % (ii, '59'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab8-Bibi.jpg',
            'info': {
                'plot':
                'VTVcab 8 - BiBi – “Bay bổng cùng thế giới diệu kỳ”.\nLần đầu tiên tại Việt Nam, các em nhỏ có riêng một kênh hoạt hình thuyết minh tiếng Việt, phát sóng 18/24h. Các em nhỏ như lạc vào thế giới diệu kỳ với bao điều kỳ lạ, được bay bổng, được sống với những nhân vật hoạt hình mà các em ngưỡng mộ.'
            }
        },
        {
            'label': 'VTVcab 10 - O2 TV',
            'path': '%s/play/%s' % (ii, '62'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab10-O2TV.jpg',
            'info': {
                'plot':
                'VTVcab 10 - O2TV phát sóng liên tục 24/24 mỗi ngày, luôn cập nhật thông tin chính thống và nhanh nhất từ các chuyên gia đầu ngành về y tế. \nO2TV – Sống khỏe mỗi ngày!'
            }
        },
        {
            'label': 'VTVcab 15 - Invest TV',
            'path': '%s/play/%s' % (ii, '14'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/Cab15-InvestTV.jpg',
            'info': {
                'plot':
                'VTVcab 15 - InvestTV là kênh truyền hình chuyên biệt về lĩnh vực đầu tư, kinh tế và những vấn đề kinh tế xã hội. InvestTV là cầu nối giữa doanh nghiệp trong nước với các nhà đầu tư nước ngoài, cung cấp thông tin thuộc lĩnh vực đầu tư, tài chính, nguồn nhân lực, chứng khoán, bất động sản, hàng hóa...'
            }
        },
        {
            'label': 'HTV3',
            'path': '%s/play/%s' % (ii, '39'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/HTV3.jpg',
            'info': {
                'plot':
                'HTV3 là một kênh truyền hình đặc sắc thuộc Đài Truyền hình Thành phố Hồ Chí Minh. Nội dung phát sóng của HTV3 hoàn toàn dành cho trẻ em, thanh thiếu niên và gia đình.Chương trình bao gồm nhiều bộ phim Châu Á độc quyền và có bản quyền được lồng tiếng cùng với những chương trình giải trí, giáo dục...'
            }
        },
        {
            'label': 'HTV4',
            'path': '%s/play/%s' % (ii, '42'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/HTV4.jpg',
            'info': {
                'plot':
                'HTV4 là kênh khoa học giáo dục - dành cho mọi lứa tuổi, đặc biệt là những người thích tìm tòi, học hỏi, khám phá về cuộc sống, về thế giới muôn màu với bao điều diệu kỳ, bí ẩn trong vũ trụ bao la. Từ đó cho ta những giải đáp về các hiện tượng trong cuộc sống đời thường.'
            }
        },
        {
            'label': 'HTV7',
            'path': '%s/play/%s' % (ii, '37'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/HTV7.jpg',
            'info': {
                'plot': 'Kênh tổng hợp truyền hình thành phố HCM'
            }
        },
        {
            'label': 'HTV9',
            'path': '%s/play/%s' % (ii, '38'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/HTV9.jpg',
            'info': {
                'plot': 'Kênh chính trị - xã hội truyền hình thành phố HCM'
            }
        },
        {
            'label': 'HTV Thể thao',
            'path': '%s/play/%s' % (ii, '13'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/HTV-Thethao.jpg',
            'info': {
                'plot':
                'HTVC-THETHAO là một kênh của Đài truyền hình cáp TP Hồ Chí Minh phát sóng các hoạt động thể thao đỉnh cao trong nước và các giải đấu quốc tế. Các tiết mục được sắp xếp phát xem kẽ theo các buổi sáng, trưa, chiều, tối, giúp cho các đối tượng khán giả có thể theo dõi chương trình yêu thích của mình.'
            }
        },
        {
            'label': 'HTVC FBNC',
            'path': '%s/play/%s' % (ii, '43'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/logoFBNC.jpg',
            'info': {
                'plot':
                'FBNC - Được đánh giá là một kênh truyền hình chuyên nghiệp nhất của thành phố Hồ Chí Minh, FBNC tổng hợp các thông tin liên quan đến Kinh tế, tài chính của Việt Nam và thế giới, chứng khoán và đời sống, kinh nghiệm kinh doanh…'
            }
        },
        {
            'label': 'Yeah1TV',
            'path': '%s/play/%s' % (ii, '63'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/logo-yeah1tv.png',
            'info': {
                'plot':
                'Yeah1 TV là kênh truyền hình mang đến cho khán giả trẻ hàng loạt chương trình giải trí, văn hóa, thể thao, âm nhạc, đời sống, giáo dục với nội dung hấp dẫn và hình thức sáng tạo mới lạ, có tính tương tác cao với người xem. Yeah1 TV phát sóng trên hệ thống cáp HTVC, VTVcab'
            }
        },
        {
            'label': 'Yan TV',
            'path': '%s/play/%s' % (ii, '31'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/YanTV.jpg',
            'info': {
                'plot': 'Kênh truyền hình giải trí hàng đầu dành cho giới trẻ.'
            }
        },
        {
            'label': 'SCTV13',
            'path': '%s/play/%s' % (ii, '33'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/SCTV13.jpg',
            'info': {
                'plot': 'Kênh Phụ nữ và gia đình'
            }
        },
        {
            'label': 'VTC7 - TodayTV',
            'path': '%s/play/%s' % (ii, '24'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/TodayTV.jpg',
            'info': {
                'plot': 'VTC7 - TodayTV'
            }
        },
        {
            'label': 'TTXVN',
            'path': '%s/play/%s' % (ii, '54'),
            'is_playable': True,
            'thumbnail':
            'https://api.vtvplus.vn/pro/files/uploads/images/TTXVN.jpg',
            'info': {
                'plot':
                'Truyền hình Thông tấn là cơ quan nghiệp vụ thông tin của TTXVN với chức năng: Tổ chức, xây dựng và sản xuất các chương trình thông tin nghe nhìn tuyên truyền về đường lối, chủ trương, chính sách của Đảng và Nhà nước, thông tin đối nội và đối ngoại về các vấn đề kinh tế, văn hoá, xã hội của đất nước.'
            }
        },
        {
            'label': 'BBC World News Live',
            'path': '%s/play/%s' % (ii, '49'),
            'is_playable': True,
            'thumbnail':
            'http://vtvplus.vn/vtv/thumb.php?src=https://api.vtvplus.vn/pro/files/channel/49.jpg&a=t&w=291&h=163',
            'info': {
                'plot': ''
            }
        },
        {
            'label': 'MTV Phụ đề tiếng Việt',
            'path': '%s/play/%s' % (ii, '55'),
            'is_playable': True,
            'thumbnail':
            'http://vtvplus.vn/vtv/thumb.php?src=https://api.vtvplus.vn/pro/files/channel/55.jpg&a=t&w=291&h=163',
            'info': {
                'plot': ''
            }
        },
        {
            'label': 'iMovie',
            'path': '%s/play/%s' % (ii, '69'),
            'is_playable': True,
            'thumbnail':
            'http://vtvplus.vn/vtv/thumb.php?src=https://api.vtvplus.vn/pro/files/channel/69.jpg&a=t&w=291&h=163',
            'info': {
                'plot': ''
            }
        },
        {
            'label': 'HTVC Thuần Việt',
            'path': '%s/play/%s' % (ii, '30'),
            'is_playable': True,
            'thumbnail':
            'http://vtvplus.vn/vtv/thumb.php?src=https://api.vtvplus.vn/pro/files/channel/30.jpg&a=t&w=291&h=163',
            'info': {
                'plot': ''
            }
        },
    ]
    return oo000.finish(o0O)
    if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * o00O0oo
Exemple #25
0
from xbmcswift2 import xbmc, xbmcaddon
import os

UA_PS4 = 'PS4Application libhttp/1.000 (PS4) libhttp/3.15 (PlayStation 4)'
UA_PC = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
COOKIE_PATH = xbmc.translatePath(
    os.path.join(xbmcaddon.Addon().getAddonInfo('profile'), 'cookies.p'))
ADDON_PATH_PROFILE = xbmc.translatePath(
    xbmcaddon.Addon().getAddonInfo('profile'))
Exemple #26
0
#!/usr/bin/python
#coding=utf-8
import httplib2, json, re, urllib, os, uuid, contextlib, zipfile, random, base64, time, thread
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from xbmcswift2 import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path          = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('path') ).decode("utf-8")
cache         = xbmc.translatePath(os.path.join(path,".cache"))
tmp           = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image         = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin         = Plugin()
addon          = xbmcaddon.Addon("plugin.video.tranhuyhoang.playlist")
pluginrootpath = "plugin://plugin.video.tranhuyhoang.playlist"
http           = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url      = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers  = {
	"User-Agent"      : "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
	"Accept-Encoding" : "gzip, deflate, sdch, br"
}

def GetSheetIDFromSettings():
	sid = "1ddT9gqBdcD_sr_uLZZBsoSYYnm-DczVkwEFcMdxGUQ4"
	resp, content = http.request(plugin.get_setting("GSheetURL"),"HEAD")
	try:
		sid = re.compile("/d/(.+?)/").findall(resp["content-location"])[0]
	except: pass
	return sid
Exemple #27
0
import os

import pyxbmct.addonwindow as pyxbmct

from xbmcswift2 import xbmc, xbmcaddon, xbmcgui

from resources.lib.di.requiredfeature import RequiredFeature

_addon_path = xbmcaddon.Addon().getAddonInfo('path')

COLOR_FO = '0xFFE0B074'
COLOR_NF = '0xFF808080'
COLOR_HEADING = '0xFFD6D6D6'
COLOR_DETAILS = '0xFF707070'
COLOR_SELECTED = '0xFFF1F1F1'


class GameInfo(pyxbmct.AddonDialogWindow):
    plugin = RequiredFeature('plugin')
    core = RequiredFeature('core')

    def __init__(self, game, title=''):
        super(GameInfo, self).__init__(title)
        self.game = game
        background = None
        if self.core.get_active_skin() == 'skin.osmc':
            media_path = '/usr/share/kodi/addons/skin.osmc/media'
            if os.path.exists(media_path):
                background = os.path.join(media_path,
                                          'dialogs/DialogBackground_old.png')
Exemple #28
0
#coding: utf8
import tempfile
from xbmcswift2 import Plugin, xbmcgui, xbmc, xbmcaddon
from resources.lib.bilibili import Bili
from resources.lib.config import TEMP_DIR
from resources.lib.subtitle import subtitle_offset

__addon__ = xbmcaddon.Addon()
if (__addon__.getSetting('keyboard') == '0'):
    from xbmc import Keyboard
else:
    from ChineseKeyboard import Keyboard

plugin = Plugin()
bili = Bili()


def get_tmp_dir():
    if len(TEMP_DIR) != 0:
        return TEMP_DIR
    try:
        return tempfile.gettempdir()
    except:
        return TEMP_DIR


def _print_info(info):
    print '[BiliAddon]: ' + info


class BiliPlayer(xbmc.Player):
Exemple #29
0
#!/usr/bin/python
#coding=utf-8
from xbmcswift2 import Plugin, xbmc, xbmcgui, xbmcaddon
import requests, re, urllib, os, zipfile, json, uuid, shutil
if 64 - 64: i11iIiiIii
OO0o = Plugin()
Oo0Ooo = xbmcaddon.Addon("plugin.video.kodi4vn.launcher")
O0O0OO0O0O0 = "plugin://plugin.video.kodi4vn.launcher"
iiiii = "http://echipstore.com:8000"
if 64 - 64: iIIi1iI1II111 + ii11i / oOooOoO0Oo0O


def iI1(url):
    i1I11i = requests.get(url + "%st=%s" %
                          ("&" if "?" in url else "?",
                           urllib.quote_plus(OO0o.get_setting("token"))))
    i1I11i.encoding = "utf-8"
    OoOoOO00 = i1I11i.json()
    return OoOoOO00
    if 27 - 27: OOOo0 / Oo - Ooo00oOo00o.I1IiI


def o0OOO(url):
    OoOoOO00 = iI1(url)
    return OoOoOO00
    if 13 - 13: ooOo + Ooo0O


def IiiIII111iI(source, dest_dir):
    with zipfile.ZipFile(source) as IiII:
        for iI1Ii11111iIi in IiII.infolist():
Exemple #30
0
def IIi1IiiiI1Ii():
    I11i11Ii("None", "None")
    oO00oOo = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    if 49 - 49: oO00oOo = xbmc.translatePath(os.path.join(oO00oOo, "temp.jpg"))
    if 49 - 49:
        urllib.urlretrieve(
            'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/moviebox.jpg',
            oO00oOo)
    if 49 - 49: OOOo0 = xbmcgui.ControlImage(0, 0, 1280, 720, oO00oOo)
    if 49 - 49: Oooo000o = xbmcgui.WindowDialog()
    if 49 - 49: Oooo000o.addControl(OOOo0)
    if 49 - 49: Oooo000o.doModal()
    if 6 - 6: i1 * ii1IiI1i % OOooOOo / I11i / o0O / IiiIII111iI
    IiII = [{
        'label':
        'Phim mới',
        'path':
        '%s/latest/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilm'))
    }, {
        'label':
        'Phóng Sự & Tài Liệu',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '33'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/13333734-Phim-Tai-Lieu.jpg'
    }, {
        'label':
        'Ca Nhạc',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '34'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/99844308-Ca-nhac.jpg'
    }, {
        'label':
        'Hài Kịch',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '35'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/519820-Hai-Kich.jpg'
    }, {
        'label':
        'Phim Lẻ',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '36'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/6855131-MOD.jpg'
    }, {
        'label':
        'Phim Bộ',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '37'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/46252803-Phim-Bo.jpg'
    }, {
        'label':
        'Truyền Hình',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '38'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/14266234-Live-TV.jpg'
    }, {
        'label':
        'Nghe Truyện Đọc',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '40'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/3488938-Sach-Noi.jpg'
    }, {
        'label':
        'Dạy Nấu Ăn',
        'path':
        '%s/genres/%s/%s' %
        (ii, urllib.quote_plus('http://ictvnow.nl/vod/Api/GetListFilmByCate'),
         '41'),
        'thumbnail':
        'http://ictvnow.nl/vod/images/category/14376243-Am-Nhac.jpg'
    }]
    return oo000.finish(IiII)
    if 28 - 28: Ii11111i * iiI1i1