-
-
Notifications
You must be signed in to change notification settings - Fork 37
Setup
Can Kurt edited this page Jun 16, 2024
·
2 revisions
- Get a telegram bot key.
- (optional) Get a youtube api key. See search command
- Install Docker. docker docs
sudo apt update
sudo apt install docker.io -y
- Run the container with your bot key. telegram_youtube_downloader docker image
sudo docker run -d --name telegram_youtube_downloader --restart unless-stopped -e TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY> cccaaannn/telegram_youtube_downloader:latest
Optional flags
- To run bot with search feature
-e YOUTUBE_API_KEY=<YOUTUBE_API_KEY>
- Mapping config folder to a volume for setting custom configurations.
-v /home/can/configs:/telegram_youtube_downloader/telegram_youtube_downloader/configs
- Mapping logs to a volume.
-v /home/can/logs:/telegram_youtube_downloader/logs
- Example with all flags
sudo docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY> \
-e YOUTUBE_API_KEY=<YOUTUBE_API_KEY> \
-v <YOUR_CONFIGS_PATH>/configs:/telegram_youtube_downloader/telegram_youtube_downloader/configs \
-v <YOUR_LOGS_PATH>/logs:/telegram_youtube_downloader/logs \
cccaaannn/telegram_youtube_downloader:latest
- Tested with
Ubuntu 24
-Python 3.12
- Install ffmpeg
sudo apt update
sudo apt upgrade -y
sudo apt install ffmpeg -y
- Install python and virtualenv
sudo apt install python3 -y
sudo apt install python3-pip -y
sudo apt install python3-virtualenv -y
- Add your bot key to environment. Also check the alternative ways to pass keys.
export TELEGRAM_BOT_KEY=<TELEGRAM_BOT_KEY>
source ~/.bashrc
- (optional) To run bot with search feature
export YOUTUBE_API_KEY=<YOUTUBE_API_KEY>
source ~/.bashrc
- Install the repository and run the bot
# Install repository
git clone https://github.com/cccaaannn/telegram_youtube_downloader.git
cd telegram_youtube_downloader
# Create virtualenv
virtualenv venv
source venv/bin/activate
# Install requirements
pip install -r requirements.txt
# Run
python telegram_youtube_downloader
- Tested with
Windows 10
-Python 3.12
- Download ffmpeg from ffmpeg.org.
- Add
ffmpeg
to path, or add the binary path totelegram_youtube_downloader\configs\config.yaml
. See configurations.
- Add
- Install python from python.org.
- Install requirements.
pip install -r requirements.txt
- Run on cmd/terminal. Also check Alternative ways to pass keys.
python telegram_youtube_downloader -k <TELEGRAM_BOT_KEY>
- (optional) To run bot with search feature
python telegram_youtube_downloader -k <TELEGRAM_BOT_KEY>,<YOUTUBE_API_KEY>
-
/search
is an optional feature, and requires a youtube api key. - With search enabled you can make youtube searches and download from search results that listed as a button menu.
- You can get the key from console.developers.google.com
- With environment (Default)
-
TELEGRAM_BOT_KEY
key must be present on environment variables. - To use
/search
,YOUTUBE_API_KEY
key must be present on environment variables.
-
python telegram_youtube_downloader
- With file
- First line has to be <TELEGRAM_BOT_KEY>.
- To use
/search
, <YOUTUBE_API_KEY> should be on the second line.
python telegram_youtube_downloader -f <FILE_PATH_FOR_KEYS>
- Directly
python telegram_youtube_downloader -k <TELEGRAM_BOT_KEY>
python telegram_youtube_downloader -k <TELEGRAM_BOT_KEY>,<YOUTUBE_API_KEY>