# Technical Documentation: tgbot-collection/YYeTsBot

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/tgbot-collection/YYeTsBot)

### Overview (`README.md`)

[[# YYeTsBot

[](https://github.com/tgbot-collection/YYeTsBot/actions/workflows/docker.yaml)
[](https://hub.docker.com/r/bennythink/yyetsbot)

## 在线使用

- 网站：https://yyets.click
- Telegram Bot：https://t.me/mikuri520
- Telegram Channel：https://t.me/yyets_bot

**本站通过广告和联盟推广维持服务器与维护成本，部分内容可能包含对应链接。**

## 功能

- 支持影视资源搜索
- 支持网友分享链接
- 支持收藏
- 支持评论与失效资源标记
- 支持 Telegram Bot
- 支持 Docker 自部署

# 截图



## bot



## 资源分享站截图

本网站永久免费，并且没有任何限制。




支持收藏功能，会跨设备同步


# 前端

👉 前端[在这里](https://github.com/tgbot-collection/YYeTsFE) 👈

# 支持作者

如果这个项目帮到了你，可以考虑支持作者：

* 点一个star 和fork
* 宣传、使用
* 收藏[我的博客](https://dmesg.app/)
* 加入 [Telegram Channel](https://t.me/mikuri520)
* [给我买杯咖啡？](https://www.buymeacoffee.com/bennythink)
* [GitHub Sponsor](https://github.com/sponsors/BennyThink)
* [Stripe 支持支付宝](https://buy.stripe.com/dR67vU4p13Ox73a6oq)

 <img src="./assets/CNY.png" width = 30%  alt="stripe"  />

## 免责声明

本项目仅用于技术学习和信息索引，不存储、不上传、不分发任何视频文件。
评论中的链接由用户自行发布，项目作者不对第三方内容负责。
如有侵权，请联系删除。

# License

[MIT](LICENSE)

---

### Overview (`yyetsweb/README.md`)

# web端

**注意：源代码中包含Google Analytics分析代码，`index.html`, `search.html`和`resource.html`。如果自己使用，要记得去除哦**

# requirements

* tornado
* mongodb
* pymongo

# 导入数据

从 [这里](https://yyets.click/database) 下载mongodb数据，然后导入

```shell
mongorestore --gzip --archive=yyets_mongo.gz --nsFrom "share.*" --nsTo "zimuzu.*"
```

# 运行

`python server.py`

# Docker

参考[这里](https://github.com/BennyThink/WebsiteRunner)

# MongoDB index

```shell
use zimuzu;

db.getCollection('yyets').createIndex({"data.info.id": 1});
db.getCollection('yyets').createIndex({"data.info.views" : -1});
db.getCollection('yyets').createIndex({"data.info.area" : 1});
db.getCollection('yyets').getIndexes();

db.getCollection('douban').createIndex({"resourceId" : 1});
db.getCollection('douban').getIndexes();

db.getCollection('users').createIndex({"username" : 1}, { unique: true });
db.getCollection('users').createIndex(
   { "email.address": 1 },
   { unique: true, partialFilterExpression: { "email.address": { $exists: true } } }
)
db.getCollection('users').getIndexes();

db.getCollection('comment').createIndex({"resource_id" : 1});
db.getCollection('comment').getIndexes();

db.getCollection('reactions').createIndex({"comment_id" : 1});
db.getCollection('reactions').getIndexes();

db.getCollection('metrics').createIndex({"date" : 1});
db.getCollection('metrics').getIndexes();

db.getCollection('notification').createIndex({"username" : 1});
db.getCollection('notification').getIndexes();

```

---

### Overview (`yyets/BagAndDrag/README.md`)

# BagAndDrag
Bag and Drag

[original repo](https://github.com/tgbot-collection/BagAndDrag)

打包带走:-)

---

### Overview (`yyets/worker/README.md`)

# Cloudflare Worker部署方式
**This worker is deprecated. No further updates from now on.**

## 1. 安装wrangler等工具
[Cloudflare Docs](https://developers.cloudflare.com/workers/cli-wrangler)
## 2. 导入数据到MySQL

## 3. 生成KV数据
参考 `BagAndDrag/cfkv.py`

## 4. 导入数据
```shell
cd kv_data
bash bulk.sh
```
**注意，Cloudflare KV免费版有每日1000条写入的限制**

## 4. 配置代码
* 修改`worker/public/js/search.js`中的`baseURL`为你的URL
* 如绑定自定义域名，还需要修改`worker/workers-site/index.js`中的`Access-Control-Allow-Origin`为你的域名

## 5.  发布到Worker Site
配置 `wrangler.toml`，修改`account_id`, `kv_namespaces`等，然后：
```shell
wrangler publish
```
就可以了。

---

--- METRICS ---
- Files Extracted: 4
- Estimated Token Budget: ~845 tokens
- Canonical Reference: https://codewiki.google/github.com/tgbot-collection/YYeTsBot
