2.0 KiB
2.0 KiB
telegram_ytdlp_node.js
Description
This bot can download music and videos from youtube.
Installation
Step 1
- Install docker (how you can install it on linux: https://fullgream.tech/knowledge-base?post=docker-install)
- Clone repository:
git clone https://git.fullgream.tech/fullgream/telegram_ytdlp_node.js.git
Step 2. If you will use MTProto API
- Go to [https://my.telegram.org/apps](Telegram API Development Tools). And create API_ID and API Hash.
- Go to
/src-tgfolder in clonned folder - Run docker container with command:
docker build -t telegram_create_session . && docker run -it --rm telegram_create_session && docker rmi telegram_create_session - Type all answers
- Write to
.envfile SESSION value and go to... (Next steps of next part from step 3)
Step 3
- Create file
cookies.txtin program directory (You can use Get cookies.txt loccaly: https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc) - Create telegram bot, get token: https://t.me/BotFather
- Edit file .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!!!)>
- Build docker container:
docker build -t ytdlp_node:release . - 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