You can search and download a subtitle with this cli tool.
Download lara-subs file and create config file in same directory. Example config file below.
OPENSUBTITLE_API_KEY=
OPENSUBTITLE_API_NAME=
OPENSUBTITLE_USERNAME=
OPENSUBTITLE_PASSWORD=
To search for subtitles for movies or TV series in a specific directory, use the --path parameter.
lara-subs --path "/Movies/The.Matrix"
lara-subs --path "/Movies/How.I.Met.Your.Mother"
Use the --title parameter to search by movie or series title.
lara-subs --title "the natrix"
lara-subs --title "how i met your mother"
OpenSubtitles account and an api consumer