コード例 #1
0
ファイル: dtf_actions.py プロジェクト: zuberv/xceltv
def __retrieve_tv_shows__(tv_channel_url):
    tv_shows = []
    if tv_channel_url is None:
        return tv_shows
    tv_channel_url = BASE_WSITE_URL + tv_channel_url
    contentDiv = BeautifulSoup.SoupStrainer('div', {'class':'all-tv-shows'})
    soup = HttpClient().get_beautiful_soup(url=tv_channel_url, parseOnlyThese=contentDiv, accept_500_error=True)
    list_item = soup.find('ul')
    for item in list_item.findChildren('li'):
        aTag = item.findChild('a')
        
        tv_show_url = str(aTag['href'])
        if tv_show_url[0:4] != "http":
            tv_show_url = BASE_WSITE_URL + '/' + tv_show_url
        tv_show_name = aTag.getText()
        tv_shows.append({"name":http.unescape(tv_show_name), "url":tv_show_url, "iconimage":""})
    return tv_shows
コード例 #2
0
ファイル: dtf_actions.py プロジェクト: noba3/KoTos
def __retrieve_tv_shows__(tv_channel_url):
    tv_shows = []
    if tv_channel_url is None:
        return tv_shows
    tv_channel_url = BASE_WSITE_URL + tv_channel_url
    contentDiv = BeautifulSoup.SoupStrainer("div", {"class": "all-tv-shows"})
    soup = HttpClient().get_beautiful_soup(url=tv_channel_url, parseOnlyThese=contentDiv, accept_500_error=True)
    list_item = soup.find("ul")
    for item in list_item.findChildren("li"):
        aTag = item.findChild("a")

        tv_show_url = str(aTag["href"])
        if tv_show_url[0:4] != "http":
            tv_show_url = BASE_WSITE_URL + "/" + tv_show_url
        tv_show_name = aTag.getText()
        tv_shows.append({"name": http.unescape(tv_show_name), "url": tv_show_url, "iconimage": ""})
    return tv_shows
コード例 #3
0
ファイル: dtf_actions.py プロジェクト: noba3/KoTos
def __retrieve_tv_shows__(tv_channel_url):
    tv_shows = []
    if tv_channel_url is None:
        return tv_shows
    tv_channel_url = BASE_WSITE_URL + tv_channel_url
    contentDiv = BeautifulSoup.SoupStrainer('div', {'class': 'all-tv-shows'})
    soup = HttpClient().get_beautiful_soup(url=tv_channel_url,
                                           parseOnlyThese=contentDiv,
                                           accept_500_error=True)
    list_item = soup.find('ul')
    for item in list_item.findChildren('li'):
        aTag = item.findChild('a')

        tv_show_url = str(aTag['href'])
        if tv_show_url[0:4] != "http":
            tv_show_url = BASE_WSITE_URL + '/' + tv_show_url
        tv_show_name = aTag.getText()
        tv_shows.append({
            "name": http.unescape(tv_show_name),
            "url": tv_show_url,
            "iconimage": ""
        })
    return tv_shows