Exemplo n.º 1
0
def getPseudoChannels(dialog=True):
    
    headers = {}
    headers['User-Agent']= 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.20 (KHTML, like Gecko) Chrome/11.0.672.2 Safari/534.20'

    request = urllib2.Request(plugintools.get_giti_hubi(2))
    resp = urllib2.urlopen(request)
    result = resp.read()
    json_obj = json.loads(result,encoding='utf-8')
    
    channelList = json_obj.get('channels')
    
    prevChannel = ''
    prevChannelThumbnail = ''
    paths = []
    for channel in channelList:
        if prevChannel == '':
            prevChannelDict = channelList[len(channelList)-1]
            prevChannel = str(prevChannelDict.get('channelID'))
            prevChannelThumbnail = str(prevChannelDict.get('thumbpic'))
        title=channel.get('title').encode('utf-8')
        channelNumber = channel.get('channelNumber')
        paths.append({'path':plugintools.get_path(title=title,thumbnail=channel.get('thumbpic'),channelID=str(channel.get('channelID')),action=channel.get('movType'),prevChannel=prevChannel,prevThumbnail=prevChannelThumbnail),'title':title,'channelNumber':channelNumber,'channelID':channel.get('channelID'),'image':channel.get('thumbpic').encode('utf-8')})
        prevChannel = str(channel.get('channelID'))
        prevChannelThumbnail = repr(channel.get('thumbpic'))
    
    ScriptSettings2Create(paths,dialog)
    time_file = open( os.path.join( plugintools.get_runtime_path() , "last_update.txt" ) , "w" )
    todayTime = datetime.today()
    cooltime = str(todayTime.day)
    time_file.write(cooltime)   
    time_file.close()
Exemplo n.º 2
0
def getAllChannels():
    plugintools.add_item(action='pseudo',title='[COLOR blue] Add to pseudoTV [/COLOR]')
    headers = {}
    headers['User-Agent']= 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.20 (KHTML, like Gecko) Chrome/11.0.672.2 Safari/534.20'

    request = urllib2.Request(plugintools.get_giti_hubi(2))
    resp = urllib2.urlopen(request)
    result = resp.read()
    json_obj = json.loads(result,encoding='utf-8')
    
    channelList = json_obj.get('channels')
    
    prevChannel = ''
    prevChannelThumbnail = ''

    for channel in channelList:
        if prevChannel == '':
            prevChannelDict = channelList[len(channelList)-1]
            prevChannel = str(prevChannelDict.get('channelID'))
            prevChannelThumbnail = str(prevChannelDict.get('thumbpic'))
        title=channel.get('title').encode('utf-8')
        plugintools.add_item(title=title,thumbnail=channel.get('thumbpic'),channelID=str(channel.get('channelID')),action=channel.get('movType'),prevChannel=prevChannel,prevThumbnail=prevChannelThumbnail)
        prevChannel = str(channel.get('channelID'))
        prevChannelThumbnail = repr(channel.get('thumbpic'))
    
    plugintools.close_item_list()
Exemplo n.º 3
0
            prevChannel = str(prevChannelDict.get('channelID'))
            prevChannelThumbnail = str(prevChannelDict.get('thumbpic'))
        title=channel.get('title').encode('utf-8')
        channelNumber = channel.get('channelNumber')
        paths.append({'path':plugintools.get_path(title=title,thumbnail=channel.get('thumbpic'),channelID=str(channel.get('channelID')),action=channel.get('movType'),prevChannel=prevChannel,prevThumbnail=prevChannelThumbnail),'title':title,'channelNumber':channelNumber,'channelID':channel.get('channelID'),'image':channel.get('thumbpic').encode('utf-8')})
        prevChannel = str(channel.get('channelID'))
        prevChannelThumbnail = repr(channel.get('thumbpic'))
    
    ScriptSettings2Create(paths,dialog)
    time_file = open( os.path.join( plugintools.get_runtime_path() , "last_update.txt" ) , "w" )
    todayTime = datetime.today()
    cooltime = str(todayTime.day)
    time_file.write(cooltime)   
    time_file.close()
    
david = plugintools.get_giti_hubi(1)       
def notify(header=None, msg='', duration=2000):
    ADDON = xbmcaddon.Addon(id='plugin.video.tv2go')
    ICON_PATH = os.path.join( plugintools.get_runtime_path(), 'icon.png' )
    if header is None: header = ADDON.get_name()
    builtin = "XBMC.Notification(%s,%s, %s, %s)" % (header, msg, duration, ICON_PATH)
    xbmc.executebuiltin(builtin)
    
def get_pseudo_path():
    dev = {}
    __settings__ = xbmcaddon.Addon(id='script.pseudotv.live')
    dev['main'] = xbmc.translatePath( __settings__.getAddonInfo('Profile') )
    dev['xmltv'] = __settings__.getSetting( 'xmltvLOC' )
    # Parche para XBMC4XBOX
    if not os.path.exists(dev['main']):
        os.makedirs(dev['main'],0777)