Monitor a directory for new files and automaticaly download subs, retry every 12 hours for new releases.

Asked by karel

Hi,

All my favourite shows are downloaded and unpacked automaticly. It would be really nice if I can also get the subs downloaded automaticly.

Is there any chance you can add this? Or make it so that the program can from the CLI so I can make a schedule for it?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
SubDownloader Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marco Ferreira (mferreira) said :
#1

You can use the CLI to search for subtitles. Maybe set a cronjob ?

Revision history for this message
Mario Oswaldo Gomes da Silva (marreco) said :
#2

Where can i find the cli version?

Revision history for this message
Marco Ferreira (mferreira) said :
#3

The CLI is part of the SubDownloader you have installed. So if you have installed 2.0.14, that should be also the cli version.

Revision history for this message
Mario Oswaldo Gomes da Silva (marreco) said :
#4

I downloaded The Mac os x version, there is only one Application

Revision history for this message
Marco Ferreira (mferreira) said :
#5

You can call SubDownloader from the command line using this path:
/Applications/SubDownloader.app/Contents/MacOS/SubDownloader -h

Revision history for this message
Mario Oswaldo Gomes da Silva (marreco) said :
#6

Thanks a lot Marco

Revision history for this message
John Dutch (dutchguy1982) said :
#7

Would be nice if subdownloader could skip videos that already have subtitles. Because it don't believe it can, I created this bash script which I call twice a day:

############
#!/bin/bash
date
# Go to main video directory. Videos may be in subdirectories.
cd /media/Data/Videos

# Find the newest 20 videos.
newvids=`find . -regextype posix-extended -regex '.*(mp4|mkv|avi)' -type f -printf "%TY-%Tm-%Td %TT %p\n" | sort | tail -n 20 | grep -oE "\./.*" | sed 's/^\.\///' | sed 's/ /\\ /g'`

# Change the bash field separator temporarily to a newline, instead of a space.
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

for vid in $newvids;
do
  sub=`echo $vid | sed -r 's/(mp4|avi|mkv)$/srt/' | sed 's/ /\\ /g'`
  if [ -e $sub ]
  then
 echo -e "Subs already present for current video. :-)"
  else
       echo No subs yet for $vid so asking subdownloader to get it...
       subdownloader -c -q -V $vid -l eng --rename-subs
  fi
done

# Put the field separator back to a space character.
IFS=$SAVEIFS
##############

It finds the 20 newest videos in a given folder and its sub folders, and looks for an srt file with the same name as the video. If it doesn't find an srt file with the same name as the video, it launches subdownloader to get it.

note: perhaps a flaw in the design of this script: if you download a video from a long while ago, and the creation time of that file is therefore a long time ago, it may not end up in the 20 newest videos. I've limited the amount of videos which it finds on purpose, so that it doesn't keep on trying to find subs for videos it will never find subs for.

Can you help with this problem?

Provide an answer of your own, or ask karel for more information if necessary.

To post a message you must log in.