Beispiel #1
0
def get_video(url, referer):
    try:
        url = get_emb(url)
        logga(f'sono in get_video  url che arriva-->{url}')
        headers['Referer'] = ""
        body = get(url, headers=headers).text
        logga(f'body 1-->{body}')
        if "This embed is domain protected." in body:
            headers['Referer'] = referer
            body = get(url, headers=headers).text
            logga(f'body 2-->{body}')
        body = right_path(body)
        logga(f'body ultimo-->{body}')
        pieces = BeautifulSoup(body, "html.parser").find_all("script")
        logga(f'sono in get_video pieces-->{pieces}')
        piece = get_piece(pieces)
        logga(f'sono in get_video piece-->{piece}')
        splitted = [""]
        splitted += piece.split("|")[3:]
        excapes = ["a", "e", "s"]

        indexs = (piece.split("//")[2].split("\";")[0])

        video_url = "https://"

        for a in indexs:
            if (a.isalpha() or a.isdigit()) and (not a in excapes):
                index = int(a, 36)
                video_url += splitted[index]
            else:
                video_url += a
        logga(f'video_url-->{video_url}')
        return video_url
    except (IndexError, UnboundLocalError) as a:
        raise VideoNotAvalaible(url)
Beispiel #2
0
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers).text
    print(body)
    pieces = BeautifulSoup(body, "html.parser").find_all("script")

    try:
        piece = get_piece(pieces)
    except UnboundLocalError:
        raise VideoNotAvalaible(url)

    splitted = [""]
    splitted += piece.split("|")[1:]

    indexs = (piece.split("//")[1].split("\"")[0])

    video_url = "http://"

    for a in indexs.split("/"):
        things = a.split(".")

        for b in things:
            if b == "v":
                video_url += "v."
                continue

            index = int(b, 36)
            video_url += splitted[index]

            if b != things[-1]:
                video_url += "."

        video_url += "/"

    return video_url[:-1]
def get_video(url, referer):
    referer = ""
    headers['Referer'] = referer
    body = get(url, headers=headers).text

    #logga(f'URL-->{url} \n referer-->{referer}')
    #logga(f' body--->{body}')

    video_url = ""

    try:
        link1 = body.split("innerHTML = ")[1]
        link2 = link1.split("('")[1]
        link3 = link2.split("')")[0]
        link4 = link3.split("=")
        link5 = link4[1] + "=" + link4[2] + "=" + link4[3] + "=" + link4[4]
        '''
        logga('Sono dentro TRY')
        logga(f'\n link 1° innerHTML split-->{link1}') 
        logga(f'\n link 2° split-->{link2}')
        logga(f'\n link 3°-->{link3}')
        logga(f'\n link 4°-->{link4}')
        logga(f'\n link 5°-->{link5}') 
        '''
        video_link = "//streamta.pe/get_video?id=" + link5

        logga(f' video_link-->https:{video_link}')
    except IndexError:
        logga(
            'Sono in def get_video, esco con errore sul primo spilt innerHTML')
        raise VideoNotAvalaible(url)

    video_url = get_mp4("https:%s" % video_link)
    logga(f'Video URL-->{video_url}')
    return video_url
Beispiel #4
0
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers)
    parsing = BeautifulSoup(body.text, "html.parser").find_all("input")
    op = parsing[0].get("value")
    ids = parsing[2].get("value")
    fname = parsing[3].get("value")

    try:
        hashs = parsing[5].get("value")
    except IndexError:
        raise VideoNotAvalaible(url)

    data = {
        "op": op,
        "id": ids,
        "fname": fname,
        "hash": hashs,
    }

    sleep(5)
    body = post(body.url, data).text
    """
	pieces = BeautifulSoup(body, "html.parser").find_all("script")
	piece = get_piece(pieces, 1)
	splitted = ["", "", ""]
	splitted += piece.split("|")[3:]

	indexs = (
		piece
		.split("//")[2]
		.split("\"")[0]
	)

	video_url = "http://"

	for a in indexs.split("/"):
		things = a.split(".")

		for b in things:
			if b == "v":
				video_url += "v."
				continue

			index = int(b, 36)
			video_url += splitted[index]

			if b != things[-1]: 
				video_url += "."

		video_url += "/"

	return video_url[:-1]
	"""

    video_url = (body.split("sources: [\"")[1].split("\"")[0])

    return video_url
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers).text

    try:
        video_url = (
            body.split("sources: ")[1].split("file:\"")[1].split("\"")[0])
    except IndexError:
        raise VideoNotAvalaible(url)

    return video_url
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers).text
    parsing = BeautifulSoup(body, "html.parser")

    try:
        video_url = (parsing.find("source").get("src"))
    except AttributeError:
        raise VideoNotAvalaible(url)

    return video_url
def get_video(url, referer):
    url = get_emb(url)
    headers['Referer'] = referer
    body = get(url, headers=headers).text

    try:
        match = search(r'(\$=.+?;)\s*<', body, DOTALL).group(1)
    except AttributeError:
        raise VideoNotAvalaible(url)

    sdata = decode(match)
    video_url = search(r"src',\s*'([^']+)", sdata).group(1)
    return video_url
def get_video(url, referer):
    url = get_emb(url)
    headers['Referer'] = referer
    body = get(url, headers=headers).text

    videos = findall(r"file:[^']'([^']+)',\s*label:[^\"]\"([^\"]+)\"", body)

    if not videos:
        raise VideoNotAvalaible(url)

    if videos[1][1] == "HD":
        return videos[1][0]
    elif videos[0][1] == "NORMAL":
        return videos[0][0]
    elif videos[-1][1] == "MOBILE":
        return videos[2][0]
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers)
    parsing = BeautifulSoup(body.text, "html.parser").find_all("input")

    try:
        op = parsing[3].get("value")
    except IndexError:
        raise VideoNotAvalaible(url)

    code = parsing[4].get("value")
    hashs = parsing[5].get("value")

    data = {"op": op, "code": code, "hash": hashs}

    sleep(5)
    ids = body.url.split("/")[-1]
    url = "https://vidtome.stream/plays/%s" % ids
    body = post(url, data).text
    pieces = BeautifulSoup(body, "html.parser").find_all("script")
    piece = get_piece(pieces)

    splitted = (piece.split(",'")[2].split("|"))

    indexs = (piece.split("//")[1].split("\\")[0])

    video_url = "http://"

    for a in indexs:
        if a.isalpha() or a.isdigit():
            index = int(a, 36)
            what = splitted[index]

            if what == "":
                video_url += a
            else:
                video_url += what
        else:
            video_url += a

    return video_url
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers).text
    parse = BeautifulSoup(body, "html.parser")

    title = (parse.find("title").get_text())

    try:
        token = (body.split("var token=\"")[1].split("\"")[0])
    except IndexError:
        raise VideoNotAvalaible(url)

    csrf = (body.split("var crsf=\"")[1].split("\"")[0])

    data = {"gone": token, "oujda": csrf}

    video_api = "https://vidload.net/vid/"
    response = post(video_api, data).text[:-2]

    video_url = ("%s/%s" % ("/".join(response.split("/")[:-1]), title))

    return video_url
Beispiel #11
0
def get_video(url, referer):
    referer = ""
    headers['Referer'] = referer
    body = get(url, headers=headers).text
    """
	parsing = BeautifulSoup(body, "html.parser")

	try:
		video_link = (
			parsing
			.find("div", id = "videolink")
			.get_text()
		)
	except AttributeError:
		raise VideoNotAvalaible(url)
	"""

    try:
        video_link = eval(body.split("innerHTML = ")[1].split(";")[0])
    except IndexError:
        raise VideoNotAvalaible(url)

    video_url = "https:%s" % video_link
    return video_url
Beispiel #12
0
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers).text
    pieces = BeautifulSoup(body, "html.parser").find_all("script")

    try:
        piece = get_piece(pieces)
    except UnboundLocalError:
        raise VideoNotAvalaible(url)

    splitted = [""]
    splitted += piece.split("|")[1:]

    indexs = (piece.split("//")[1].split("\"")[0])

    s_indexs = indexs.split("/")
    video_url = "https://"

    for a in range(len(s_indexs)):
        if a == 0:
            for b in s_indexs[a].split("."):
                index = int(b, 36)
                video_url += "%s." % splitted[index]

            video_url = video_url[:-1]

        elif a == 1:
            index = int(s_indexs[a], 36)
            video_url += splitted[index]

        elif a == 2:
            things = s_indexs[a].split(",")

            for b in things:
                if b == "":
                    video_url += ","
                    continue

                elif b[0] == ".":
                    video_url += "."
                    b = b[1:]

                index = int(b, 36)
                video_url += splitted[index]

                if b != things[-1][1:]:
                    video_url += ","

        elif a == 3:
            things = s_indexs[a].split(".")

            for b in things:
                index = int(b, 36)
                video_url += splitted[index]

                if b != things[-1]:
                    video_url += "."

        video_url += "/"

    return video_url[:-1]
Beispiel #13
0
def get_video(url, referer):
    headers['Referer'] = referer
    body = get(url, headers=headers).text
    logga(f'URL-->{url} \n referer-->{referer}')
    logga(f' body--->{body}')
    video_url = ""
    '''
    try:
        video_url1 = body.split("sources: [{")[1]   
        logga(f'1 split-->{video_url1}')
        video_url2=video_url1.split("\"")[1]
        logga(f'2 split-->{video_url2}')
        video_url=video_url2.split("\"")[1]
        logga(f'3 split   video_url-->{video_url}')
    except IndexError:
            logga('Sono in def get_video, esco con errore sul primo split')
            raise VideoNotAvalaible(url)
    return video_url

    '''

    pieces = BeautifulSoup(body, "html.parser").find_all("script")

    try:
        piece = get_piece(pieces)
    except UnboundLocalError:
        raise VideoNotAvalaible(url)

    splitted = [""]
    splitted += piece.split("|")[1:]

    indexs = (piece.split("//")[2].split("\"")[0])

    s_indexs = indexs.split("/")
    video_url = "https://"

    for a in range(len(s_indexs)):
        if a == 0:
            for b in s_indexs[a].split("."):
                index = int(b, 36)
                video_url += "%s." % splitted[index]

            video_url = video_url[:-1]

        elif a == 1:
            index = int(s_indexs[a], 36)
            video_url += splitted[index]

        elif a == 2:
            things = s_indexs[a].split(",")

            for b in things:
                if b == "":
                    video_url += ","
                    continue

                elif b[0] == ".":
                    video_url += "."
                    b = b[1:]

                index = int(b, 36)
                video_url += splitted[index]

                if b != things[-1][1:]:
                    video_url += ","

        elif a == 3:
            things = s_indexs[a].split(".")

            for b in things:
                index = int(b, 36)
                video_url += splitted[index]

                if b != things[-1]:
                    video_url += "."

        video_url += "/"

    return video_url[:-1]