Esempio n. 1
0
def vod(url):
    if url == "vod":
        open = tools.OPEN_URL(vod_url)
    else:
        open = tools.OPEN_URL(url)
    all_cats = tools.regex_get_all(open, '<channel>', '</channel>')
    for a in all_cats:
        if '<playlist_url>' in open:
            name = tools.regex_from_to(a, '<title>', '</title>')
            url1 = tools.regex_from_to(a, '<playlist_url>',
                                       '</playlist_url>').replace(
                                           '<![CDATA[', '').replace(']]>', '')
            tools.addDir(
                str(base64.b64decode(name)).replace('?', ''), url1, 3, icon,
                fanart, '')
        else:
            if xbmcaddon.Addon().getSetting('meta') == 'true':
                try:
                    name = tools.regex_from_to(a, '<title>', '</title>')
                    name = base64.b64decode(name)
                    thumb = tools.regex_from_to(a, '<desc_image>',
                                                '</desc_image>').replace(
                                                    '<![CDATA[',
                                                    '').replace(']]>', '')
                    url = tools.regex_from_to(a, '<stream_url>',
                                              '</stream_url>').replace(
                                                  '<![CDATA[',
                                                  '').replace(']]>', '')
                    desc = tools.regex_from_to(a, '<description>',
                                               '</description>')
                    desc = base64.b64decode(desc)
                    plot = tools.regex_from_to(desc, 'PLOT:', '\n')
                    cast = tools.regex_from_to(desc, 'CAST:', '\n')
                    ratin = tools.regex_from_to(desc, 'RATING:', '\n')
                    year = tools.regex_from_to(desc, 'RELEASEDATE:',
                                               '\n').replace(' ', '-')
                    year = re.compile('-.*?-.*?-(.*?)-',
                                      re.DOTALL).findall(year)
                    runt = tools.regex_from_to(desc, 'DURATION_SECS:', '\n')
                    genre = tools.regex_from_to(desc, 'GENRE:', '\n')
                    tools.addDirMeta(
                        str(name).replace('[/COLOR].', '.[/COLOR]'), url, 4,
                        thumb, fanart, plot,
                        str(year).replace("['", "").replace("']", ""),
                        str(cast).split(), ratin, runt, genre)
                except:
                    pass
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
            else:
                name = tools.regex_from_to(a, '<title>', '</title>')
                name = base64.b64decode(name)
                thumb = tools.regex_from_to(a, '<desc_image>',
                                            '</desc_image>').replace(
                                                '<![CDATA[',
                                                '').replace(']]>', '')
                url = tools.regex_from_to(a, '<stream_url>',
                                          '</stream_url>').replace(
                                              '<![CDATA[',
                                              '').replace(']]>', '')
                desc = tools.regex_from_to(a, '<description>',
                                           '</description>')
                tools.addDir(name, url, 4, thumb, fanart,
                             base64.b64decode(desc))
Esempio n. 2
0
def tvarchive(name, description):
    name = str(
        name.replace('[COLOR cyan]ENT:[/COLOR]', 'ENT:').replace(
            '[COLOR cyan]DOC:[/COLOR]',
            'DOC:').replace('[COLOR cyan]MOV:[/COLOR]', 'MOV').replace(
                '[COLOR cyan]SSSS[/COLOR]',
                'SSS:').replace('[COLOR cyan]BTS:[/COLOR]', 'BTS:').replace(
                    '[COLOR cyan]INT:[/COLOR]',
                    'INT:').replace('[COLOR cyan]DE:[/COLOR]', 'DE:').replace(
                        '[COLOR cyan]FR:[/COLOR]', 'FR:').replace(
                            '[COLOR cyan]PL:[/COLOR]', 'PL:').replace(
                                '[COLOR cyan]AR:[/COLOR]', 'AR:').replace(
                                    '[COLOR cyan]LIVE:[/COLOR]',
                                    'LIVE:').replace(
                                        '[COLOR cyan]ES:[/COLOR]',
                                        'ES:').replace(
                                            '[COLOR cyan]IN:[/COLOR]',
                                            'IN:').replace(
                                                '[COLOR cyan]PK:[/COLOR]',
                                                'PK'))
    filename = open(Guide)
    tree = ElementTree.parse(filename)
    pony = "apples"
    import datetime as dt
    from datetime import time
    date3 = datetime.datetime.now() - datetime.timedelta(days=5)
    date = str(date3)
    now = str(datetime.datetime.now()).replace('-', '').replace(':',
                                                                '').replace(
                                                                    ' ', '')
    programmes = tree.findall("programme")
    for programme in programmes:
        if name in programme.attrib.get('channel'):
            showtime = programme.attrib.get('start')
            head, sep, tail = showtime.partition(' +')
            date = str(date).replace('-', '').replace(':', '').replace(' ', '')
            year, month, day = showtime.partition('2017')
            kanalinimi = programme.find('title').text + showtime
            day = day[:-6]
            if head > date:
                if head < now:
                    head2 = head
                    head2 = head2[:4] + '/' + head2[4:]
                    head = head[:4] + '-' + head[4:]
                    head2 = head2[:7] + '/' + head2[7:]
                    head = head[:7] + '-' + head[7:]
                    head2 = head2[:10] + ' - ' + head2[10:]
                    head = head[:10] + ':' + head[10:]
                    head2 = head2[:15] + ':' + head2[15:]
                    head = head[:13] + '-' + head[13:]
                    head2 = head2[:-2]
                    head = head[:-2]
                    poo1 = (
                        "%s:%s/streaming/timeshift.php?username=%s&password=%s&stream=%s&start="
                    ) % (userinfo.host, userinfo.port, username, password,
                         description)
                    pony = poo1 + str(head) + "&duration=240"
                    head2 = '[COLOR cyan]%s - [/COLOR]' % head2
                    kanalinimi = str(head2) + programme.find('title').text
                    desc = programme.find('desc').text
                    tools.addDir(kanalinimi, pony, 4, icon, fanart, desc)
                    xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
Esempio n. 3
0
def extras():
    tools.addDir('Run a Speed Test', 'ST', 10, icon, background, '')
    tools.addDir('Setup PVR Guide', 'tv', 10, icon, background, '')
    tools.addDir('Clear Cache', 'CC', 10, icon, background, '')
Esempio n. 4
0
def start():
    if username == "":
        usern = userpopup()
        passw = passpopup()
        control.setSetting('Username', usern)
        control.setSetting('Password', passw)
        xbmc.executebuiltin('Container.Refresh')
        auth = '%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories' % (
            user.host, user.port, usern, passw)
        auth = tools.OPEN_URL(auth)
        if auth == "":
            line1 = "Incorrect Login Details"
            line2 = "Please Re-enter"
            line3 = ""
            xbmcgui.Dialog().ok('Attention', line1, line2, line3)
            start()
        else:
            line1 = "Login Sucsessfull"
            line2 = "Welcome to " + user.name
            line3 = ('[B][COLOR white]%s[/COLOR][/B]' % usern)
            xbmcgui.Dialog().ok(user.name, line1, line2, line3)
            tvguidesetup()
            addonsettings('ADS2', '')
            xbmc.executebuiltin('Container.Refresh')
            home()
    else:
        auth = '%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories' % (
            user.host, user.port, username, password)
        auth = tools.OPEN_URL(auth)
        if not auth == "":

            tools.addDir('Live TV', 'live', 1, iconlive, background, '')
            tools.addDir('Catchup TV', 'url', 12, iconcatchup, background, '')
            tools.addDir('Movies', 'vod', 3, iconMoviesod, background, '')
            tools.addDir('TV Series', 'live', 18, iconTvseries, background, '')

            if xbmc.getCondVisibility('System.HasAddon(pvr.iptvsimple)'):
                tools.addDir('TV Guide', 'pvr', 7, icon, background, '')
            tools.addDir('Search', 'url', 5, iconsearch, background, '')
            tools.addDir('Settings', 'url', 8, iconsettings, background, '')
            tools.addDir('Extras', 'url', 16, iconextras, background, '')
            tools.addDir('Account Information', 'url', 6, iconaccount,
                         background, '')
Esempio n. 5
0
def home():

    tools.addDir('Account Information', 'url', 6, icon, background, '')
    tools.addDir('Live TV', 'live', 1, icon, background, '')
    tools.addDir('TV Series', 'live', 18, icon, background, '')

    if xbmc.getCondVisibility('System.HasAddon(pvr.iptvsimple)'):
        tools.addDir('TV Guide', 'pvr', 7, icon, background, '')
    tools.addDir('Catchup TV', 'url', 12, icon, background, '')
    tools.addDir('vod', 'vod', 3, icon, background, '')
    tools.addDir('Search', '', 5, icon, background, '')
    tools.addDir('Settings', 'url', 8, icon, background, '')
    tools.addDir('Extras', 'url', 16, icon, background, '')
Esempio n. 6
0
def accountinfo():
    open = tools.OPEN_URL(panel_api)
    username = tools.regex_from_to(open, '"username":"******"')
    password = tools.regex_from_to(open, '"password":"******"')
    status = tools.regex_from_to(open, '"status":"', '"')
    connects = tools.regex_from_to(open, '"max_connections":"', '"')
    active = tools.regex_from_to(open, '"active_cons":"', '"')
    expiry = tools.regex_from_to(open, '"exp_date":"', '"')
    if not expiry == "":
        expiry = datetime.datetime.fromtimestamp(
            int(expiry)).strftime('%d/%m/%Y - %H:%M')
        expreg = re.compile('^(.*?)/(.*?)/(.*?)$', re.DOTALL).findall(expiry)
        for day, month, year in expreg:
            month = tools.MonthNumToName(month)
            year = re.sub(' -.*?$', '', year)
            expiry = month + ' ' + day + ' - ' + year
    else:
        expiry = 'Unlimited'

    ip = tools.getlocalip()
    tools.addDir('[B][COLOR white]Username :[/COLOR][/B] ' + username, '', '',
                 icon, background, '')
    tools.addDir('[B][COLOR white]Password :[/COLOR][/B] ' + password, '', '',
                 icon, background, '')
    tools.addDir('[B][COLOR white]Expiry Date:[/COLOR][/B] ' + expiry, '', '',
                 icon, background, '')
    tools.addDir('[B][COLOR white]Account Status :[/COLOR][/B] %s' % status,
                 '', '', icon, background, '')
    tools.addDir('[B][COLOR white]Current Connections:[/COLOR][/B] ' + active,
                 '', '', icon, background, '')
    tools.addDir(
        '[B][COLOR white]Allowed Connections:[/COLOR][/B] ' + connects, '', '',
        icon, background, '')
    tools.addDir('[B][COLOR white]Local IP Address:[/COLOR][/B] ' + ip, '', '',
                 icon, background, '')
    tools.addDir('[B][COLOR white]Kodi Version:[/COLOR][/B] ' + str(KODIV), '',
                 '', icon, background, '')
Esempio n. 7
0
def accountinfo():
	open = tools.OPEN_URL(panel_api)
	try:
		username   = tools.regex_from_to(open,'"username":"******"')
		password   = tools.regex_from_to(open,'"password":"******"')
		status     = tools.regex_from_to(open,'"status":"','"')
		connects   = tools.regex_from_to(open,'"max_connections":"','"')
		active     = tools.regex_from_to(open,'"active_cons":"','"')
		expiry     = tools.regex_from_to(open,'"exp_date":"','"')
		expiry     = datetime.datetime.fromtimestamp(int(expiry)).strftime('%d/%m/%Y - %H:%M')
		expreg     = re.compile('^(.*?)/(.*?)/(.*?)$',re.DOTALL).findall(expiry)
		for day,month,year in expreg:
			month     = tools.MonthNumToName(month)
			year      = re.sub(' -.*?$','',year)
			expiry    = month+' '+day+' - '+year
			ip        = tools.getlocalip()
			extip     = tools.getexternalip()
			tools.addDir('[COLOR blue]Username :[/COLOR] '+username,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Password :[/COLOR] '+password,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Expiry Date:[/COLOR] '+expiry,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Account Status :[/COLOR] %s'%status,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Current Connections:[/COLOR] '+ active,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Allowed Connections:[/COLOR] '+connects,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Local IP Address:[/COLOR] '+ip,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]External IP Address:[/COLOR] '+extip,'','',icon,fanart,'')
	except:pass
Esempio n. 8
0
def extras():
    tools.addDir('Run a Speed Test', 'ST', 10, icon, fanart, '')
    tools.addDir('Clear Cache', 'CC', 10, icon, fanart, '')
Esempio n. 9
0
def accountinfo():
    open = tools.OPEN_URL(panel_api)
    try:
        username = tools.regex_from_to(open, '"username":"******"')
        password = tools.regex_from_to(open, '"password":"******"')
        status = tools.regex_from_to(open, '"status":"', '"')
        connects = tools.regex_from_to(open, '"max_connections":"', '"')
        active = tools.regex_from_to(open, '"active_cons":"', '"')
        expiry = tools.regex_from_to(open, '"exp_date":"', '"')
        expiry = datetime.datetime.fromtimestamp(
            int(expiry)).strftime('%d/%m/%Y - %H:%M')
        ip = tools.getlocalip()
        extip = tools.getexternalip()
        tools.addDir('[COLOR blue]Username :[/COLOR] ' + username, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR blue]Password :[/COLOR] ' + password, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR blue]Expiry Date:[/COLOR] ' + expiry, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR blue]Account Status :[/COLOR] %s' % status, '',
                     '', icon, fanart, '')
        tools.addDir('[COLOR blue]Current Connections:[/COLOR] ' + active, '',
                     '', icon, fanart, '')
        tools.addDir('[COLOR blue]Allowed Connections:[/COLOR] ' + connects,
                     '', '', icon, fanart, '')
        tools.addDir('[COLOR blue]Local IP Address:[/COLOR] ' + ip, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR blue]External IP Address:[/COLOR] ' + extip, '',
                     '', icon, fanart, '')
    except:
        pass
Esempio n. 10
0
def start():
	if username=="":
		user = userpopup()
		passw= passpopup()
		control.setSetting('Username',user)
		control.setSetting('Password',passw)
		xbmc.executebuiltin('Container.Refresh')
		auth = '%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories'%(host,port,user,passw)
		auth = tools.OPEN_URL(auth)
		if auth == "":
			line1 = "Incorrect Login Details"
			line2 = "Please Re-enter" 
			line3 = "" 
			xbmcgui.Dialog().ok('Attention', line1, line2, line3)
			start()
		else:
			line1 = "Login Successful"
			line2 = "Welcome to bosstechmediaV2" 
			line3 = ('[COLOR red]%s[/COLOR]'%user)
			xbmcgui.Dialog().ok('bosstech mediaV2', line1, line2, line3)
			tvguidesetup()
			addonsettings('ADS2','')
			xbmc.executebuiltin('Container.Refresh')
			home()
	else:
		auth = '%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories'%(host,port,username,password)
		auth = tools.OPEN_URL(auth)
		if not auth=="":
			tools.addDir('[COLOR red]Account Information[/COLOR]','url',6,icon,fanart,'')
			tools.addDir('[COLOR lightskyblue]Live Tv[/COLOR]','live',1,icon,fanart,'')
			tools.addDir('[COLOR red]Catchup TV[/COLOR]','url',12,icon,fanart,'')
			if xbmc.getCondVisibility('System.HasAddon(pvr.iptvsimple)') or xbmc.getCondVisibility('System.HasAddon(script.ivueguide)'):
				tools.addDir('[COLOR lightskyblue]TV Guide[/COLOR]','pvr',7,icon,fanart,'')
			tools.addDir('[COLOR red]VOD[/COLOR]','vod',3,icon,fanart,'')
			tools.addDir('[COLOR lightskyblue]Search[/COLOR]','url',5,icon,fanart,'')
			tools.addDir('[COLOR red]Settings[/COLOR]','url',8,icon,fanart,'')
			tools.addDir('[COLOR lightskyblue]Extras[/COLOR]','url',16,icon,fanart,'')
Esempio n. 11
0
def search():
    if mode == 3:
        return False
    text = searchdialog()
    if not text:
        xbmc.executebuiltin(
            "XBMC.Notification([COLOR red][B]Search is Empty[/B][/COLOR],Aborting search,4000,"
            + icon + ")")
        return
    xbmc.log(str(text))
    open = tools.OPEN_URL(panel_api)
    all_chans = tools.regex_get_all(open, '{"num":', 'epg')
    for a in all_chans:
        name = tools.regex_from_to(a, 'name":"', '"').replace('\/', '/')
        url = tools.regex_from_to(a, '"stream_id":"', '"')
        thumb = tools.regex_from_to(a, 'stream_icon":"',
                                    '"').replace('\/', '/')
        if text in name.lower():
            tools.addDir(
                name.replace('UK:', '[COLOR blue]UK:[/COLOR]').replace(
                    'USA/CA:', '[COLOR blue]USA/CA:[/COLOR]').replace(
                        'All', '[COLOR blue]A[/COLOR]ll').replace(
                            'International',
                            '[COLOR blue]Int[/COLOR]ertaional').replace(
                                'Live:', '[COLOR blue]Live:[/COLOR]').replace(
                                    'TEST',
                                    '[COLOR blue]TEST[/COLOR]').replace(
                                        'Install',
                                        '[COLOR blue]Install[/COLOR]').replace(
                                            '24/7',
                                            '[COLOR blue]24/7[/COLOR]').
                replace('INT:', '[COLOR blue]INT:[/COLOR]').replace(
                    'DE:', '[COLOR blue]DE:[/COLOR]').replace(
                        'FR:', '[COLOR blue]FR:[/COLOR]').replace(
                            'PL:', '[COLOR blue]PL:[/COLOR]').replace(
                                'AR:', '[COLOR blue]AR:[/COLOR]').replace(
                                    'LIVE:',
                                    '[COLOR blue]LIVE:[/COLOR]').replace(
                                        'ES:',
                                        '[COLOR blue]ES:[/COLOR]').replace(
                                            'IN:',
                                            '[COLOR blue]IN:[/COLOR]').replace(
                                                'PK:',
                                                '[COLOR blue]PK:[/COLOR]'),
                play_url + url + '.ts', 4, thumb, fanart, '')
        elif text not in name.lower() and text in name:
            tools.addDir(
                name.replace('UK:', '[COLOR blue]UK:[/COLOR]').replace(
                    'USA/CA:', '[COLOR blue]USA/CA:[/COLOR]').replace(
                        'All', '[COLOR blue]A[/COLOR]ll').replace(
                            'International',
                            '[COLOR blue]Int[/COLOR]ertaional').replace(
                                'Live:', '[COLOR blue]Live:[/COLOR]').replace(
                                    'TEST',
                                    '[COLOR blue]TEST[/COLOR]').replace(
                                        'Install',
                                        '[COLOR blue]Install[/COLOR]').replace(
                                            '24/7',
                                            '[COLOR blue]24/7[/COLOR]').
                replace('INT:', '[COLOR blue]INT:[/COLOR]').replace(
                    'DE:', '[COLOR blue]DE:[/COLOR]').replace(
                        'FR:', '[COLOR blue]FR:[/COLOR]').replace(
                            'PL:', '[COLOR blue]PL:[/COLOR]').replace(
                                'AR:', '[COLOR blue]AR:[/COLOR]').replace(
                                    'LIVE:',
                                    '[COLOR blue]LIVE:[/COLOR]').replace(
                                        'ES:',
                                        '[COLOR blue]ES:[/COLOR]').replace(
                                            'IN:',
                                            '[COLOR blue]IN:[/COLOR]').replace(
                                                'PK:',
                                                '[COLOR blue]PK:[/COLOR]'),
                play_url + url + '.ts', 4, thumb, fanart, '')
Esempio n. 12
0
def home():
	tools.addDir('Account Information','url',6,icon,fanart,'')
	tools.addDir('On Demand','vod',1,icon,fanart,'')
	tools.addDir('Search','',5,icon,fanart,'')
	tools.addDir('Settings','url',8,icon,fanart,'')
Esempio n. 13
0
def home():
    tools.addDir('Account Information', 'url', 6, icon, fanart, '')
    tools.addDir('Live TV', 'live', 1, icon, fanart, '')
    tools.addDir('Catchup TV', 'url', 12, icon, fanart, '')
    tools.addDir('VOD', 'vod', 3, icon, fanart, '')
    tools.addDir('Search', '', 5, icon, fanart, '')
    tools.addDir('Settings', 'url', 8, icon, fanart, '')
    tools.addDir('Extras', 'url', 16, icon, fanart, '')
Esempio n. 14
0
def settingsmenu():
    tools.addDir('Edit Advanced Settings', 'ADS', 10, icon, fanart, '')
    tools.addDir('Log Out', 'LO', 10, icon, fanart, '')
Esempio n. 15
0
def extras():
	tools.addDir('Create a Short M3U & EPG URL','url',17,icon,fanart,'')
	tools.addDir('Integrate With TV Guide','tv',10,icon,fanart,'')
	tools.addDir('Run a Speed Test','ST',10,icon,fanart,'')
	tools.addDir('Clear Cache','CC',10,icon,fanart,'')
Esempio n. 16
0
def extras():

    tools.addDir('Integrate With TV Guide', 'tv', 10, icon, fanart, '')
    tools.addDir('Run a Speed Test', 'ST', 10, icon, fanart, '')
    tools.addDir('Clear Cache', 'CC', 10, icon, fanart, '')
Esempio n. 17
0
def start():
    if username == "":
        usern = userpopup()
        passw = passpopup()
        control.setSetting('Username', usern)
        control.setSetting('Password', passw)
        xbmc.executebuiltin('Container.Refresh')
        auth = '%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories' % (
            user.host, user.port, usern, passw)
        auth = tools.OPEN_URL(auth)
        if auth == "":
            line1 = "[COLOR red][B]Incorrect Login Details[/COLOR]"
            line2 = "Please Re-enter"
            line3 = "Username & Password are CaSeSenSiTiVe"
            xbmcgui.Dialog().ok('Attention', line1, line2, line3)
            start()
        else:
            line1 = "Login Successful"
            line2 = "Welcome to " + user.name
            line3 = ('[COLOR greeen]%s[/COLOR]' % usern)
            xbmcgui.Dialog().ok(user.name, line1, line2, line3)
            addonsettings('ADS2', '')
            xbmc.executebuiltin('Container.Refresh')
            home()
    else:
        auth = '%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories' % (
            user.host, user.port, username, password)
        auth = tools.OPEN_URL(auth)
        if not auth == "":
            tools.addDir('Account Information', 'url', 6, icon, fanart, '')
            tools.addDir('Live TV', 'live', 1, icon, fanart, '')
            tools.addDir('Catchup TV', 'url', 12, icon, fanart, '')
            tools.addDir('Movies & Sports', 'vod', 3, icon, fanart, '')
            tools.addDir('TV Series', 'series', 3, icon, fanart, '')
            tools.addDir('Search', 'url', 5, icon, fanart, '')
            tools.addDir('Settings', 'url', 8, icon, fanart, '')
            tools.addDir('Extras', 'url', 16, icon, fanart, '')