Exemplo n.º 1
0
            vidname = 'Full'
        media = urlresolver.HostedMediaFile(host=host,
                                            media_id=linkid,
                                            title=vidname + ' - ' + host +
                                            ' - ' + load + ' - ' + working)
        sources.append(media)

    source = urlresolver.choose_source(sources)
    if source:
        stream_url = source.resolve()
    else:
        stream_url = False

    #Play the stream
    if stream_url:
        addon.resolve_url(stream_url)

if mode == 'main':
    addon.add_directory({
        'mode': 'movies',
        'section': 'movies'
    }, {'title': 'Movies'},
                        img=icon_path('Movies.png'))
    addon.add_directory({
        'mode': 'tv',
        'section': 'tv'
    }, {'title': 'TV Shows'},
                        img=icon_path('TV_Shows.png'))
    addon.add_directory({
        'mode': 'search',
        'section': SearchAll
Exemplo n.º 2
0
        #html = re.sub('(?s)<!--.*?-->', '', html).strip()

        if re.search('http://tgun.tv/embed/', embedcode):
            link = re.search('src="(.+?)"', embedcode).group(1)
            embedcode = get_url(link)
            embedcode = re.sub('(?s)<!--.*?-->', '', embedcode).strip()

        stream_url = determine_stream(embedcode, url)
        
        if not stream_url:
            raise Exception('Channel is using an unknown stream type')
            stream_url = None

        #Play the stream
        if stream_url and stream_url <> "Offline":
            addon.resolve_url(stream_url)            
            
    except Exception, e:
        traceback.print_exc()
        Notify('small','TGUN', str(e),'')    

        
def tvchannels(turl = url, tpage = page_num):
    #turl = turl % tpage
    html = get_url(turl)

    #Remove any commented out sources to we don't try to use them
    html = re.sub('(?s)<!--.*?-->', '', html).strip()
    
    match = re.compile('<a Title="(.+?)" href="#" onClick="Chat=window.open\(\'(.+?)\',\'vid_z\',\'\'\); return false;"><img src="(.+?)" border="1" width=[0-9]+ height=[0-9]+ /></a>').findall(html)
    if not match:
Exemplo n.º 3
0
    for i in range(len(links)):
		url=links[i]
		try:
			sources.append(url)
		except:pass    
    for link in links: randomitem.append([link])
    index = random.randrange(1, len(links))
    playrandom = randomitem[index][0]
    if listmode=='true':
       dialog = xbmcgui.Dialog()
       index = dialog.select('Choose a source:', sources)
       if index>-1:
            url=sources[index]
            import urlresolver
            resolved=urlresolver.HostedMediaFile(url).resolve()
            addon.resolve_url(resolved)
    elif autoplay=='true':
        for i in range(len(links)):
         count+=1
         progress = float(count) / float(len(links)) * 100  
         try:
            index = random.randrange(1, len(links))
            playrandom = randomitem[index][0]
            dp.update(int(progress), 'TRYING (random on): ', playrandom)
            resolved=urlresolver.HostedMediaFile(playrandom).resolve()
            if resolved:
				addon.resolve_url(resolved)
				break
            else:
                Notify('small', 'Link down: ', playrandom,'')
         except: pass  	
Exemplo n.º 4
0
        title="NRA General Operations",
        url="plugin://plugin.video.youtube/user/GOnraMedia/",
        thumbnail="https://yt3.ggpht.com/-c0JMaaNvfWE/AAAAAAAAAAI/AAAAAAAAAAA/PAP-cswAjPw/s288-c-k-no-mo-rj-c0xffffff/photo.jpg",
        fanart=fanart,
        folder=True )


# Create media items list
def media_item_list(name,url,plot,img,fanart):
    addon.add_video_item({'url': url}, {'title': name, 'plot': plot}, img = icon, fanart = fanart, playlist=False)

# Query play, mode, url and name
play = addon.queries.get('play', None)
mode = addon.queries['mode']
url = addon.queries.get('url', '')
name = addon.queries.get('name', '')

# Program flow control
if play:
    addon.resolve_url(url.encode('UTF-8')) # <<< Play resolved media url

if mode=='main':
    print ""
    CATEGORIES()

elif mode=='youtube1':
    print ""+url
    IDX_YOUTUBE1()

if not play:
    addon.end_of_directory()
Exemplo n.º 5
0
# Create media items list
def media_item_list(name, url, plot, img, fanart):
    addon.add_video_item({'url': url}, {
        'title': name,
        'plot': plot
    },
                         img=icon,
                         fanart=fanart,
                         playlist=False)


# Query play, mode, url and name
play = addon.queries.get('play', None)
mode = addon.queries['mode']
url = addon.queries.get('url', '')
name = addon.queries.get('name', '')

# Program flow control
if play:
    addon.resolve_url(url.encode('UTF-8'))  # <<< Play resolved media url

if mode == 'main':
    print ""
    CATEGORIES()

elif mode == 'youtube1':
    print "" + url
    IDX_YOUTUBE1()

if not play:
    addon.end_of_directory()