Пример #1
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)
Пример #2
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)
Пример #3
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()
Пример #4
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)
Пример #5
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)
Пример #6
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)
Пример #7
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)
Пример #8
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()
Пример #9
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)
Пример #10
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()
Пример #11
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)
Пример #12
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)
Пример #13
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)
Пример #14
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)
Пример #15
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)