Last active
September 20, 2017 15:02
-
-
Save gr33ntii/66411e04ffaa74bcc96ad8ceef2b0169 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
username = '' | |
password = '' | |
url = 'LINK JAV ĐỂ GET' | |
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36', \ | |
'Referer': 'https://secure.javhd.com/login/', 'Accept-Charset': 'utf-8', 'Accept-Language': 'vi-VN,vi;q=0.8,en-US;q=0.2,en;q=0.2', \ | |
'Accept': 'text/xml,application/xml,application/xhtml+xml,text/html'} | |
payload = {'login': username, 'password': password, 'back': 'javhd.com', 'path': 'L2Vu'} | |
r = requests.Session() | |
cookies = r.post("https://secure.javhd.com/login/", data=payload, headers=headers).cookies | |
videoid = re.search('https://javhd.com/en/id/([0-9]+)/.+', url).group(1) | |
data = r.get(url , headers=headers, cookies=cookies).text | |
videoname = re.search('<div class=\"player-container\" style=\"background: url\(https://[\w\d]+.cdnjav.com/[\w\d-]+/thumbs/([\w\d-]+)/images/[\w\d]+/[\w\d.]+\);', data).group(1)[:-2] | |
videoendpoint = 'https://javhd.com/playback/{0}/{1}_hq.mp4?username={2}'.format(videoid, videoname, username) | |
videourl = r.get(videoendpoint, cookies=cookies, allow_redirects=False).headers['Location'] | |
print (videourl) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment