Skip to content

Commit

Permalink
docs: 在线文档support & 知识付费栏目汇聚
Browse files Browse the repository at this point in the history
  • Loading branch information
NanmiCoder committed Sep 19, 2024
1 parent f8881db commit d256337
Show file tree
Hide file tree
Showing 34 changed files with 2,913 additions and 117 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
#
name: Deploy VitePress site to Pages

on:
# 在针对 `main` 分支的推送上运行。如果你
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
push:
branches: [main]

# 允许你从 Actions 选项卡手动运行此工作流程
workflow_dispatch:

# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
concurrency:
group: pages
cancel-in-progress: false

jobs:
# 构建工作
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # 或 pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # 或 pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# 部署工作
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,6 @@ cython_debug/
/data/

*/.DS_Store
.vscode
.vscode
/node_modules
docs/.vitepress/cache
113 changes: 16 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,73 +36,18 @@ MediaCrawler仓库白金赞助商:
| 知乎 ||||||||


## 使用方法

### 创建并激活 python 虚拟环境
```shell
# 进入项目根目录
cd MediaCrawler

# 创建虚拟环境
# 我的python版本是:3.9.6,requirements.txt中的库是基于这个版本的,如果是其他python版本,可能requirements.txt中的库不兼容,自行解决一下。
python -m venv venv

# macos & linux 激活虚拟环境
source venv/bin/activate

# windows 激活虚拟环境
venv\Scripts\activate

```

### 安装依赖库

```shell
pip install -r requirements.txt
```

### 安装 playwright浏览器驱动

```shell
playwright install
```

### 运行爬虫程序

```shell
### 项目默认是没有开启评论爬取模式,如需评论请在config/base_config.py中的 ENABLE_GET_COMMENTS 变量修改
### 一些其他支持项,也可以在config/base_config.py查看功能,写的有中文注释
# 从配置文件中读取关键词搜索相关的帖子并爬取帖子信息与评论
python main.py --platform xhs --lt qrcode --type search
# 从配置文件中读取指定的帖子ID列表获取指定帖子的信息与评论信息
python main.py --platform xhs --lt qrcode --type detail
# 打开对应APP扫二维码登录
# 其他平台爬虫使用示例,执行下面的命令查看
python main.py --help
```

### 数据保存
- 支持关系型数据库Mysql中保存(需要提前创建数据库)
- 执行 `python db.py` 初始化数据库数据库表结构(只在首次执行)
- 支持保存到csv中(data/目录下)
- 支持保存到json中(data/目录下)


## 开发者服务
- MediaCrawler视频课程:
> 视频课程介绍飞书文档链接:https://relakkes.feishu.cn/wiki/JUgBwdhIeiSbAwkFCLkciHdAnhh
> 如果你想很快入门这个项目,或者想了具体实现原理,我推荐你看看这个视频课程,从设计出发一步步带你如何使用,门槛大大降低
>
> 同时也是对我开源的支持,如果你能支持我的课程,我将会非常开心~<br>
- MediaCrawler源码剖析课程:
- **抖音课程链接**(仅支持安卓):https://v.douyin.com/iYeQFyAf/
- **B站课程链接**https://www.bilibili.com/cheese/play/ss16569

(备注:视频课程介绍飞书文档链接:https://relakkes.feishu.cn/wiki/JUgBwdhIeiSbAwkFCLkciHdAnhh (如果你想很快入门这个项目,或者想了具体实现原理,我推荐你看看这个视频课程,从设计出发一步步带你如何使用,门槛大大降低))
<br>
<br>


- 知识星球:MediaCrawler相关问题最佳实践、爬虫逆向分享、爬虫项目实战、多年编程经验分享、爬虫编程技术问题提问。
<p>
<img alt="xingqiu" src="static/images/星球qrcode.JPG" style="width: auto;height: 400px" >
<img alt="xingqiu" src="docs/static/images/星球qrcode.JPG" style="width: auto;height: 400px" >
</p>

星球精选文章(部分):
Expand All @@ -114,58 +59,33 @@ MediaCrawler仓库白金赞助商:
- [【独创】使用Playwright低成本获取某书X-s参数流程分析(当年的回忆录)](https://articles.zsxq.com/id_u4lcrvqakuc7.html)
- [ MediaCrawler-基于抽象类设计重构项目缓存](https://articles.zsxq.com/id_4ju73oxewt9j.html)
- [ 手把手带你撸一个自己的IP代理池](https://articles.zsxq.com/id_38fza371ladm.html)
- [Python协程在并发场景下的幂等性问题](https://articles.zsxq.com/id_wocdwsfmfcmp.html)
- [错误使用 Python 可变类型带来的隐藏 Bug](https://articles.zsxq.com/id_f7vn89l1d303.html)

## MediaCrawler使用教程文档
[MediaCrawler在线文档](https://nanmicoder.github.io/MediaCrawler/)



## 感谢下列Sponsors对本仓库赞助
- <a href="https://mangoproxy.com/?utm_source=mediacrawler&utm_medium=repository&utm_campaign=default">【MangoProxy】全球IP代理白金推荐,支持210+国家 [MangoProxy](https://mangoproxy.com/?utm_source=mediacrawler&utm_medium=repository&utm_campaign=default) </a>
- <a href="https://sider.ai/ad-land-redirect?source=github&p1=mi&p2=kk">【Sider】全网最火的ChatGPT插件,我也免费薅羊毛用了快一年了,体验拉满。</a>

成为赞助者,可以将您产品展示在这里,每天获得大量曝光,联系作者微信:yzglan

## MediaCrawler爬虫项目交流群:
<div id="join_wechat_group">

> 备注github,会有拉群小助手自动拉你进群。 如果图片展示不出来或过期,可以直接添加我的微信号:yzglan,并备注github,会有拉群小助手自动拉你进

<div style="max-width: 200px">
<p><img alt="直接添加我的微信号:yzglan" src="static/images/relakkes_weichat.JPG" style="width: 200px;height: 100%" ></p>
</div>
</div>


## 打赏

如果觉得项目不错的话可以打赏哦。您的支持就是我最大的动力!

打赏时您可以备注名称,我会将您添加至打赏列表中。
<p>
<img alt="打赏-微信" src="static/images/wechat_pay.jpeg" style="width: 200px;margin-right: 140px;" />
<img alt="打赏-支付宝" src="static/images/zfb_pay.png" style="width: 200px" />
<img alt="打赏-微信" src="docs/static/images/wechat_pay.jpeg" style="width: 200px;margin-right: 140px;" />
<img alt="打赏-支付宝" src="docs/static/images/zfb_pay.png" style="width: 200px" />
</p>

查看打赏列表 [点击跳转](#donate)


## 运行报错常见问题Q&A
> 遇到问题先自行搜索解决下,现在AI很火,用ChatGPT大多情况下能解决你的问题 [免费的ChatGPT](https://sider.ai/ad-land-redirect?source=github&p1=mi&p2=kk)

➡️➡️➡️ [常见问题](docs/常见问题.md)

dy和xhs使用Playwright登录现在会出现滑块验证 + 短信验证,手动过一下

## 项目代码结构
➡️➡️➡️ [项目代码结构说明](docs/项目代码结构.md)

## 代理IP使用说明
➡️➡️➡️ [代理IP使用说明](docs/代理使用.md)

## 词云图相关操作说明
➡️➡️➡️ [词云图相关说明](docs/关于词云图相关操作.md)

## 手机号登录说明
➡️➡️➡️ [手机号登录说明](docs/手机号登录说明.md)


## 爬虫入门课程
我新开的爬虫教程Github仓库 [CrawlerTutorial](https://github.com/NanmiCoder/CrawlerTutorial) ,感兴趣的朋友可以关注一下,持续更新,主打一个免费.

Expand All @@ -176,7 +96,6 @@ dy和xhs使用Playwright登录现在会出现滑块验证 + 短信验证,手
[![Star History Chart](https://api.star-history.com/svg?repos=NanmiCoder/MediaCrawler&type=Date)](https://star-history.com/#NanmiCoder/MediaCrawler&Date)



## 参考

- xhs客户端 [ReaJason的xhs仓库](https://github.com/ReaJason/xhs)
Expand Down
65 changes: 65 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import {defineConfig} from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "MediaCrawler自媒体爬虫",
description: "小红书爬虫,抖音爬虫, 快手爬虫, B站爬虫, 微博爬虫,百度贴吧爬虫,知乎爬虫...。 ",
lastUpdated: true,
themeConfig: {
editLink: {
pattern: 'https://github.com/NanmiCoder/MediaCrawler/tree/main/docs/:path'
},
// https://vitepress.dev/reference/default-theme-config
nav: [
{text: '首页', link: '/'},
{text: '联系我', link: '/作者介绍'},
{text: '支持我', link: '/知识付费介绍'},
],

sidebar: [
{
text: '作者介绍',
link: '/作者介绍',
},
{
text: 'MediaCrawler使用文档',
items: [
{text: '基本使用', link: '/'},
{text: '常见问题汇总', link: '/常见问题'},
{text: 'IP代理使用', link: '/代理使用'},
{text: '词云图使用', link: '/词云图使用配置'},
{text: '项目目录结构', link: '/项目代码结构'},
{text: '手机号登录说明', link: '/手机号登录说明'},
]
},
{
text: '知识付费',
items: [
{text: '知识付费介绍', link: '/知识付费介绍'},
{text: 'MediaCrawlerPro订阅', link: '/mediacrawlerpro订阅'},
{
text: 'MediaCrawler源码剖析课',
link: 'https://relakkes.feishu.cn/wiki/JUgBwdhIeiSbAwkFCLkciHdAnhh'
},
{text: '知识星球文章专栏', link: '/知识星球介绍'},
{text: '开发者咨询服务', link: '/开发者咨询'},
]
},
{
text: 'MediaCrawler项目交流群',
link: '/作者介绍',
},
{
text: '爬虫入门教程分享',
items: [
{text: "我写的爬虫入门教程", link: 'https://github.com/NanmiCoder/CrawlerTutorial'}
]
},

],

socialLinks: [
{icon: 'github', link: 'https://github.com/NanmiCoder/MediaCrawler'}
]
}
})
61 changes: 61 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# MediaCrawler使用方法
## 免责声明
> **免责声明:**
>
> 大家请以学习为目的使用本仓库,爬虫违法违规的案件:https://github.com/HiddenStrawberry/Crawler_Illegal_Cases_In_China <br>
>
>本项目的所有内容仅供学习和参考之用,禁止用于商业用途。任何人或组织不得将本仓库的内容用于非法用途或侵犯他人合法权益。本仓库所涉及的爬虫技术仅用于学习和研究,不得用于对其他平台进行大规模爬虫或其他非法行为。对于因使用本仓库内容而引起的任何法律责任,本仓库不承担任何责任。使用本仓库的内容即表示您同意本免责声明的所有条款和条件。

## 创建并激活 python 虚拟环境
```shell
# 进入项目根目录
cd MediaCrawler

# 创建虚拟环境
# 我的python版本是:3.9.6,requirements.txt中的库是基于这个版本的,如果是其他python版本,可能requirements.txt中的库不兼容,自行解决一下。
python -m venv venv

# macos & linux 激活虚拟环境
source venv/bin/activate

# windows 激活虚拟环境
venv\Scripts\activate

```

## 安装依赖库

```shell
pip install -r requirements.txt
```

## 安装 playwright浏览器驱动

```shell
playwright install
```

## 运行爬虫程序

```shell
### 项目默认是没有开启评论爬取模式,如需评论请在config/base_config.py中的 ENABLE_GET_COMMENTS 变量修改
### 一些其他支持项,也可以在config/base_config.py查看功能,写的有中文注释
# 从配置文件中读取关键词搜索相关的帖子并爬取帖子信息与评论
python main.py --platform xhs --lt qrcode --type search
# 从配置文件中读取指定的帖子ID列表获取指定帖子的信息与评论信息
python main.py --platform xhs --lt qrcode --type detail
# 打开对应APP扫二维码登录
# 其他平台爬虫使用示例,执行下面的命令查看
python main.py --help
```

## 数据保存
- 支持关系型数据库Mysql中保存(需要提前创建数据库)
- 执行 `python db.py` 初始化数据库数据库表结构(只在首次执行)
- 支持保存到csv中(data/目录下)
- 支持保存到json中(data/目录下)
Loading

0 comments on commit d256337

Please sign in to comment.