From e8c185ddb684e610a87719f9cba37e6e7bd90020 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 2 Mar 2018 12:12:50 -0500 Subject: [PATCH] Updated sproutvideo.com --- sproutvideo.com/run.py | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/sproutvideo.com/run.py b/sproutvideo.com/run.py index 967a4be..e8f4406 100644 --- a/sproutvideo.com/run.py +++ b/sproutvideo.com/run.py @@ -30,15 +30,32 @@ if args.user: url += "video_login?embed=true" r = requests.post(url, headers=headers, data=payload) + + soup = BeautifulSoup(r.text, "html.parser") + + path = soup.find("link", attrs={"rel": "prefetch"}).get("href") + path = path[30:-29] + + video_url = "https://hls2.videos.sproutvideo.com" + path + "/video/index.m3u8" + + command = "streamlink " + command += " --http-query-param Policy=" + r.cookies.get("CloudFront-Policy", path=path) + command += " --http-query-param Key-Pair-Id=" + r.cookies.get("CloudFront-Key-Pair-Id", path=path) + command += " --http-query-param Signature=" + r.cookies.get("CloudFront-Signature", path=path) + command += " \"" + video_url + "\"" + command += " best -o test.mp4" + + print(command) + else: payload = {"password": args.password, "host": "unknown", "url": "unknown", "queryParams": ""} r = requests.post(args.url.replace("embed", "video_password"), headers=headers, data=payload) + soup = BeautifulSoup(r.text, "html.parser") -soup = BeautifulSoup(r.text, "html.parser") -try: - print(soup.find("a", attrs={"class": "hd-download"}).get("href")) - # print(soup.find("a", attrs={"class": "sd-download"}).get("href")) -except AttributeError: - print("Wrong password/username") + try: + print(soup.find("a", attrs={"class": "hd-download"}).get("href")) + # print(soup.find("a", attrs={"class": "sd-download"}).get("href")) + except AttributeError: + print("Wrong password/username")