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

Asked by karel on 2011-10-28


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?


Question information

English Edit question
SubDownloader Edit question
No assignee Edit question
Last query:
Last reply:
Marco Ferreira (mferreira) said : #1

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

Where can i find the cli version?

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.

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

Marco Ferreira (mferreira) said : #5

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

Thanks a lot Marco

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:

# 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.
IFS=$(echo -en "\n\b")

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

# Put the field separator back to a space character.

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.