class Addon:
  def __init__(self):
    self.plugin = Plugin()
    self.plugin.register_module(menu.Module(), '')
    self.plugin.register_module(showlist.Module(), '')
    self.plugin.register_module(playlist.Module(), '')
    self.plugin.register_module(videolist.Module(), '')
    self.plugin.register_module(play.Module(), '')

    self.utils = Utils(self.plugin)
    self.utils.log_init()

  def run(self):
    try:
      self.plugin.run()
    except KeyboardInterrupt:
      pass
    except SystemExit:
      pass
    except:
      self.utils.handle_error()
Пример #2
0
    } for item in get_categories()]

    return items


@plugin.route('/categories/<url>/')
def show_category(url):
    '''Lists playable videos for a given category url.'''
    items = [{
        'path': item.get('video_url') or video_url(item['video_host'],
                                                   item['video_id']),
        'label': item['title'],
        'thumbnail': item.get('thumbnail'),
        'is_playable': True,
        'info': {
            'plot': item['content'],
            'plotoutline': item['excerpt'],
            'aired': item['date'].split()[0],
        },
    } for item in get_category_posts(url)]

    # Filter out items that we can't play, currently just ooyala videos
    items = [item for item in items if item['path'] is not None]

    return plugin.finish(items,sort_methods=[SortMethod.LABEL,
                                             SortMethod.DATE])


if __name__ == '__main__':
    plugin.run()
Пример #3
0

def calculatePaginationValues(index):
    index = int(index)
    limit = ITEMS_PER_PAGE
    offset = index * limit
    return  index, offset, limit


def getUserName():
    username = PLUGIN.get_setting('username', unicode).lower()
    if not username:
        PLUGIN.open_settings()
        username = PLUGIN.get_setting('username', unicode).lower()
    return username


def getVideoQuality():
    chosenQuality = PLUGIN.get_setting('video', unicode)
    qualities = {'0': 0, '1': 1, '2': 2, '3': 3, '4' : 4}
    return qualities.get(chosenQuality, sys.maxint)


def linkToNextPage(target, currentIndex, **kwargs):
    return {'label': PLUGIN.get_string(30011),
            'path': PLUGIN.url_for(target, index=str(currentIndex + 1), **kwargs)
            }

if __name__ == '__main__':
    PLUGIN.run()
Пример #4
0
                Oo0ooO0oo0oO % Oo0Ooo.ii11 / Oo0oO0ooo
            if 84 - 84:
                ii11.o00 / o0OO0 - I1iII1iiII / iII111iiiii11 / o00ooo0
            if 12 - 12:
                I1iII1iiII * ii11 % I1IiiI % iiiIIii1IIi
            if 20 - 20:
                ooO00oOoo % Oo0o00o0Oo0 / Oo0o00o0Oo0 + Oo0o00o0Oo0
            if 45 - 45:
                Oo0oO0ooo - iiIIIIi1i1 - iII111iiiii11 - Oo0ooO0oo0oO.O00ooOO / OO0OO0O0O0
            if 51 - 51:
                OO0OO0O0O0 + ii11
            if 8 - 8:
                Oo0oO0ooo * I1i1iI1i - Oo0o00o0Oo0 - Oo0ooO0oo0oO * ooO00oOoo % I1iII1iiII
            if 48 - 48:
                OO0OO0O0O0
            try:
                print "============================ POSTING TRACK EVENT ============================"
                i1iIi1iIi1i(iI11i1ii11)
            except:
                print "============================  CANNOT POST TRACK EVENT ============================"
                if 11 - 11:
                    O0OOo + iII111iiiii11 - Oo0ooO0oo0oO / o00ooo0 + o0OO0.O00ooOO
    except:
        print "================  CANNOT POST TO ANALYTICS  ================"
        if 41 - 41:
            Oo0o00o0Oo0 - OO0OO0O0O0 - OO0OO0O0O0


if __name__ == "__main__":
    oo000.run()  # dd678faae9ac167bc83abf78e5cb2f3f0688d3a3
Пример #5
0
                }
            channel.append(data)

    xbmc.executebuiltin('Container.SetViewMode(%d)' % 500)		
    return xbmcplugin . finish ( channel )

def resolveUrl(id = None):
    getUrl = 'http://fptplay.net/show/getlinklivetv?id=%s&type=newchannel&quality=1&mobile=web'
    result = urlfetch.post(
        getUrl,
        data={"id": id,
            "quality": __mysettings__.getSetting('quality'),
            "mobile": "web"
            },
        headers=reg
        )
    jsonObject = json.loads(result.content)
    return jsonObject['stream']

@xbmcplugin.route('/plays/<id>')
def plays(id):
    dialogWait = xbmcgui.DialogProgress()
    dialogWait.create('ITV Plus', 'Đang tải. Vui lòng chờ trong giây lát...')
    xbmcplugin.set_resolved_url(resolveUrl(id))
    dialogWait.close()
    del dialogWait
    
if __name__ == '__main__':
    xbmcplugin.run()
    
Пример #6
0
                              (camera_id, ))
        cam = Camera(cursor.fetchone())
        stream = cam.get_stream()
    else:
        pc = PrivateCameras(plugin)
        cam = pc.get_camera(camera_id)
        stream = cam.stream
    return stream


def update(name, location, crash=None):
    p = {}
    p['an'] = plugin.name
    p['av'] = plugin.addon.getAddonInfo('version')
    p['ec'] = 'Addon actions'
    p['ea'] = name
    p['ev'] = '1'
    p['ul'] = xbmc.getLanguage()
    p['cd'] = location
    ga('UA-79422131-6').update(p, crash)


url = 'https://github.com/harrygg/plugin.video.bgcameras/raw/master/resources/assets.db'
local_db = xbmc.translatePath(os.path.join('resources', 'assets.db'))
a = Assets(plugin.storage_path, url, local_db, xbmc.log)
db = a.file

#Run addon
if __name__ == '__main__':
    plugin.run()
Пример #7
0
                channel.append(data)

    xbmc.executebuiltin('Container.SetViewMode(%d)' % 500)
    return xbmcplugin.finish(channel)


def resolveUrl(id=None):
    getUrl = 'http://fptplay.net/show/getlinklivetv?id=%s&type=newchannel&quality=1&mobile=web'
    result = urlfetch.post(getUrl,
                           data={
                               "id": id,
                               "quality": __mysettings__.getSetting('quality'),
                               "mobile": "web"
                           },
                           headers=reg)
    jsonObject = json.loads(result.content)
    return jsonObject['stream']


@xbmcplugin.route('/plays/<id>')
def plays(id):
    dialogWait = xbmcgui.DialogProgress()
    dialogWait.create('ITV Plus', 'Đang tải. Vui lòng chờ trong giây lát...')
    xbmcplugin.set_resolved_url(resolveUrl(id))
    dialogWait.close()
    del dialogWait


if __name__ == '__main__':
    xbmcplugin.run()
Пример #8
0
def calculatePaginationValues(index):
    index = int(index)
    limit = ITEMS_PER_PAGE
    offset = index * limit
    return index, offset, limit


def getUserName():
    username = PLUGIN.get_setting('username').lower()
    if not username:
        PLUGIN.open_settings()
        username = PLUGIN.get_setting('username').lower()
    return username


def getVideoQuality():
    chosenQuality = PLUGIN.get_setting('video')
    qualities = {'0': sys.maxint, '1': 720, '2': 480, '3': 360}
    return qualities.get(chosenQuality, sys.maxint)


def linkToNextPage(target, currentIndex, **kwargs):
    return {
        'label': PLUGIN.get_string(31001),
        'path': PLUGIN.url_for(target, index=str(currentIndex + 1), **kwargs)
    }


if __name__ == '__main__':
    PLUGIN.run()
Пример #9
0
def OoOoOO00(title="Home", page="/"):
    try:
        ooO0oooOoO0 = "http://www.google-analytics.com/collect"
        II11i = open(i1).read()
        O0oO = {
            'v': '1',
            'tid': 'UA-52209804-5',
            'cid': II11i,
            't': 'pageview',
            'dp': "HPlus" + page,
            'dt': "[HPlus] - %s" % title
        }
        requests.post(ooO0oooOoO0, data=urllib.urlencode(O0oO))
    except:
        pass
    if 64 - 64: oo % O0Oooo00


Ooo0 = xbmc.translatePath('special://userdata')
if os.path.exists(Ooo0) == False:
    os.mkdir(Ooo0)
i1 = os.path.join(Ooo0, 'cid')
if 89 - 89: I111i1i1111i - Ii1Ii1iiii11 % I1I1i1
if os.path.exists(i1) == False:
    with open(i1, "w") as IiI1i:
        IiI1i.write(str(uuid.uuid1()))
        if 61 - 61: oo0O000OoO + IiiIIiiI11 / oooOOOOO * oOooOoO0Oo0O
if __name__ == '__main__':
    oo000.run()
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3