新增凤凰城节点

This commit is contained in:
zeaslity
2024-11-28 20:11:31 +08:00
parent c9f69d595e
commit 08a1cd52f6
34 changed files with 123 additions and 83 deletions

View File

@@ -0,0 +1,13 @@
# /etc/systemd/system/daemon-rclone-to-onedrive.service
# systemctl restart daemon-rclone-to-onedrive.service
[Unit]
Description=Daemon Rclone To OneDrive
[Service]
ExecStart=/root/app-install/ytdl-material/rclone-sync-to-onedrive.sh
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,60 @@
#!/bin/bash
video_file_path=/data/alist/local/ytdl/video/
rclone_remote=office-wdd
rclone_log_path=/data/alist/local/ytdl/appdata/rclone-to-onedrive.log
build_duplicate_files() {
path=$1
namelist=('How Geography Made The US Ridiculously OP.f399.mp4.part'
'How Geography Made The US Ridiculously OP.f399.mp4.ytdl'
'How Geography Made The US Ridiculously OP.info.json'
"Why Russia's Biggest Threat is Actually China.mp4"
)
for file in $namelist; do
echo "$file"
touch "$file"
done
}
check_duplicate_filenames() {
path=$1
files=$(find $path -type f)
if [ -z "$files" ]; then
echo "there are no files in $path, continue waiting!"
return 1
fi
duplicates=0
for file in $files; do
filename=$(basename $file)
count=$(echo $filename | tr -cd '.' | wc -c)
if [ $count -gt 1 ]; then
echo "find duplicate files in $path, continue waiting!"
duplicates=1
break
fi
done
return $duplicates
}
move_files_to_onedrive() {
echo "[$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")] start to move files [ $(find "$video_file_path" -type f -exec basename {} \;) ] to OneDrive" >> $rclone_log_path
rclone move "$video_file_path" "$rclone_remote":/TransVideos --create-empty-src-dirs -P >> $rclone_log_path
echo "[$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")] move files [ $(find "$video_file_path" -type f -exec basename {} \;) ] to OneDrive complete!" >> $rclone_log_path
}
while true; do
check_duplicate_filenames "$video_file_path"
result=$?
if [ $result -eq 0 ]; then
move_files_to_onedrive
else
sleep 5
fi
done

View File

@@ -0,0 +1,13 @@
# vim /etc/systemd/system/rclone-sync-from-onedrive.service
# systemctl restart rclone-sync-from-onedrive.service
[Unit]
Description=Daemon Rclone To OneDrive
[Service]
ExecStart=/root/app-install/rclone-sync-from-onedrive.sh
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,20 @@
#!/bin/bash
video_file_path=/data/nfs-share/OneDriveSync/
rclone_remote=office-wdd
rclone_log_path=/data/rlone_sync/rclone-to-onedrive.log
rclone_sync_from_onedrive(){
echo "[$(date --rfc-3339=seconds | cut -d"+" -f1 | sed "s/ /-/g" | sed "s/:/-/g")] sync from OneDrive"
rclone copy "$rclone_remote":/TransVideos "$video_file_path" -P >> $rclone_log_path
}
while true; do
rclone_sync_from_onedrive
sleep 15
done

View File

@@ -0,0 +1,15 @@
# https://github.com/alexta69/metube
# t0.107421.xyz:28081
version: "3"
services:
metube:
image: ghcr.io/alexta69/metube
container_name: metube
restart: unless-stopped
ports:
- "28081:8081"
volumes:
- /data/alist/local/youtube:/downloads

View File

@@ -0,0 +1,33 @@
# https://github.com/Tzahi12345/YoutubeDL-Material
# https://youtubedl-material.stoplight.io/docs/youtubedl-material/
version: "2"
services:
ytdl_material:
environment:
ALLOW_CONFIG_MUTATIONS: 'true'
ytdl_mongodb_connection_string: 'mongodb://ytdl-mongo-db:27017'
ytdl_use_local_db: 'false'
write_ytdl_config: 'true'
restart: always
depends_on:
- ytdl-mongo-db
volumes:
- /data/alist/local/ytdl/appdata:/app/appdata
- /data/alist/local/ytdl/audio:/app/audio
- /data/alist/local/ytdl/video:/app/video
- /data/alist/local/ytdl/subscriptions:/app/subscriptions
- /data/alist/local/ytdl/users:/app/users
ports:
- "28998:17442"
image: tzahi12345/youtubedl-material:latest
ytdl-mongo-db:
image: mongo
# ports:
# - "27017:27017"
logging:
driver: "none"
container_name: mongo-db
restart: always
volumes:
- /data/alist/local/ytdl/db/:/data/db