推特 图片 & 视频 & 文本 下载,以用户名为参数,爬取该用户推文中的图片与视频(含gif)
支持排除转推内容 & 多用户爬取 & 时间范围限制 & 按Tag获取 & 纯文本获取 & 高级搜索 & 评论区下载
EN
This project is strictly for programming learning, academic research, and personal practice.
The intellectual property of all media content (images, videos, etc.) downloaded using this tool belongs to the original authors and the respective platforms. Please respect relevant copyrights.
Users must comply with applicable laws, the target platform's Terms of Service, and relevant copyright regulations. Do not use this tool for malicious scraping, copyright infringement, illegal distribution, or other unlawful activities.
The developer assumes no responsibility for any violations, legal disputes, or direct/indirect losses caused by the improper use of this tool. Use at your own risk.
ZH
本项目仅供编程学习交流、学术研究及个人练习使用。
使用本工具下载的所有媒体内容(图片、视频等)的知识产权均归原作者及所属平台所有,请尊重相关版权。
请勿将本工具及所获取的数据用于恶意抓取、侵权传播或其他违法用途。
开发者不对任何因不当使用本工具而导致的违规行为、法律纠纷或直接/间接损失承担责任。请风险自担。
目前老马加了API的请求次数限制
当程序抛出:Rate limit exceeded
即表示该账号当日的API调用次数已耗尽
if 选择包含转推:
爬完一个用户需要调用的API次数约为:总推数(含转推) / 19
elif 不包含:
会大大减少API调用次数
下载不计入次数
2025-08-09
2025-04-26
tag_down reply_down增加X-Client-Transaction-ID校验, 请重新运行pip install -r requirements.txt安装依赖transaction-id仍有小概率失效, 当程序抛出获取数据失败时可以尝试重新运行main text_down似乎未受X-Client-Transaction-ID校验影响https://github.com/iSarabjitDhiman/XClientTransaction2025-03-03
2024-05-24
2024-05-11
支持获取纯文本推文--请直接配置text_down.py文件并运行
// (下方有预览) 注意,此功能会大量消耗API次数(参考上方公式),默认排除转推内容
2024-05-10
支持按Tag获取--请直接配置tag_down.py文件并运行
// 保存格式 (下方有预览):. / {#Tag} / {datetime} _ {@username} _ { md5( media_url )[:4] } . { png / mp4 }
2024-03-09
2024-01-16
2024-01-10
2024-01-05
2023-12-12
2023-10-12
2023-10-06
2023-09-15
| (๑´ڡ`๑) |
Linux :
git clone https://github.com/caolvchong-top/twitter_download.git
cd twitter_download
pip3 install -r requirements.txt
#Python版本须>=3.8 httpx==0.28.1
运行 :
配置settings.json文件
python3 main.py
Windows 和上面的一样,配置完setting.json后运行main.py即可
按Tag下载&高级搜索 --> tag_down.py
下载评论区 --> reply_down.py
指定用户纯文本推文获取 --> text_down.py
指定用户媒体文件获取&转推&亮点&喜欢(只能本人账号)等 --> main.py + settings.json
其余各种不能解决的需求建议试试tag_down的高级搜索, 或是提交Issue
其实按功能应该叫search_down
对于部分主程序难以实现的需求可以尝试配置tag_down.py的filter来曲线解决:
| 部分例子 |
|---|
| 大批量下载 -> 分批下载 |
| 指定时间范围 |
| 各类关键词搜索/排除 |
| 指定/排除目标用户 |
| 指定大于互动量的推文 |
| 指定推文语言 |
| ...... |
// 配置
tag = '#ヨルクラ'
# 填入tag 带上#号 可留空
_filter = ""
# (可选项) 高级搜索
# 请在 https://x.com/search-advanced 中组装搜索条件,复制搜索栏的内容填入_filter
# 注意,_filter中所有出现的双引号都需要改为单引号或添加转义符 例如 "Monika" -> 'Monika'
# 当tag选项留空时,将尝试以_filter的内容作为文件夹名称
推特高级搜索:https://x.com/search-advanced
实例参考:https://github.com/caolvchong-top/twitter_download/issues/63#issuecomment-2351039320 & https://github.com/caolvchong-top/twitter_download/issues/106
↑↑老版本的图,仅效果参考
评论区下载 Reply_down.py
按Tag获取 Tag_down.py
纯文本推文获取(仅文本) Text_down.py
图片下载效果
视频下载效果
生成CSV统计
269 followers · starred Apr 2025
10 followers · starred Dec 2024
推特 图片 & 视频 & 文本 下载,以用户名为参数,爬取该用户推文中的图片与视频(含gif)
支持排除转推内容 & 多用户爬取 & 时间范围限制 & 按Tag获取 & 纯文本获取 & 高级搜索 & 评论区下载
EN
This project is strictly for programming learning, academic research, and personal practice.
The intellectual property of all media content (images, videos, etc.) downloaded using this tool belongs to the original authors and the respective platforms. Please respect relevant copyrights.
Users must comply with applicable laws, the target platform's Terms of Service, and relevant copyright regulations. Do not use this tool for malicious scraping, copyright infringement, illegal distribution, or other unlawful activities.
The developer assumes no responsibility for any violations, legal disputes, or direct/indirect losses caused by the improper use of this tool. Use at your own risk.
ZH
本项目仅供编程学习交流、学术研究及个人练习使用。
使用本工具下载的所有媒体内容(图片、视频等)的知识产权均归原作者及所属平台所有,请尊重相关版权。
请勿将本工具及所获取的数据用于恶意抓取、侵权传播或其他违法用途。
开发者不对任何因不当使用本工具而导致的违规行为、法律纠纷或直接/间接损失承担责任。请风险自担。
目前老马加了API的请求次数限制
当程序抛出:Rate limit exceeded
即表示该账号当日的API调用次数已耗尽
if 选择包含转推:
爬完一个用户需要调用的API次数约为:总推数(含转推) / 19
elif 不包含:
会大大减少API调用次数
下载不计入次数
2025-08-09
2025-04-26
tag_down reply_down增加X-Client-Transaction-ID校验, 请重新运行pip install -r requirements.txt安装依赖transaction-id仍有小概率失效, 当程序抛出获取数据失败时可以尝试重新运行main text_down似乎未受X-Client-Transaction-ID校验影响https://github.com/iSarabjitDhiman/XClientTransaction2025-03-03
2024-05-24
2024-05-11
支持获取纯文本推文--请直接配置text_down.py文件并运行
// (下方有预览) 注意,此功能会大量消耗API次数(参考上方公式),默认排除转推内容
2024-05-10
支持按Tag获取--请直接配置tag_down.py文件并运行
// 保存格式 (下方有预览):. / {#Tag} / {datetime} _ {@username} _ { md5( media_url )[:4] } . { png / mp4 }
2024-03-09
2024-01-16
2024-01-10
2024-01-05
2023-12-12
2023-10-12
2023-10-06
2023-09-15
| (๑´ڡ`๑) |
Linux :
git clone https://github.com/caolvchong-top/twitter_download.git
cd twitter_download
pip3 install -r requirements.txt
#Python版本须>=3.8 httpx==0.28.1
运行 :
配置settings.json文件
python3 main.py
Windows 和上面的一样,配置完setting.json后运行main.py即可
按Tag下载&高级搜索 --> tag_down.py
下载评论区 --> reply_down.py
指定用户纯文本推文获取 --> text_down.py
指定用户媒体文件获取&转推&亮点&喜欢(只能本人账号)等 --> main.py + settings.json
其余各种不能解决的需求建议试试tag_down的高级搜索, 或是提交Issue
其实按功能应该叫search_down
对于部分主程序难以实现的需求可以尝试配置tag_down.py的filter来曲线解决:
| 部分例子 |
|---|
| 大批量下载 -> 分批下载 |
| 指定时间范围 |
| 各类关键词搜索/排除 |
| 指定/排除目标用户 |
| 指定大于互动量的推文 |
| 指定推文语言 |
| ...... |
// 配置
tag = '#ヨルクラ'
# 填入tag 带上#号 可留空
_filter = ""
# (可选项) 高级搜索
# 请在 https://x.com/search-advanced 中组装搜索条件,复制搜索栏的内容填入_filter
# 注意,_filter中所有出现的双引号都需要改为单引号或添加转义符 例如 "Monika" -> 'Monika'
# 当tag选项留空时,将尝试以_filter的内容作为文件夹名称
推特高级搜索:https://x.com/search-advanced
实例参考:https://github.com/caolvchong-top/twitter_download/issues/63#issuecomment-2351039320 & https://github.com/caolvchong-top/twitter_download/issues/106
↑↑老版本的图,仅效果参考
评论区下载 Reply_down.py
按Tag获取 Tag_down.py
纯文本推文获取(仅文本) Text_down.py
图片下载效果
视频下载效果
生成CSV统计
269 followers · starred Apr 2025
10 followers · starred Dec 2024