Пример #1
0
def pbs_episodes(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    a = json.loads(link)
    a = a['collections']['episodes']['content']
    if len(a) > 0:
        for b in a:
            url = b.get('mp4')
            if not url is None:
                name = b.get('title', 'no title')
                iconimage = b.get('images', {
                    'x': None
                }).get('mezzanine', addon_logo)

                description = b.get('description')
                Addon.addLink(str(name), str(description), str(url), 25,
                              str(iconimage))
    else:
        dlg.ok(addonname, "No episodes found.")
        exit()
Пример #2
0
def abc_seasons(url, iconimage):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(link, '<option(.*?)option>')

    if matches == []:
        abc_episodes(url)
    else:
        seasonlist = []

        for entry in matches:
            name = Addon.find_single_match(entry, '>(.+?)</').replace(
                "&amp;", "&").replace("&#39;", "'").strip()
            description = ""
            path = Addon.find_single_match(entry, 'value="(.+?)"').replace(
                "/index", "")
            url = "http://abc.go.com" + path
            if len(path) > 0:
                seasonlist.append(path)
            if len(seasonlist) > 0:
                Addon.addDir(name, description, url, 20, iconimage)
            else:
                dlg.ok(addonname, "No episodes found.")
                exit()
Пример #3
0
def nbc_episodes(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    id = re.compile(',"listKey"\:\"(.+?)"', re.DOTALL).search(link)
    if id is not None:
        id = id.group(1)
        id = id.rsplit('-', 1)[0]

        req = urllib2.Request(
            'https://api.nbc.com/v3.14/videos?fields%5Bvideos%5D=title%2Cdescription%2Ctype%2Cgenre%2CvChipRating%2CvChipSubRatings%2Cguid%2Cpublished%2CrunTime%2Cairdate%2Cavailable%2CseasonNumber%2CepisodeNumber%2Cexpiration%2Centitlement%2CtveAuthWindow%2CnbcAuthWindow%2CexternalAdId%2CuplynkStatus%2CdayPart%2CinternalId%2Ckeywords%2Cpermalink%2CembedUrl%2Ccredits%2CselectedCountries%2Ccopyright&fields%5Bshows%5D=active%2Ccategory%2Ccolors%2CcreditTypeLabel%2Cdescription%2Cfrontends%2Cgenre%2CinternalId%2CisCoppaCompliant%2Cname%2Cnavigation%2Creference%2CschemaType%2CshortDescription%2CshortTitle%2CshowTag%2Csocial%2CsortTitle%2CtuneIn%2Ctype%2CurlAlias&fields%5Bimages%5D=derivatives%2Cpath%2Cwidth%2Cattributes%2CaltText%2Clink&fields%5BaggregatesShowProperties%5D=videoEpisodeSeasons%2CvideoTypes&include=image%2Cshow.image%2Cshow.aggregates&filter%5Bpublished%5D=1&filter%5BsalesItem%5D=0&filter%5Bshow%5D='
            + id +
            '&filter%5Btype%5D%5Bvalue%5D=Full%20Episode&filter%5Btype%5D%5Boperator%5D=%3D&sort=airdate&page%5Bnumber%5D=1&page%5Bsize%5D=50'
        )
        req.add_header(
            'User-Agent',
            'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
        )
        response = urllib2.urlopen(req)
        html = response.read()
        response.close()

        a = json.loads(html)
        episodelist = []

        for b in sorted(a['data']):
            entitlement = b['attributes'].get('entitlement')
            url = b['attributes'].get('embedUrl')
            url = url.split('guid/', 1)[1]
            url = url.split('?', 1)[0]
            url = 'http://link.theplatform.com/s/NnzsPC/media/guid/%s?format=preview' % url
            html = Addon.getRequest(url)
            if html == '':
                continue
            c = json.loads(html)
            name = c['title']
            description = c.get('description')
            iconimage = c.get('defaultThumbnailUrl')
            url = 'http://link.theplatform.com/s/NnzsPC/media/' + c[
                'mediaPid'] + '?policy=43674&player=NBC.com%20Instance%20of%3A%20rational-player-production&formats=m3u,mpeg4&format=SMIL&embedded=true&tracking=true'

            if b['attributes'].get(
                    'type') == "Full Episode" and entitlement == "free":
                episodelist.append(name)
            if len(episodelist) > 0:
                Addon.addLink(str(name), description, url, 23, iconimage)
            else:
                dlg.ok(addonname, "No episodes found.")
                exit()
    else:
        dlg.ok(addonname, "No episodes found.")
        exit()
Пример #4
0
def nbc_stream(url):
    if not '&format=redirect' in url:
        html = Addon.getRequest(url)
        if 'video src="' in html:
            url = Addon.find_single_match(html, 'video src="(.+?)"')
        else:
            url = Addon.find_single_match(html, 'ref src="(.+?)"')
        if 'nbcvodenc' in url:
            html = Addon.getRequest(url)
            url = Addon.find_single_match(html, 'http(.+?)\n')
            url = 'http' + url.strip()
        elif not (url.endswith(".mp4") or url.endswith(".flv")):
            headers = Addon.defaultHeaders.copy()
            headers[
                'User-Agent'] = 'Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600X800; rotate)'
            html = Addon.getRequest(url, headers=headers)
            urls = Addon.find_multiple_matches(html,
                                               'BANDWIDTH=(.+?),.+?\n(.+?)\n')
            blast = 0
            for b, u in urls:
                b = int(b)
                if blast < b:
                    url = u
                    blast = b
            url += '|User-Agent=' + urllib.quote(headers['User-Agent'])
        if "Unavailable.mp4" in url:
            dlg.ok(addonname, "Stream unavailable.")
            exit()
        else:
            Addon.play(url)
Пример #5
0
def food_stream(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()

    url = Addon.find_single_match(link, '<video src="(.*?)"')

    Addon.play(url)
Пример #6
0
def freeform_movies(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(
        link, '<div class="movies-grid col-xs-6 col-md-4 col-lg-3">(.*?)</a>')

    for entry in matches:
        name = Addon.find_single_match(entry,
                                       '<h3 class="m-b-0">(.+?)</h3>').replace(
                                           "&amp;", "&").replace("&#39;",
                                                                 "'").strip()
        description = Addon.find_single_match(entry, '<p>(.+?)</p>').replace(
            "<p>", "").replace("<\/p>",
                               "").strip().replace("&#39;",
                                                   "'").replace("&quot;", '"')
        url = "http://freeform.go.com" + Addon.find_single_match(
            entry, '<a href="(.+?)"')
        iconimage = Addon.find_single_match(entry, '<img src="(.+?)"')
        lock = Addon.find_single_match(
            entry,
            'data-sign-in-padlock data-requires-sign-in="(.+?)"').strip()
        if "http" in url and lock == "False":
            Addon.addLink(name, description, url, 17, iconimage)
Пример #7
0
def freeform_episodes(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(link, '<hr />(.*?)<p class="m-t-1">')

    episodelist = []
    for entry in matches:
        name = Addon.find_single_match(
            entry, '<h1 class="text-hover">(.+?)</h1>').replace(
                "&amp;", "&").replace("&#39;", "'").strip()
        description = Addon.find_single_match(
            entry, '"ResultDescription":(.+?)"').replace("<p>", "").replace(
                "<\/p>", "").strip().replace("&#39;",
                                             "'").replace("&quot;", '"')
        url = "http://freeform.go.com" + Addon.find_single_match(
            entry, '<a href="(.+?)"')
        iconimage = Addon.find_single_match(entry, '<img src="(.+?)"')
        lock = Addon.find_single_match(
            entry,
            'data-sign-in-padlock data-requires-sign-in="(.+?)"').strip()
        if "http" in url and lock == "False":
            episodelist.append(name)
        if len(episodelist) > 0:
            Addon.addLink(name, description, url, 17, iconimage)
        else:
            dlg.ok(addonname, "No episodes found.")
            exit()
Пример #8
0
def autoPlay():
    pl = Addon.get_playlist(xbmc.PLAYLIST_VIDEO)
    xbmc.Player().play(pl)
    #try and give it time to buffer enough of stream
    xbmc.sleep(5000)
    if xbmc.getCondVisibility('player.paused') == 1:
        xbmc.Player().pause()
Пример #9
0
def abc_stream(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    vd = Addon.find_single_match(link, "VDKA(.+?)\"")
    url = 'https://api.entitlement.watchabc.go.com/vp2/ws-secure/entitlement/2020/authorize.json'
    udata = 'video%5Fid=VDKA' + str(
        vd) + '&device=001&video%5Ftype=lf&brand=001'
    uheaders = Addon.defaultHeaders.copy()
    uheaders['Content-Type'] = 'application/x-www-form-urlencoded'
    uheaders['Accept'] = 'application/json'
    uheaders['X-Requested-With'] = 'ShockwaveFlash/22.0.0.209'
    uheaders['Origin'] = 'http://cdn1.edgedatg.com'
    html = Addon.getRequest(url, udata, uheaders)
    a = json.loads(html)
    if a.get('uplynkData', None) is None:
        return

    sessionKey = a['uplynkData']['sessionKey']
    if not '&cid=' in sessionKey:
        oid = Addon.find_single_match(html, '&oid=(.+?)&')
        eid = Addon.find_single_match(html, '&eid=(.+?)&')
        url = 'http://content.uplynk.com/ext/%s/%s.m3u8?%s' % (oid, eid,
                                                               sessionKey)
    else:
        cid = Addon.find_single_match(html, '&cid=(.+?)&')
        url = 'http://content.uplynk.com/%s.m3u8?%s' % (cid, sessionKey)

    Addon.play(url)
Пример #10
0
def hgtv_episodes(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(link, '"id" : "(.*?)},')

    for entry in matches:
        name = Addon.find_single_match(entry, '"title" : "(.+?)"').replace(
            "&amp;", "&").replace("&#39;", "'").strip()
        description = Addon.find_single_match(
            entry, '"description" : "(.+?)"').replace("<p>",
                                                      "").replace("<\/p>", "")
        url = Addon.find_single_match(entry, '"releaseUrl" : "(.+?)"')
        iconimage = "http://hgtv.com/" + Addon.find_single_match(
            entry, '"thumbnailUrl" : "(.+?)"')
        if ".jpg" not in iconimage:
            iconimage = xbmc.translatePath(
                os.path.join(plugin_path, 'resources', 'images',
                             'hgtv_main.png'))
        if "http" in url:
            Addon.addLink(name, description, url, 2, iconimage)
Пример #11
0
def smith_main():
    url = 'http://www.smithsonianchannel.com/full-episodes'
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(
        link, '<li class="mix free" data-premium="false">(.*?)</li>')

    for entry in matches:
        name = Addon.find_single_match(
            entry, '<h3 class="promo-series-name">(.+?)</h3>').replace(
                "&amp;", "&").replace("&#39;", "'")
        description = Addon.find_single_match(
            entry, '<h2 class="promo-show-name">(.+?)</h2>').replace(
                "&amp;", "&").replace("&#39;", "'")
        url = "http://www.smithsonianchannel.com/" + Addon.find_single_match(
            entry, '<a href="(.+?)"')
        iconimage = "http:" + Addon.find_single_match(
            entry, '<source srcset="(.+?)"')
        if len(name) > 0 and "http" in url:
            Addon.addLink(name, description, url, 11, iconimage)
Пример #12
0
def hgtv_main():
    url = 'http://www.hgtv.com/shows/full-episodes/'
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(
        link,
        '<div class="m-MediaBlock o-Capsule__m-MediaBlock m-MediaBlock--playlist">(.*?)</h4>'
    )
    for entry in matches:
        name = Addon.find_single_match(entry, 'title="(.+?)"').replace(
            "&amp;", "&").replace("&#39;", "'").strip()
        description = ""
        url = "http:" + Addon.find_single_match(entry, '<a href="(.+?)"')
        iconimage = "http:" + Addon.find_single_match(entry,
                                                      'data-src="(.+?)"')
        if ".jpg" not in iconimage:
            iconimage = xbmc.translatePath(
                os.path.join(plugin_path, 'resources', 'images',
                             'hgtv_main.png'))
        videos = Addon.find_single_match(
            entry,
            '<span class="m-MediaBlock__a-AssetInfo">(.+?) Videos</span>')
        if videos != "0":
            Addon.addDir(name, description, url, 1, iconimage)
Пример #13
0
def autoPlay():
    try:
        pl = Addon.get_playlist(xbmc.PLAYLIST_VIDEO)
        xbmc.Player().play(pl)
        #try and give it time to buffer enough of stream
        xbmc.sleep(5000)
        if xbmc.getCondVisibility('player.paused') == 1:
            xbmc.Player().pause()
    except Exception, e:
        print str(e)
Пример #14
0
def pbs_main():
    req = urllib2.Request('http://pbskids.org/video/')
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    pg = response.read()
    response.close()
    a = re.compile(
        '<dd class="category-list-button.+?data-slug="(.+?)">(.+?)<.+?src="(.+?)".+?</dd',
        re.DOTALL).findall(pg)
    for url, name, thumb in a:
        url = 'https://cms-tc.pbskids.org/pbskidsvideoplaylists/%s.json' % url

        name = name.replace("&amp;", "&").replace("&#039;", "'")
        description = name
        iconimage = thumb
        Addon.addDir(str(name), str(description), str(url), 24, str(iconimage))
Пример #15
0
def abc_main():
    url = 'http://abc.go.com/shows'
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(link, '<li  data-sm-id=""(.*?)/li>')
    for entry in matches:
        name = Addon.find_single_match(
            entry, '<div class="tile-show-name truncate">(.+?)</div>').replace(
                "&amp;", "&").replace("&#39;", "'")
        description = ""
        path = Addon.find_single_match(entry, '<a href="(.+?)"').replace(
            "/index", "")
        if name == "The Neighbors":
            url = "http://abc.go.com" + path + "/episode-guide/season-01"
        else:
            url = "http://abc.go.com" + path + "/episode-guide"
        iconimage = Addon.find_single_match(entry, 'srcset="(.+?) ')
        if "http" in url and name != "":
            Addon.addDir(name, description, url, 19, iconimage)
Пример #16
0
def addToLibrary(play):
    Addon.log('Add to library: %s' % play)

    folder = Addon.get_setting('library_folder')
    if folder == '':
        d = xbmcgui.Dialog()
    d.ok(
        Addon.get_string(30300),
        'You have not set the library folder.\nPlease update the addon settings and try again.',
        '', '')
    Addon.addon.openSettings(sys.argv[0])

    folder = Addon.get_setting('library_folder')
    if folder == '':
        return

    if Addon.get_setting('download_hq') == 'true':  #fix for old versions
        hq = '720p'
    else:
        hq = Addon.get_setting('hq')

    title = play.rsplit('@', 1)[0]
    assetID = play.rsplit('@', 1)[1]
    stream_url = muzu.resolve_stream(assetID, hq)

    #try and match artist and track name
    artist, track = getArtistAndTrack(title)

    kb = xbmc.Keyboard(artist, 'Enter Artist...')
    kb.doModal()
    if not kb.isConfirmed():
        return

    artist = clean(kb.getText())

    kb = xbmc.Keyboard(track, 'Enter Track...')
    kb.doModal()
    if not kb.isConfirmed():
        return

    track = clean(kb.getText())

    if track == '' and artist == '':
        return

    path = os.path.join(folder, artist + ' - ' + track)
    if not os.path.exists(path):
        os.mkdir(path)

    filename = os.path.join(path, track + '.strm')

    strm = stream_url
    f = open(filename, "w")
    f.write(strm)
    f.close()
Пример #17
0
def addToLibrary(play):
    Addon.log('Add to library: %s' % play)

    folder = Addon.get_setting('library_folder')
    if folder == '':
        d = xbmcgui.Dialog()
    d.ok(Addon.get_string(30300),'You have not set the library folder.\nPlease update the addon settings and try again.','','')
    Addon.addon.openSettings(sys.argv[0])
    
    folder = Addon.get_setting('library_folder')
    if folder == '':
        return

    if Addon.get_setting('download_hq') == 'true': #fix for old versions
        hq = '720p'
    else:
        hq = Addon.get_setting('hq')   

    title      = play.rsplit('@', 1)[0]
    assetID    = play.rsplit('@', 1)[1]
    stream_url = muzu.resolve_stream(assetID, hq) 

    #try and match artist and track name
    artist, track = getArtistAndTrack(title)

    kb = xbmc.Keyboard(artist, 'Enter Artist...' )
    kb.doModal()
    if not kb.isConfirmed():
        return

    artist = clean(kb.getText())

    kb = xbmc.Keyboard(track, 'Enter Track...' )
    kb.doModal()
    if not kb.isConfirmed():
        return

    track = clean(kb.getText())

    if track == '' and artist == '':
        return

    path = os.path.join(folder, artist + ' - ' + track)
    if not os.path.exists(path):
        os.mkdir(path)

    filename = os.path.join(path, track+'.strm')

    strm = stream_url
    f    = open(filename, "w")
    f.write(strm)
    f.close()
Пример #18
0
def abc_episodes(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(
        link,
        '<div class="m-episode-copy medium-8 large-6 columns nogutter ">(.*?)</picture>'
    )

    if len(matches) > 0:
        episodelist = []

        for entry in matches:
            season = Addon.find_single_match(
                entry,
                '<span class="season-number light">(.+?)</span>').replace(
                    "&amp;", "&").replace("&#39;", "'").strip()
            season = re.sub('<[^<]+?>', '', season).strip()
            episode = Addon.find_single_match(
                entry, '<span class="episode-number">(.+?)</a>').replace(
                    "&amp;", "&").replace("&#39;", "'").strip()
            episode = re.sub('<[^<]+?>', '', episode).strip()
            name = season + " " + episode
            description = Addon.find_single_match(
                entry, '<p>(.+?)</p>').replace("&amp;",
                                               "&").replace("&#39;",
                                                            "'").strip()
            description = re.sub('<[^<]+?>', '', description).strip()
            path = Addon.find_single_match(
                entry, '<a class="dark-text" href="(.+?)">Watch</a>')
            url = "http://abc.go.com" + path
            iconimage = Addon.find_single_match(entry, 'srcset="(.+?) ')
            if len(path) > 0:
                episodelist.append(path)
            if len(episodelist) > 0:
                Addon.addLink(name, description, url, 21, iconimage)
            else:
                dlg.ok(addonname, "No episodes found.")
                exit()
    else:
        dlg.ok(addonname, "No episodes found.")
        exit()
Пример #19
0
def display_songs(mode, songs):
    if mode == 'music':
        add = Addon.add_music_item
    else:
        add = Addon.add_video_item
    for s in songs:
        if mode == 'music':
            infolabels = {'title': s['title'], 
                          'artist': s['artist']}
        else:
            infolabels = {'title': '%s - %s' % 
                          (s['artist'], s['title'])}
        add(Addon.build_query({'mode': mode, 
                               'song_id': s['song_id']}),
            infolabels, img=s['thumb'], total_items=16)
Пример #20
0
def show_streams(title, playlist_id):
    if mode == title:
        streams = source.Source().get_streams(playlist_id)
        if streams:
            for c in streams:
                title = c['title']
                channel = c['title']
                videoId = c['videoId']
                img = c['img']
                rURL = Addon.plugin_url + "?channel=" + channel + "&videoId=" + videoId + "&mode=play"
                Addon.add_video_item(rURL, {'title': title}, img=img)

    elif mode == 'play':
        videoId = Addon.plugin_queries['videoId']
        stream_status = source.Source()._get_json(
            '/check' + base64.b64decode('LnBocA=='), {'id': videoId})['status']
        if stream_status == 'true':
            stream = "https://www.youtube.com/watch?v=" + videoId
            stream_url = liveresolver.resolve(stream)
            item = xbmcgui.ListItem(path=stream_url)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
        else:
            dlg.ok(Addon.get_string(5000), Addon.get_string(7000))
            exit()
Пример #21
0
def nbc_main():
    req = urllib2.Request('https://www.nbc.com/shows/all/popular')
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    html = Addon.find_single_match(link, '<script>PRELOAD=(.*?)</script>')
    a = json.loads(html)
    a = a['lists']['allShows']['items']
    for b in a:
        if b['tuneIn'] != 'WATCH VIDEOS' and b['tuneIn'] != 'COMING SOON' and b[
                'tuneIn'] != 'LEARN MORE' and b[
                    'tuneIn'] != 'WATCH HIGHLIGHTS' and b[
                        'tuneIn'] != 'WATCH VIDEO' and 'SERIES PREMIERE' not in str(
                            b['tuneIn']):
            name = b['title']
            description = ""
            url = 'https://www.nbc.com/' + b['urlAlias'] + '?nbc=1'
            iconimage = b['image']['path']
            if "Coming Soon" not in name:
                Addon.addDir(name, description, url, 22, iconimage)
Пример #22
0
def display_songs(mode, songs):
    if mode == 'music':
        add = Addon.add_music_item
    else:
        add = Addon.add_video_item
    for s in songs:
        if mode == 'music':
            infolabels = {'title': s['title'], 'artist': s['artist']}
        else:
            infolabels = {'title': '%s - %s' % (s['artist'], s['title'])}
        add(Addon.build_query({
            'mode': mode,
            'song_id': s['song_id']
        }),
            infolabels,
            img=s['thumb'],
            total_items=16)
Пример #23
0
def downloadPath(title, stream_url):
    if not stream_url or stream_url == '':
        return None

    downloadFolder = Addon.get_setting('download_folder')

    if Addon.get_setting('ask_folder') == 'true':
        dialog = xbmcgui.Dialog()
    downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False,
                                   False, downloadFolder)
    if downloadFolder == '':
        return None

    if downloadFolder is '':
        d = xbmcgui.Dialog()
    d.ok(
        Addon.get_string(30300),
        'You have not set the default download folder.\nPlease update the addon settings and try again.',
        '', '')
    Addon.addon.openSettings(sys.argv[0])
    downloadFolder = Addon.get_setting('download_folder')

    if downloadFolder == '' and Addon.get_setting('ask_folder') == 'true':
        dialog = xbmcgui.Dialog()
    downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False,
                                   False, downloadFolder)

    if downloadFolder == '':
        return None

    filename = stream_url
    filename = filename.rsplit('/', 1)[1]
    filename = filename.rsplit('?', 1)[0]
    ext = filename.rsplit('.', 1)[1]

    if isChart(title):
        title = title.split(': ', 1)[1]

    if Addon.get_setting('ask_filename') == 'true':
        kb = xbmc.Keyboard(title, 'Save video as...')
    kb.doModal()
    if kb.isConfirmed():
        filename = kb.getText()
    else:
        filename = title

    filename = clean(filename) + '.' + ext

    return os.path.join(downloadFolder, filename)
Пример #24
0
def downloadPath(title, stream_url):        		
    if not stream_url or stream_url == '':
        return None

    downloadFolder = Addon.get_setting('download_folder')

    if Addon.get_setting('ask_folder') == 'true':
        dialog = xbmcgui.Dialog()
	downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False, False, downloadFolder)
	if downloadFolder == '' :
	    return None

    if downloadFolder is '':
        d = xbmcgui.Dialog()
	d.ok(Addon.get_string(30300),'You have not set the default download folder.\nPlease update the addon settings and try again.','','')
	Addon.addon.openSettings(sys.argv[0])
	downloadFolder = Addon.get_setting('download_folder')

    if downloadFolder == '' and Addon.get_setting('ask_folder') == 'true':
        dialog = xbmcgui.Dialog()
	downloadFolder = dialog.browse(3, 'Save to folder...', 'files', '', False, False, downloadFolder)	

    if downloadFolder == '' :
        return None

    filename = stream_url
    filename = filename.rsplit('/', 1)[1]
    filename = filename.rsplit('?', 1)[0]
    ext      = filename.rsplit('.', 1)[1]

    if isChart(title):
        title = title.split(': ', 1)[1]
   
    if Addon.get_setting('ask_filename') == 'true':
        kb = xbmc.Keyboard(title, 'Save video as...' )
	kb.doModal()
	if kb.isConfirmed():
	    filename = kb.getText()
	else:
	    return None
    else:
        filename = title

    filename = clean(filename) + '.' + ext

    return os.path.join(downloadFolder, filename)
Пример #25
0
def freeform_main():
    url = 'http://freeform.go.com/shows'
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    matches = Addon.find_multiple_matches(
        link, '<div class="col-xs-4 shows-grid">(.*?)/p>')
    for entry in matches:
        name = Addon.find_single_match(entry, '<h3>(.+?)</h3>').replace(
            "&amp;", "&").replace("&#39;", "'")
        description = Addon.find_single_match(entry, '<p>(.+?)<').replace(
            "&amp;", "&").replace("&#39;", "'")
        url = "http://freeform.go.com" + Addon.find_single_match(
            entry, '<a href="(.+?)"')
        iconimage = Addon.find_single_match(entry, '<img src="(.+?)"')
        if "http" in url:
            Addon.addDir(name, description, url, 16, iconimage)
Пример #26
0
def freeform_stream(url):
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()
    vd = Addon.find_single_match(link, "VDKA(.+?)\"")
    url = 'https://api.entitlement.watchabc.go.com/vp2/ws-secure/entitlement/2020/authorize.json'
    udata = 'video%5Fid=VDKA' + str(
        vd) + '&device=001&video%5Ftype=lf&brand=002'
    uheaders = Addon.defaultHeaders.copy()
    uheaders['Content-Type'] = 'application/x-www-form-urlencoded'
    uheaders['Accept'] = 'application/json'
    uheaders['X-Requested-With'] = 'ShockwaveFlash/24.0.0.194'
    uheaders['Origin'] = 'http://cdn1.edgedatg.com'
    uheaders['DNT'] = '1'
    uheaders[
        'Referer'] = 'http://cdn1.edgedatg.com/aws/apps/datg/web-player-unity/1.0.6.13/swf/player_vod.swf'
    uheaders['Pragma'] = 'no-cache'
    uheaders['Connection'] = 'keep-alive'
    uheaders['Cache-Control'] = 'no-cache'
    html = Addon.getRequest(url, udata, uheaders)
    a = json.loads(html)
    if a.get('uplynkData', None) is None:
        return

    sessionKey = a['uplynkData']['sessionKey']
    oid = Addon.find_single_match(html, '&oid=(.+?)&')
    eid = Addon.find_single_match(html, '&eid=(.+?)&')
    url = 'http://content.uplynk.com/ext/%s/%s.m3u8?%s' % (oid, eid,
                                                           sessionKey)

    Addon.play(url)
Пример #27
0
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, tvtime
import sys, os, urllib, urllib2
import json
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

addon       = xbmcaddon.Addon()
addonname   = addon.getAddonInfo('name')
addonid   = addon.getAddonInfo('id')
plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path')

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

dlg = xbmcgui.Dialog()

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle)) 

mode = Addon.plugin_queries['mode']

quality = int(Addon.get_setting('quality'))

if mode == 'main':
    channels = tvtime.TVtime().get_channels(quality)
    if channels:
        for c in channels:
Пример #28
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''
import datetime, time, os, urllib
import xbmc, xbmcaddon
import _strptime

from resources.lib import Addon

addon = xbmcaddon.Addon(id='plugin.video.ustvnow')
plugin_path = addon.getAddonInfo('path')
THUMB = os.path.join(plugin_path,'icon.png')

while (not xbmc.abortRequested):
    if int(Addon.get_setting('write_type')) != 0:
        if int(Addon.get_setting('write_type')) in [2,3]:
            MSG = 'M3U'
        else:
            MSG = 'STRM'
        now  = datetime.datetime.today()
        try:
            Update_LastRun = Addon.get_setting("Update_NextRun")
            if not Update_LastRun:
                raise exception()
        except:
            Update_LastRun = "1970-01-01 23:59:00.000000"
            Addon.set_setting('Update_NextRun', str(Update_LastRun))
        try:
            SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f")
        except:
Пример #29
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, crackle 
import sys
import xbmcgui, xbmcplugin

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

proxy = ''
if Addon.get_setting('proxy') == 'true':
    proxy = Addon.get_setting('proxy_server')

crack = crackle.Crackle(proxy)

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

if play:
Пример #30
0
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, ustvnow 
import sys
import urllib
import xbmc, xbmcgui, xbmcplugin

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email')
password = Addon.get_setting('password')
ustv = ustvnow.Ustvnow(email, password)

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']

if mode == 'main':
    Addon.log(mode)
    Addon.add_directory({'mode': 'live'}, Addon.get_string(30001))
    Addon.add_directory({'mode': 'recordings'}, Addon.get_string(30002))
Пример #31
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, roadrunner 
import sys
import xbmc

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

rr = roadrunner.Roadrunner()

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

def display_songs(mode, songs):
    if mode == 'music':
        add = Addon.add_music_item
    else:
        add = Addon.add_video_item
Пример #32
0
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon
import sys, os
import urllib
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email')
password = Addon.get_setting('password')
premium = Addon.get_setting('subscription') == "true"
premium_last = Addon.get_setting('subscription_last') == "true"
dlg = xbmcgui.Dialog()
addon = xbmcaddon.Addon(id='plugin.video.ustvnow')
plugin_path = addon.getAddonInfo('path')
write_path = xbmc.translatePath(Addon.get_setting('write_folder'))

from resources.lib import ustvnow_new
ustv = ustvnow_new.Ustvnow(email, password, premium)

if premium != premium_last:
    ustv.clearCache()
Пример #33
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''
import datetime, time, os, urllib
import xbmc, xbmcaddon
import _strptime

from resources.lib import Addon

addon = xbmcaddon.Addon(id='plugin.video.ustvnow')
plugin_path = addon.getAddonInfo('path')
THUMB = os.path.join(plugin_path,'icon.png')

while (not xbmc.abortRequested):
    if int(Addon.get_setting('write_type')) != 0:
        if int(Addon.get_setting('write_type')) in [2,3]:
            MSG = 'M3U'
        else:
            MSG = 'STRM'
        now  = datetime.datetime.today()
        try:
            Update_LastRun = Addon.getProperty("Update_NextRun")
            if not Update_LastRun:
                raise exception()
        except:
            Update_LastRun = "1970-01-01 23:59:00.000000"
            Addon.setProperty('Update_NextRun', str(Update_LastRun))
        try:
            SyncUpdate = datetime.datetime.strptime(Update_LastRun, "%Y-%m-%d %H:%M:%S.%f")
        except:
Пример #34
0
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, muzutv 
import os.path
import random
import sys
import xbmc, xbmcgui, xbmcplugin

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email')
password = Addon.get_setting('password')
muzu = muzutv.MuzuTv()

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

if play:
    Addon.log('play: %s' % play)
    if Addon.get_setting('hq') == 'true':
Пример #35
0
def pbs_stream(url):
    html = Addon.getRequest('%s?format=json' % url)
    a = json.loads(html)
    url = a.get('url')
    if url is not None:
        Addon.play(url)
Пример #36
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, freedocast 
import sys
import xbmc, xbmcgui, xbmcplugin

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

freedo = freedocast.Freedocast()

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

if play:
    Addon.log('play: %s mode: %s' % (play, mode))    
    if mode == 'vid':
        stream_url = freedo.resolve_video(play)
    else:    
Пример #37
0
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, ustvnow_plus
import sys, os, urllib, urllib2
import json
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

addon       = xbmcaddon.Addon()
addonname   = addon.getAddonInfo('name')
addonid   = addon.getAddonInfo('id')
plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path')

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

write_path = xbmc.translatePath(os.path.join(plugin_path, 'resources', 'guide'))

setup = Addon.get_setting('setup')
setup_new = Addon.get_setting('setup_new')
email = Addon.get_setting('email')
password = Addon.get_setting('password')
ustv = ustvnow_plus.Ustvnow(email, password)

dlg = xbmcgui.Dialog()

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle)) 
Пример #38
0
import xbmc, xbmcgui, xbmcplugin
import re, urllib

CHARTS = []
CHARTS.append('')
CHARTS.append(['568952', 'top-40-charts']) #Top 40
#The rest no longer available on Muzu
#CHARTS.append(['695693', 'uk-rock'])       #Rock Chart
#CHARTS.append(['695695', ''])              #Alternative
#CHARTS.append(['695696', 'uk-dance'])      #Dance Chart
#CHARTS.append(['695701', 'uk-rnb'])        #RnB


Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email    = Addon.get_setting('email')
password = Addon.get_setting('password')
muzu     = muzutv.MuzuTv()

Addon.log('plugin url: '     + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: '  + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

#print mode
#print play
Пример #39
0
import sys
import xbmc, xbmcgui, xbmcplugin
import re, urllib

CHARTS = []
CHARTS.append('')
CHARTS.append(['568952', 'top-40-charts'])  #Top 40
#The rest no longer available on Muzu
#CHARTS.append(['695693', 'uk-rock'])       #Rock Chart
#CHARTS.append(['695695', ''])              #Alternative
#CHARTS.append(['695696', 'uk-dance'])      #Dance Chart
#CHARTS.append(['695701', 'uk-rnb'])        #RnB

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email')
password = Addon.get_setting('password')
muzu = muzutv.MuzuTv()

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

#print mode
#print play
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, ustvnow 
import sys
import urllib
import xbmc, xbmcgui, xbmcplugin

DEFAULT_EMAIL = '*****@*****.**'
DEFAULT_PASSWORD = '******'

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email') or DEFAULT_EMAIL
password = Addon.get_setting('password') or DEFAULT_PASSWORD
print "Logging into ustvnow with email %s and password %s" % (email, password)

ustv = ustvnow.Ustvnow(email, password)

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']

if mode == 'main':
    mode = 'live'
Пример #41
0
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, ustvnow
import sys, os, urllib, urllib2
import json, random
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

addon       = xbmcaddon.Addon()
addonname   = addon.getAddonInfo('name')
addonid   = addon.getAddonInfo('id')
plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path')

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

write_path = xbmc.translatePath(os.path.join(plugin_path, 'resources', 'guide'))

setup = Addon.get_setting('setup')
setup_new = Addon.get_setting('setup_new')
email = Addon.get_setting('email')
password = Addon.get_setting('password')
ustv = ustvnow.Ustvnow(email, password)

dlg = xbmcgui.Dialog()

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle)) 
Пример #42
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, crackle
import sys
import xbmcgui, xbmcplugin

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

proxy = ''
if Addon.get_setting('proxy') == 'true':
    proxy = Addon.get_setting('proxy_server')

crack = crackle.Crackle(proxy)

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']

if play:
Пример #43
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''
import datetime, time, os, urllib
import xbmc, xbmcaddon
import _strptime

from resources.lib import Addon

addon = xbmcaddon.Addon(id='plugin.video.ustvnow')
plugin_path = addon.getAddonInfo('path')
THUMB = os.path.join(plugin_path, 'icon.png')

while (not xbmc.abortRequested):
    if int(Addon.get_setting('write_type')) != 0:
        if int(Addon.get_setting('write_type')) in [2, 3]:
            MSG = 'M3U'
        else:
            MSG = 'STRM'
        now = datetime.datetime.today()
        try:
            Update_LastRun = Addon.getProperty("Update_NextRun")
            if not Update_LastRun:
                raise exception()
        except:
            Update_LastRun = "1970-01-01 23:59:00.000000"
            Addon.setProperty('Update_NextRun', str(Update_LastRun))
        try:
            SyncUpdate = datetime.datetime.strptime(Update_LastRun,
                                                    "%Y-%m-%d %H:%M:%S.%f")
Пример #44
0
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon, ustvnow
import sys
import urllib
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
addonid = addon.getAddonInfo('id')

if Addon.get_setting('setup') == "false":
    win = xbmcgui.Window(10000)
    win.setProperty(addonname + '.setup', "true")
    xbmc.executebuiltin('RunScript("' + addonid + '", "")')
    while True:
        if win.getProperty(addonname + '.setup') == "false":
            break
        xbmc.sleep(250)

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email')
password = Addon.get_setting('password')
ustv = ustvnow.Ustvnow(email, password)
Пример #45
0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from pprint import pprint

from resources.lib import Addon
from resources.lib.eighttracks import EightTracks, EightTracksPlayer 
import sys
import urllib
import xbmc, xbmcgui

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

Addon.log('plugin url: ' + Addon.plugin_url)
Addon.log('plugin queries: ' + str(Addon.plugin_queries))
Addon.log('plugin handle: ' + str(Addon.plugin_handle))

mode = Addon.plugin_queries['mode']
play = Addon.plugin_queries['play']
next = Addon.plugin_queries.get('next', None)

if mode == 'main':
  et = EightTracks(Addon.get_setting('username'), 
                   Addon.get_setting('password'),
                   show_validation_error=True)
else:
  et = EightTracks(Addon.get_setting('username'), 
Пример #46
0
import json, base64
import requests
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

from datetime import date
from datetime import time
from datetime import datetime

addon = xbmcaddon.Addon()
addonid = addon.getAddonInfo('id')
addonname = addon.getAddonInfo('name')
plugin_path = xbmcaddon.Addon(id=addonid).getAddonInfo('path')

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

dlg = xbmcgui.Dialog()

addon_logo = xbmc.translatePath(os.path.join(plugin_path, 'icon.png'))

brand_logo = xbmc.translatePath(os.path.join(plugin_path, 'icon.png'))

mode = Addon.plugin_queries['mode']


##Begin HGTV##
def hgtv_main():
    url = 'http://www.hgtv.com/shows/full-episodes/'
    req = urllib2.Request(url)
    req.add_header(
Пример #47
0
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''

from resources.lib import Addon
import sys, os
import urllib
import xbmc, xbmcgui, xbmcplugin, xbmcaddon

Addon.plugin_url = sys.argv[0]
Addon.plugin_handle = int(sys.argv[1])
Addon.plugin_queries = Addon.parse_query(sys.argv[2][1:])

email = Addon.get_setting('email')
password = Addon.get_setting('password')
premium = Addon.get_setting('subscription') == "true"
premium_last = Addon.get_setting('subscription_last') == "true"
dlg = xbmcgui.Dialog()
addon = xbmcaddon.Addon(id='plugin.video.ustvnow')
plugin_path = addon.getAddonInfo('path')
write_path = xbmc.translatePath(Addon.get_setting('write_folder'))

from resources.lib import ustvnow_new
ustv = ustvnow_new.Ustvnow(email, password, premium)

if premium != premium_last:
    ustv.clearCache()
Пример #48
0
def cooking_main():
    url = 'http://www.cookingchanneltv.com/videos/players/full-episodes-player'
    req = urllib2.Request(url)
    req.add_header(
        'User-Agent',
        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
    )
    response = urllib2.urlopen(req)
    link = response.read()
    response.close()

    matches = Addon.find_multiple_matches(link, '<html >(.*?)</html>')

    for entry in matches:
        name = Addon.find_single_match(
            entry, '<span class="m-VideoPlayer__a-HeadlineText">(.+?)</span>'
        ).replace("&amp;", "&").replace("&#39;", "'")
        description = ""
        url = "null"
        iconimage = "http://cookingchanneltv.com/" + Addon.find_single_match(
            entry, '"thumbnailUrl" : "(.+?)"')
        if ".jpg" not in iconimage:
            iconimage = xbmc.translatePath(
                os.path.join(plugin_path, 'resources', 'images',
                             'cooking_main.png'))
        if name is not "":
            Addon.addDir(name, description, url, 7, iconimage)

    matches = Addon.find_multiple_matches(
        link, 'data-module="editorial-promo">(.*?)</div>')

    for entry in matches:
        name = Addon.find_single_match(entry, 'title="(.+?)"').replace(
            "&amp;", "&").replace("&#39;", "'")
        description = ""
        url = "http:" + Addon.find_single_match(entry, '<a href="(.+?)"')
        iconimage = "http:" + Addon.find_single_match(entry,
                                                      'data-src="(.+?)"')
        if ".jpg" not in iconimage:
            iconimage = xbmc.translatePath(
                os.path.join(plugin_path, 'resources', 'images',
                             'cooking_main.png'))
        if name is not "":
            Addon.addDir(name, description, url, 7, iconimage)