Exemplo n.º 1
0
def LOADVIDEOS(url, name):

    link = main.OPENURL(url)

    soup = BeautifulSoup.BeautifulSoup(link)
    tags = soup.findAll('p')

    if len(tags) < 5:
        tags.extend(soup.findAll('span'))

    video_playlist_items = []
    video_source_id = 0
    video_source_name = None
    video_source = {}

    for tag in tags:
        if re.search('^(Source|ONLINE|Server)', tag.getText(), re.IGNORECASE):
            if len(video_playlist_items) > 0:
                main.addPlayList(video_source_name, url,
                                 constants.SOMINAL_PLAY, video_source_id,
                                 video_playlist_items, name, '')

                video_source[video_source_name] = video_playlist_items
                video_playlist_items = []
            video_source_id = video_source_id + 1
            video_source_name = tag.getText()

        else:
            aTags = tag.findAll(
                'a',
                attrs={
                    'target':
                    re.compile('_blank'),
                    'href':
                    re.compile(
                        '(mediaplaybox.com|desiflicks.com|desionlinetheater.com|wp.me|cine.sominaltvfilms.com|media.thesominaltv.com)'
                    )
                },
                recursive=True)
            if aTags is None or len(aTags) != 1:
                continue
            aTag = aTags[0]
            if aTag is not None:
                video_playlist_items.append(str(aTag['href']))
                video_source_name = re.findall('/.(.+?)/.',
                                               str(aTag['href']))[0]
    if len(video_playlist_items) > 0:
        if len(video_source) == 0:
            video_source_id = video_source_id + 1
        #print 'HERE >>>>>>>> ' + str(video_source_id)
        main.addPlayList(video_source_name, url, constants.SOMINAL_PLAY,
                         video_source_id, video_playlist_items, name, '')
        video_source[video_source_name] = video_playlist_items

    playNow(video_source, name)
Exemplo n.º 2
0
def LOADVIDEOS(url, name):

    link = main.OPENURL(url)

    soup = BeautifulSoup.BeautifulSoup(link)
    tags = soup.findAll("p")

    if len(tags) < 5:
        tags.extend(soup.findAll("span"))

    video_playlist_items = []
    video_source_id = 0
    video_source_name = None
    video_source = {}

    for tag in tags:
        if re.search("^(Source|ONLINE|Server)", tag.getText(), re.IGNORECASE):
            if len(video_playlist_items) > 0:
                main.addPlayList(
                    video_source_name, url, constants.SOMINAL_PLAY, video_source_id, video_playlist_items, name, ""
                )

                video_source[video_source_name] = video_playlist_items
                video_playlist_items = []
            video_source_id = video_source_id + 1
            video_source_name = tag.getText()

        else:
            aTags = tag.findAll(
                "a",
                attrs={
                    "target": re.compile("_blank"),
                    "href": re.compile(
                        "(mediaplaybox.com|desiflicks.com|desionlinetheater.com|wp.me|cine.sominaltvfilms.com|media.thesominaltv.com)"
                    ),
                },
                recursive=True,
            )
            if aTags is None or len(aTags) != 1:
                continue
            aTag = aTags[0]
            if aTag is not None:
                video_playlist_items.append(str(aTag["href"]))
                video_source_name = re.findall("/.(.+?)/.", str(aTag["href"]))[0]
    if len(video_playlist_items) > 0:
        if len(video_source) == 0:
            video_source_id = video_source_id + 1
        # print 'HERE >>>>>>>> ' + str(video_source_id)
        main.addPlayList(
            video_source_name, url, constants.SOMINAL_PLAY, video_source_id, video_playlist_items, name, ""
        )
        video_source[video_source_name] = video_playlist_items

    playNow(video_source, name)
Exemplo n.º 3
0
def VIDEOLINKS(name, url):
    supportedHosts = ["flash player", "dailymotion", "letwatch", "video tanker", "video hut", "cloudy", "video weed"]
    allHosts = [
        "flash player",
        "dailymotion",
        "letwatch",
        "videotanker",
        "videohut",
        "vshare",
        "cloudy",
        "nowvideo",
        "videoweed",
        "movshare",
        "novamov",
        "single",
    ]
    video_source_id = 1
    video_source_name = None
    video_playlist_items = []

    video_source = {}

    link = main.OPENURL(url)
    link = link.replace("\r", "").replace("\n", "").replace("\t", "").replace("&nbsp;", "")
    soup = BeautifulSoup.BeautifulSoup(link).findAll("blockquote", {"class": re.compile(r"\bpostcontent\b")})[0]

    for e in soup.findAll("br"):
        e.extract()
    if soup.has_key("div"):
        soup = soup.findChild("div", recursive=False)

    print soup
    for child in soup.findChildren():
        if (child.getText() == "") or (
            (child.name == "font" or child.name == "a") and re.search("DesiRulez", str(child.getText()), re.IGNORECASE)
        ):
            continue
        elif (child.name == "font") and re.search("Links|Online", str(child.getText()), re.IGNORECASE):
            if len(video_playlist_items) > 0:
                tmp_video_source = video_source_name.lower()
                indx = tmp_video_source.find("[")
                if indx > 0:
                    tmp_video_source = tmp_video_source[: indx - 1]
                if tmp_video_source in supportedHosts:
                    main.addPlayList(
                        video_source_name,
                        url,
                        constants.DESIRULEZ_PLAY,
                        video_source_id,
                        video_playlist_items,
                        name,
                        getVideoSourceIcon(video_source_name),
                    )
                video_source_id = video_source_id + 1
                video_source[video_source_name] = video_playlist_items
                video_playlist_items = []
            video_source_name = child.getText()
            video_source_name = (
                video_source_name.replace("Online", "")
                .replace("Links", "")
                .replace("Quality", "")
                .replace("Watch", "")
                .replace("-", "")
                .replace("Download", "")
                .replace("  ", "")
                .replace("720p HD", "[COLOR red][HD][/COLOR]")
                .replace("DVD", "[COLOR blue][DVD][/COLOR]")
                .strip()
            )
            print video_source_name
        elif (child.name == "a") and not child.getText() == "registration":
            video_playlist_items.append(str(child["href"]))
    playNow(video_source, name)
Exemplo n.º 4
0
def VIDEOLINKS(name, url):
    supportedHosts = [
        'flash player', 'dailymotion', 'letwatch', 'video tanker', 'video hut',
        'cloudy', 'video weed'
    ]
    allHosts = [
        'flash player', 'dailymotion', 'letwatch', 'videotanker', 'videohut',
        'vshare', 'cloudy', 'nowvideo', 'videoweed', 'movshare', 'novamov',
        'single'
    ]
    video_source_id = 1
    video_source_name = None
    video_playlist_items = []

    video_source = {}

    link = main.OPENURL(url)
    link = link.replace('\r',
                        '').replace('\n',
                                    '').replace('\t',
                                                '').replace('&nbsp;', '')
    soup = BeautifulSoup.BeautifulSoup(link).findAll(
        'blockquote', {'class': re.compile(r'\bpostcontent\b')})[0]

    for e in soup.findAll('br'):
        e.extract()
    if soup.has_key('div'):
        soup = soup.findChild('div', recursive=False)

    print soup
    for child in soup.findChildren():
        if (child.getText() == '') or (
            (child.name == 'font' or child.name == 'a') and re.search(
                'DesiRulez', str(child.getText()), re.IGNORECASE)):
            continue
        elif (child.name == 'font') and re.search(
                'Links|Online', str(child.getText()), re.IGNORECASE):
            if len(video_playlist_items) > 0:
                tmp_video_source = video_source_name.lower()
                indx = tmp_video_source.find('[')
                if indx > 0:
                    tmp_video_source = tmp_video_source[:indx - 1]
                if tmp_video_source in supportedHosts:
                    main.addPlayList(video_source_name, url,
                                     constants.DESIRULEZ_PLAY, video_source_id,
                                     video_playlist_items, name,
                                     getVideoSourceIcon(video_source_name))
                video_source_id = video_source_id + 1
                video_source[video_source_name] = video_playlist_items
                video_playlist_items = []
            video_source_name = child.getText()
            video_source_name = video_source_name.replace(
                'Online',
                '').replace('Links', '').replace('Quality', '').replace(
                    'Watch',
                    '').replace('-', '').replace('Download', '').replace(
                        '  ',
                        '').replace('720p HD',
                                    '[COLOR red][HD][/COLOR]').replace(
                                        'DVD',
                                        '[COLOR blue][DVD][/COLOR]').strip()
            print video_source_name
        elif (child.name == 'a') and not child.getText() == 'registration':
            video_playlist_items.append(str(child['href']))
    playNow(video_source, name)