예제 #1
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)
예제 #2
0
파일: main.py 프로젝트: birdy-luis/Project
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
파일: main.py 프로젝트: birdy-luis/Project
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)
예제 #4
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)
예제 #5
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))
예제 #6
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)
예제 #7
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)