import requests
import json
url = "https://www.parsevideo.com/api.php?callback=jQuery1124007030330478221525_1546150553014"
data = {
url: 'http://www.bilibili.com/video/av38148327',
hash: '18b21d17da5ff834c5058b9450d21459'
}
headers = {
'authority': 'www.parsevideo.com',
'method': 'POST',
'path': '/api.php?callback=jQuery1124022369922868051262_1546150012304',
'scheme': 'https',
'accept': 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
'content-length': '92',
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'cookie': '_ga=GA1.2.1798389822.1546046046; __cfduid=d7305f802fb5b22dfd3c61e5d8e3d91ba1545988790; _gid=GA1.2.348540794.1546146294',
'origin': 'https://www.parsevideo.com',
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36',
'x-requested-with': 'XMLHttpRequest'
}
params = {
'callback': 'jQuery112404036000642410289_1546146331353'
}
print(1)
test = requests.post(url,data = data,headers=headers)
print(2)
test.encoding ='UTF-8'
r = test.status_code
print(r)
print(test.text)
html =test.content
html_doc = html.decode('utf-8','ignore')
print('html')
print(html_doc)
html_doc = html_doc.lstrip('jQuery1124039626883728769524_1546046324968(').rstrip(');')
html
print(html)
dat = json.loads(html)
print(dat)