Using VPN just for fetching subtitles

I have openvpn running on my vero only so that I can get subtitles because the subtitle sites are blocked in Australia. However, I don’t need the VPN for anything else because I get my shows & movies from a hosted seedbox via an lftp mirror script. In fact, from time to time using the VPN seems to cause problems with connecting to the seedbox (something to do with DNS servers I think). When that happens I end up having to turn the VPN off. Then I have to turn it back on when I need to grab subtitles.

So… I’m trying to find out how to set up my vero to use the VPN just for getting subtitles. There are three situations when subtitles are fetched:

  1. when sickchill post processes a tvshow that has been mirrored from the seedbox
  2. when couchpotato post processes a movie that has been mirrored from the seedbox
    and
  3. when I pause playback on a show/movie and use the menu option to download subtitles

From what I’ve read so far on this subject, traffic for specific users can be directed through the VPN.
Sickchill & couchpotato are set up as users so maybe the traffic for those could be handled like that. However, when I pause playback, the user doing the downloading then would be osmc right? I assume the user that does the lftp mirrorring from the seedbox would be osmc as well so directing traffic for osmc to the VPN would lead to the same problems I’m trying to avoid.

I guess if it’s possible to direct traffic between the vero and opensubtitles.org through the VPN, that might be the easier way to do it.

I came across this post OpenVPN - Control what goes via VPN which has a lot of discussion on which methods can/could be used to send certain traffic through the VPN. However, I can’t work out how to apply it to my situation/needs.

I have some familiarity with CLI and I’ve done a bit of piece-meal bash scripting but I really don’t know anything about networking, routing, proxies etc. and I lack the time or inclination to learn enough about all of these things to solve this issue myself. I’m hoping someone could provide instructions on the best way to solve this issue.

EDIT: One thing I just tried is using iplookup to find an ip address for opensubtitles and then adding it to /etc/hosts:

172.67.72.143 opensubtitles.org www.opensubtitles.org

and then adding this:

route-nopull
route 172.67.72.143

to the top of the ovpn conf file I use by default. From what I can tell this didn’t work. But I don’t know how to test this properly to see what’s going wrong apart from checking my ip address from the CLI to check that the VPN isn’t active and checking to see if subtitles download… and that didn’t seem to be working.

Bit off topic, but can you not run Bazarr to auto grab subs on your seedbox? https://www.bazarr.media/

If it connects to subtitle sites that are blocked in australia… Then… Not without a vpn… No.

You need to configure your VPN to ignore a “redirect-gateway def1” if pushed from the server, and also make sure it’s not set in the client config file. https://community.openvpn.net/openvpn/wiki/IgnoreRedirectGateway Doing so will mean that traffic will not be sent by default to the VPN.

Then for each IP address you want to send through the tunnel, add a line:

route 172.67.72.143 255.255.255.255

to the OpenVPN config file.

And, ideally, remove the entry from /etc/hosts, since it restricts you to one IP address.

@dillthedog: Thanks for the reply and sorry for not getting back to you sooner.

I’ve removed the line from /etc/hosts. I also removed these 2 lines which I’d previously added to my default ovpn conf file:
route-nopull
route 172.67.72.143

However, regarding your advice:

…configure your VPN to ignore a “redirect-gateway def1” if pushed from the server…

Even after reading the info in the link, I couldn’t work out what to change to do that. I tried a few things but each time, after (re)starting openvpn I got errors when I tried to check my ip address and also when I tried pinging sites.

I also tried the solution mentioned here which didn’t work either.

Are you able tell me specifically which files to edit and what lines I need to add/modify?

Also, once it’s working, would I be correct in thinking that:

  • when I check my ip address, I should see the same IP address I see when I check with openvpn off

and

…?

Please provide your OpenVPN client config file (minus any passwords, keys and certificates).

Please also run grab-logs -A and post the URL it returns.