import re
import requests
import time
import json
import os
from pprint import pprint
def get(url: str) -> dict:
"""
title、imgs、videos
"""
data = {
}
failed = {
'msg': 'failed...'}
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",
"Cookie": "did=web_68e0268146694843a92700d2de49a0a6;"
}
# rewrite desktop url
temp = re.findall(r'live\.kuaishou\.com/u/\w+/(\w+)', url)
if temp:
url = 'https://c.kuaishou.com/fw/photo/{}'.format(temp[0])
rep = requests.get(url, headers=headers, timeout=10)
if rep.status_code != 200:
return failed
page_data = re.findall(r'
python爬取快手视频并批量下载
最新推荐文章于 2024-09-05 10:57:01 发布
这篇博客介绍如何利用Python爬虫技术,从一个包含快手视频URL的txt文件中读取链接,并实现批量下载这些视频。涉及到的步骤包括解析URL、设置下载路径、处理短视频平台的反爬策略等。
摘要由CSDN通过智能技术生成