telegram_ytdlp_node.js/README.md
2025-11-09 16:00:42 +03:00

58 lines
3.4 KiB
Markdown

# telegram_ytdlp_node.js
## ⚠️ WARNING!!!
The **telegram_ytdlp_node.js** bot project will no longer be actively maintained in its open-source version. This means that new commits and bug fixes in the public repository are **unlikely**, although not completely impossible.
In the future, a link to the running bot and the project roadmap will be shared. **The source code will no longer be publicly available**.
Thank you to everyone who used and supported the project in its open-source form. Your feedback and contributions have been greatly appreciated.
## Description
This bot can download music and videos from youtube.
## License
This software is available under AGPLv3 for open-source use.
For commercial use, please contact fullgream@i2pmail.org for a commercial license.
## Installation
### Step 1
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`
### Step 2. If you will use MTProto API
1) Go to [Telegram API Development Tools](https://my.telegram.org/apps). And create API_ID and API Hash.
2) Go to `/src-tg` folder in clonned folder
3) Run docker container with command: `docker build -t telegram_create_session . && docker run -it --rm telegram_create_session && docker rmi telegram_create_session`
4) Type all answers
5) Write to `.env` file SESSION value and go to `..`. (Next steps of next part from step 3)
### Step 3
1) Create file `cookies.txt` in program directory *(You can use **Get cookies.txt loccaly**: https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)*
2) Create telegram bot, get token: https://t.me/BotFather
3) 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)
API_ID=<If you use MTProto API. Type here API_ID from Telegram API Development Tools>
API_HASH=<If you use MTProto API. Type here API_HASH from Telegram API Development Tools>
API_SESSION=<If you use MTProto API. Type here API_SESSION from Session get script (Step 2)>
CHAT_ID=<If you use MTProto API. ID of chat. You can send new message and chat and use command: curl -s "https://api.telegram.org/bot$BOT_TOKEN/getUpdates" (REPLACE '$BOT_TOKEN' to Your Bot token!!!)>
EMPTY_IMAGE_URL=<URL to empty preview image (for default using: https://placekitten.com/500/350)>
```
4) Build docker container: `docker build -t ytdlp_node:release .`
5) Up docker container: `docker run -d --name ytdlp_node --restart unless-stopped --env-file .env -v "$(pwd)/cookies.txt:/app/cookies.txt" ytdlp_node:release`
### How unlock videos with age restriction?
1) Install browser extension wich can replace your User-Agent *(for example: https://chromewebstore.google.com/detail/user-agent-switcher-and-m/bhchdcejhohfmigjafbampogmaanbfkg)*
2) Set permission of incognito mode for browser extension
3) Setup user-agent in browser extension: `Mozilla/5.0 (Windows NT 10.0; Win64; x64)`
4) **If you use Get cookies.txt loccaly** - Set permission of incognito mode
5) Go to new incognito window and go to youtube
6) LogIn in youtube and go to another video
7) Copy your cookies
8) Close incognito window and you can remove user-agent in browser extension
9) Paste cookies in file cookies.txt