这是很久没管的旧项目,代码质量和风格一言难尽,部分爬虫仍然可用。现计划用 fastAPI 框架搭建一个简单解析 API 服务,功能仍是简单粗糙,但用于学习或日常使用还是可以的
切换到fastapi 分支即可
-
爬虫文件详情在这里 extractor
pip3 install -r requirements.txt
python3 extract.py
可能还需要安装 nodejs
Python爬虫,返回一定格式的信息,下载,使用flask提供简易api。抖音无水印、皮皮虾、快手、网易云音乐、qq音乐、咪咕音乐、荔枝FM音频、知乎视频、最右语音、视频、微博......
License: MIT License
这是很久没管的旧项目,代码质量和风格一言难尽,部分爬虫仍然可用。现计划用 fastAPI 框架搭建一个简单解析 API 服务,功能仍是简单粗糙,但用于学习或日常使用还是可以的
切换到fastapi 分支即可
pip3 install -r requirements.txt
python3 extract.py
可能还需要安装 nodejs
It might be good to add support for live videos, the are usually just .flv files which you can see when loading the page. The url would look something like this https://live.kuaishou.com/u/LLLYYY666999
网易云音乐的接口也不能用了
我最近见到过别人的程序 这种链接可以抓到mp4地址。不知道接口是什么 ,你能搞出来吗?
链接地址是这样的: http://tx-safety-video.acfun.cn/mediacloud/acfun/acfun_video/_HqzwHV5zsUv5ikORMxxnCZ57jFEfr7yVZTsBkPY4IUoV9z7OHXzsWDBNN347awq.mp4?pkey=AAKf7uEXJLRQHesoGMG9YV0Lyj9zf45yhew8thKGBd3S8-SKGrykotFZE2SutIIytSib9pHPici_CWfopvgbKpc03Qj7IwAaN07B_eDm5JK2fOS4tN4dPqCWSqsSnLTRXilI4glJSuvwerGbtNZugdNWnwJRLpJp1wTIUDcikvT3cobxOuVBarRXjyBUj2HqQuIpSJ1HqVCl9TOYBtc5Hy9cNtyuv8A9ufeK4NfVbpGGWK-FYDiHgocQYAFI5VRSacZaqTP5vBT58CxLzQIz4bggpOPR8lQHnZLrUg4N8x6MMQ
I seems your fix that allows downloads for kuaishou has broken the desktop links again, the same error 'title': '快手,记录世界记录你'
请大神得空更新下
Traceback (most recent call last):
File "kuaishou.py", line 53, in
Rprint(get(input("url: ")))
NameError: name 'Rprint' is not defined
set back to pprint and it's perfect
皮皮虾的无法获取到链接了,博主什么时候有时间,给更新一下呗。
kuaishou gives error 404
Possible support for douyin desktop video link https://www.iesdouyin.com/share/video/6805024822687534344/?region=UK&mid
希望添加更多的视频下载spider,我很需要照着抄,多谢了
不是无损音质的
kuaishou解析的方式好像更新了,有没有要升级一下的想法?
import re
import requests
def get(url: str) -> dict:
"""
imgs、videos
"""
data = {}
headers = {
"user-agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",
"Referer": "https://www.bilibili.com/",
}
av_number_pattern = r'(BV[0-9a-zA-Z]*)'
cover_pattern = r"image: '(.*?)',"
video_pattern = r"video_url: '(.*?)',"
title_pattern = r'title":"(.*?)",'
av = re.findall(av_number_pattern, url)
if av:
av = av[0]
else:
data["msg"] = "链接可能不正确,因为我无法匹配到av号"
return data
url = f"https://www.bilibili.com/video/{av}"
with requests.get(url, headers=headers, timeout=10) as rep:
if rep.status_code == 200:
cover_url = re.findall(cover_pattern, rep.text)
if cover_url:
cover_url = cover_url[0]
if '@' in cover_url:
cover_url = cover_url[:cover_url.index('@')]
data["imgs"] = ['https:'+cover_url]
video_url = re.findall(video_pattern, rep.text)
title_text = re.findall(title_pattern, rep.text)
if video_url:
video_url = video_url[0]
data["videos"] = ['https:' + video_url.replace('upos-hz-mirrorakam.akamaized.net','upos-sz-mirrorkodo.bilivideo.com')]
if title_text:
data["videoName"] = title_text[0]
else:
data["msg"] = "获取失败"
return data
if __name__ == "__main__":
print(get(input("url: ")))
Sorry I am a little confused, when I run the extract.py, it lists all the mp4's but does not download, how to make it download like this? https://camo.githubusercontent.com/f9dc47c16f860c6b311fcf4cbf71e8f89621595c/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f786979616f776f6e672f737069646572732f73637265656e73686f742f72756e2e676966
想要bilibili 1080 的原生mp4 接口。
如题,本人不会将代码用于商业用途,会注明来源
The douyin.py produces all the valid information and video + audio The video link cannot be downloaded
Your corrections fixed the v.kuaishou link, however it did not fix desktop links. With desktop links it is much easier to batch download. Here is an example desktop link
https://live.kuaishou.com/u/3x5tr2y938qzhx2/3xbt26hzgwwguaa
If you run the desktop link in a mobile browser, it has the removed watermark the same as the v.kuaishou link
第一次获取微博视频可以,之后就不可以了
按照流程先来三连.
楼主牛批,楼主牛批,楼主牛批!
希望能添加西瓜视频的,好像也是支持无水印的!
蓬佩奥“双标”!呼吁中方释放加拿大嫌犯,赵立坚:有何颜面资格@主持人 崔小花 https://v.douyin.com/J8B76ts/ 复制此链接,打开【抖音短视频】,直接观看视频!
最后的结果
{'msg': 'failed...'}
failed...
我想弄一个自动化,想问下怎么自动根据关键字爬取短视频链接,然后下载下来
我有个邪恶的想法,把这个库的python代码移植到android中,直接用安卓手机直接就能使用。博主支持不?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.