梨视频解析
侧边栏壁纸
  • 累计撰写 35 篇文章
  • 累计收到 10 条评论

梨视频解析

admin
2021-10-04 / 0 评论 / 196 阅读 / 正在检测是否收录...
import requests
url = input("输入梨视频网址:")
#url = "https://www.pearvideo.com/video_1743115"
countId = url.split("_")[1]
headers = {
    "Referer": url,
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Edg/94.0.992.38"
}
requesturl = f"https://www.pearvideo.com/videoStatus.jsp?contId={countId}&mrd=0.4108455213337001"
resp = requests.get(requesturl, headers=headers)
dic = resp.json()
scrurl = dic['videoInfo']['videos']['srcUrl']
systime = dic['systemTime']
newurl = scrurl.replace(systime, f"cont-{countId}")
with open("a.mp4", mode="wb") as f:
    f.write(requests.get(newurl).content)
print("over")

自己边看边学的

1

评论 (0)

取消