xiyaowong / spiders

Python爬虫,返回一定格式的信息,下载,使用flask提供简易api。抖音无水印、皮皮虾、快手、网易云音乐、qq音乐、咪咕音乐、荔枝FM音频、知乎视频、最右语音、视频、微博......
MIT License
627 stars 209 forks source link

皮皮虾的不行了 #26

Closed yangfeng1994 closed 4 years ago

yangfeng1994 commented 4 years ago

皮皮虾的无法获取到链接了,博主什么时候有时间,给更新一下呗。

yangfeng1994 commented 4 years ago

皮皮虾的,我这边给修复了,可以下载视频了。代码我贴上去一下

author: wongxy

--------------

https://h5.pipix.com/item/**

import re import requests

def get(url: str) -> dict: """ title、audios """ data = {} headers = { "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25" } item_id = re.findall(r"item/(\d+)", requests.get(url=url).url) if not item_id: return {"msg": "获取失败"} item_id = item_id[0] info_url = f"https://h5.pipix.com/bds/webapi/item/detail/?item_id={item_id}&source=share" with requests.get(info_url, headers=headers, timeout=10) as rep: if rep.status_code != 200 or rep.json().get("status_code") != 0: return {"msg": "获取失败"} info = rep.json()["data"]["item"] data["title"] = info["share"]["title"]

data["audios"] = [info["origin_video_download"]["url_list"][0]["url"]]

    videoUrl = [info["video"]["video_download"]["url_list"][0]["url"]]
    if videoUrl is None or len(videoUrl) == 0:
        videoUrl = [info["video"]["video_download"]["url_list"][1]["url"]]
    data["videos"] = videoUrl

return data

if name == "main": print(get(input("url: ")))

xiyaowong commented 4 years ago

皮皮虾网页播放已经没有无水印的接口了