We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I made a little script that I run by systemd and checks every 10 min for new subtitles to sync.
#!/bin/bash -e indir=$1 handled='/media/data/programs/SyncSubs_processed.txt' handled_now='/media/data/programs/SyncSubs_processing.txt' while true; do rm "$handled_now" && touch $handled_now touch "$handled" IFS=$'\n' srtfiles=$(find $indir -name '*srt' -mtime -3 -printf '%T@|%p\n' 2>/dev/null) || true for srt in $srtfiles; do IFS='|' set $srt epochfile=$1 srtfile=$2 sf_dir=$(dirname "$srtfile") sf_bn=$(basename "$srtfile") if grep -q "$srt" "$handled" || grep -q "$srt" "$handled_now"; then true echo "Already handled : $srt" else ## we handle only files older then 10minutes. So all other subs can be downloaded for the video curr_epoch=$(date +%s) if [ $(($curr_epoch - ${epochfile%%\.*})) -gt 200 ]; then ## echo "Start handling : $sf_bn" movie=$(echo "$sf_bn" | perl -pe 's/(\...?.)?\.srt$//g') moviefile=$(find "$sf_dir" -size +300M -name "${movie}.*") find "$sf_dir" -name "${movie}*.srt" -printf "%T@|%p\n" >> $handled_now /home/jeroen/.local/bin/subsync $moviefile || true find "$sf_dir" -name "${movie}*.srt" -printf "%T@|%p\n" >> $handled ## echo "end handling $movie" else echo "Not old enough : $sf_bn" fi fi done rm $handled_now || true sleep 600 done
cat /etc/systemd/system/SyncSubs.service [Unit] Description=Huubs Subtitle Sync Service [Service] User=jeroen Group=jeroen ExecStart=/media/data/programs/fixSubs.sh /media/data/complete [Install] WantedBy=multi-user.target
cat /etc/systemd/system/SyncSubs.service [Unit] Description=Huubs Subtitle Sync Service
[Service] User=jeroen Group=jeroen ExecStart=/media/data/programs/fixSubs.sh /media/data/complete
[Install] WantedBy=multi-user.target
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I made a little script that I run by systemd and checks every 10 min for new subtitles to sync.
The text was updated successfully, but these errors were encountered: