This project contains all scripts you need to automatically grab live streams from several channels.
Highlights:
-
Auto download live streams when it starts
-
Callback function. Allowing to upload to GDrive, OneDrive...(rclone supported) after videos are downloaded.
-
Address Pool to prevent HTTP 429 error from Youtube.
-
Using a light-weight Alpine Linux!
-
Telegram notification
-
Monitored channels are easy to be added
- Alpine Linux
- a IPv6 prefix (optional, strongly recommended)
- a large enough Cloud Drive (optional, recommended)
- Telegram bot token (optional)
Run git clone --recursive https://github.com/lekoOwO/vtbackup .
on /root
Install all dependencies by running sh /root/scripts/live-dl.init.sh
.
Config live-dl with its example config file.
It's recommended to config a IPv6 Pool to prevent Youtube HTTP 429 error.
Make sure that you are in a SLAAC (IPv6 stateless) environment.
fill PREFIX
, DEV
, CIDR
in /root/ipv6/ipv6.bash
and make it executable.
It's using ${PREFIX}${SUFFIX}::1
to ${PREFIX}${SUFFIX}::ff
by default, change it if you want (just modify the for-loop part, easy.)
address_pool: true
address_pool_file: /root/ipv6/address.txt
run_callback: true
callback:
executable: /root/scripts/callback.bash
Download rclone and config your storage.
A example callback file is provided, modify it to meet your need :D
Downloaded video will be uploaded to your cloud storage and deleted locally.
Write your own callback script, yay!
EXECUTABLE "${OUTPUT_PATH}.mp4" "$BASE_DIR/" $VIDEO_ID $FULLTITLE $UPLOADER $UPLOAD_DATE
will be called after the video is downloaded.
Save your callback script to /root/scripts/callback.bash
and make it executable.
YTArchive is a convinient script to archive youtube videos.
config.yml
use_ytarchive: true
ytarchive:
executable: YTARCHIVE_PY_LOCATION
cookie: YOUR_COOKIE_TXT
This part helps you to know whether you are 429ed by receiving messages on a telegram channel every x minutes.
Fill your CHANNEL_ID
, CHAT_ID
, BOT_TOKEN
in.
cd /etc/periodic/15min/
ln /root/scripts/isBanned.bash
mv ./isBanned.bash ./isBanned
chmod +x ./isBanned
rc-service crond start && rc-update add crond default
Look at start.bash.example
.
Make it executable.
rc-update add local default
cd /etc/local.d/
ln /root/start.bash
mv ./start.bash ./live-dl.start
chmod +x ./live-dl.start
add_channel.sh
is a convinient script to add a monitored channel!
Don't forget to edit it (DEFAULT_TELEGRAM_CHANNEL_ID
)!