🤝 If you encountered a problem or want some help feel free to sumbit an issue. Feedback is appriciated!
- Added support for instagram posts with multiple items
- YouTube videos are now beeing sent to channel by default but only if they fit into 25MB Discord limit
- Improved processing speed when requesting multiple links in one message
- Improved logging when compressing videos
- Improved error reporting in channel
- Lets everyone view the video directly in Discord
- Sends videos as reply to original message
- Supports multiple links in one message
- No TikTok watermark on videos
- Can be hosted on Raspberry Pi (read Raspberry Pi section)
- Settings wizzard is built into bot
- Also supports Instagram and YouTube links with some additional setup
- Photo tiktoks may be stretched too much if different image sizes used
- When sending too many atttachments to discord at the same time, some replies may repeat (Discord.JS issue?)
- Videos which are saved onto disk to be compressed later and compression results are not automatically deleted from
/logs
for debugging and statistic purposes. Uncomment two lines withunlink()
function invideo_compression.ts
to delete them automatically when they're no longer needed - (Unverified) When processing multiple instagram links at the same time instagram.com may reject some requests
- Bot threats Private/Unavailable content as backend errors. (post from private Instagram profile or removed youtube video for example)
- Make sure recent version of node.js and npm is installed on your system
- Build bot with these commands
cd ~
git clone https://github.com/voltflake/video-bot
cd video-bot
npm install
npx tsc
- Now you can start this bot
node .
Instalation should be pretty straighfoward.
Download Node Version Manager
Install Node with nvm (v18.16.1 should work fine on raspbian buster, newer may fail)
nvm install --lts node
Follow above instalation instructions
Install python3 and python3-pip
sudo apt install python3 python3-pip
Install gallery-dl python package
pip3 install gallery-dl
Update PATH variable if you get a warning that script is not in PATH
PATH=$PATH:/home/pi/.local/bin
Log into instagram.com from your browser and exctract cookies.txt from it.
Place cookies.txt into video-bot folder and Instagram feature should work fine.
Install python3 and python3-pip
sudo apt install python3 python3-pip
Install yt-dlp python package
pip3 install yt-dlp
Update PATH variable if you get a warning that script is not in PATH
PATH=$PATH:/home/pi/.local/bin
Make sure your OS is Raspbian Buster also known as Raspbian Legacy,
h264_omx hardware encoder doesn't work on newer Raspbian Bulseye on my 3A+ board.
Install ffmpeg
sudo apt install ffmpeg
- Create service file
sudo nano /etc/systemd/system/video-bot.service
- Fill in the file (working example)
[Unit]
Description=Discord Bot for easier video viewing
After=network.target
[Service]
Environment=PATH=/home/pi/.local/bin:/home/pi/.nvm/versions/node/v18.16.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games
Type=simple
User=pi
WorkingDirectory=/home/pi/video-bot
ExecStart=/home/pi/video-bot/start.sh
[Install]
WantedBy=multi-user.target
- Create
start.sh
file in project directory
sudo nano /home/pi/video-bot/start.sh
- Fill in the file
#!/bin/sh
node .
- Make
start.sh
executable
chmod +x /home/pi/video-bot/start.sh
token
- Discord bot token to use.embeded_mode
- always send videos using URL message in Discord, may have not cleanest look but works realy fast if you have slow internet.enable_compression
- setting which enables compression for videos bigger than 8MB so they can be sent as single video file to discord, without links. If compression is disabled videos will be sent as embeded link and can expire after a week or so.codec
- specifies which video codec ffmpeg will use during compression. You can specify this as "omx_h264" on raspberry pi to use hardware accelerated encoding. By default uses "h264".