예제 #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 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(
            "&", "&").replace("'", "'").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_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)
예제 #4
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()
예제 #5
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)
예제 #6
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()
예제 #7
0
파일: main.py 프로젝트: birdy-luis/Project
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()