Compare commits
4 Commits
f0c77bed3c
...
67190761e5
| Author | SHA1 | Date | |
|---|---|---|---|
| 67190761e5 | |||
| d5ea81ee9b | |||
| f90e4f1827 | |||
| 04edf580e7 |
13
Dockerfile
13
Dockerfile
@ -1 +1,14 @@
|
|||||||
|
FROM node:20.8.1
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./src/ .
|
||||||
|
RUN npm install
|
||||||
|
COPY ./cookies.txt ./cookies.txt
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y ffmpeg curl && \
|
||||||
|
curl -L https://github.com/yt-dlp/yt-dlp/releases/download/2025.09.23/yt-dlp -o /usr/local/bin/yt-dlp && \
|
||||||
|
chmod +x /usr/local/bin/yt-dlp && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENTRYPOINT ["node", "bot.js"]
|
||||||
|
|||||||
19
README.md
19
README.md
@ -1,2 +1,19 @@
|
|||||||
# telegram_ytdlp_node.js
|
# telegram_ytdlp_node.js
|
||||||
|
## Description
|
||||||
|
This bot can download music and videos from youtube.
|
||||||
|
## Installation
|
||||||
|
### Docker
|
||||||
|
1) Install docker (how you can install it on linux: https://fullgream.tech/knowledge-base?post=docker-install)
|
||||||
|
2) Clone repository: `git clone https://git.fullgream.tech/fullgream/telegram_ytdlp_node.js.git`
|
||||||
|
3) Create file `cookies.txt` in program directory *(You can use **Get cookies.txt loccaly**: https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)*
|
||||||
|
4) Create telegram bot, get token: https://t.me/BotFather
|
||||||
|
5) Edit file .env
|
||||||
|
```env
|
||||||
|
BOT_TOKEN=<YOUR_TELEGRAM_BOT_TOKEN>
|
||||||
|
ADMIN_LIST=<Admin ID list, separate ", "> (example: 123,321, 678, 911 , 228)
|
||||||
|
WHITELIST=<User list, separate ", " (Important: Admin list will add to whitelist automatly)> (example: 123,321, 678, 911 , 228)
|
||||||
|
```
|
||||||
|
6) Build docker container:
|
||||||
|
`docker build -t ytdlp_node:release .`
|
||||||
|
7) Up docker container:
|
||||||
|
`docker run -d --restart unless-stopped --env-file .env ytdlp_node:release`
|
||||||
|
|||||||
@ -35,7 +35,7 @@ config.whitelist = Object.keys(
|
|||||||
console.info(config);
|
console.info(config);
|
||||||
if (!process.env.BOT_TOKEN) {
|
if (!process.env.BOT_TOKEN) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"BOT_TOKEN not defined. Please, run docker container: docker run <params> <container> --env-file .env",
|
"BOT_TOKEN not defined. Please, run docker container: docker run --env-file .env <params> <container>",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user