Synology download station and subtitles.

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Synology download station and subtitles.

Post by maxoudela »

Hi,

I'm kinda new on FileBot, I'm discovering that it can do quite a lot of things. But somehow, there's a thing I cannot achieve.

I'm using "Download station" of Synology to download some torrents. Once the torrent is done, I would like to download the subtitle associated to it. But apparently download station does not have a "run script when download is finished" option.. Is there a work-around?

Also, I would like to run on some folders a "get missing subtitles" but apparently it's forbidden.. I don't quite understand why.. Suppose I have the whole season of Big bang theory without subtitles. I would like to get them all (20 subtitles), and I can't because I have to set a limit to 30 days..

I've seen some post about "AMC" script, or the FileBot node, but I'm really not interesting about renaming files etc. Simply getting the subtitles..

Best regards,
Sam'
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

1.
Use the Synology Task Manager to call the suball script on your files once per day.

2.
Unix permissions is something you have to figure you yourself. Google is your friend. ;)
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

Thanks for the reply,

1 ) Just to sum up in order to be sure, the only thing I can do is to create a "everyDay.sh" file, then paste in it :

Code: Select all

filebot -script fn:suball /Volume1/video/MY_SERIES -non-strict --lang fr --def maxAgeDays=7
And in the TaskManager, I indicate the path to this script file? Then I'll be sure that everyday, FileBot will go through all my series, and try to fetch french subtitles for files that don't have subtitles?
Speaking of which, it will fetch all subtitles for files that don't have french subtitles, or no subtitle at all?

2) For the permission, I was not speaking of UNIX permission. I was saying that it is forbidden (viewtopic.php?f=4&t=5#p8871) to call subAll without the maxAge command. Thus, the script will work for the new episodes but I have to manually do it for the older ones.

Regards,
Sam'
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

1.
I'd start with a small batch of files so you can test it and see if things work as expected.


2.
If you know what you're doing then you can of course run the script on a big batch of files without any limits. But it'll be on you to figure out a way to not overly abuse OpenSubtitles. For examples by only passing a limited number of files to the script per day (e.g. "manually" one folder at a time, only folders starting with A, etc). The find command will help with that. This part you probably wanna do via SSH yourself.
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

Thanks for the quick reply,

1) I will create several sh file (big_bang_theory.sh, daredevil.sh, whatever.sh) which will point to a specific folder. Then every day, I will check if these scripts are properly working, then I can change it to the root series folder (with the maxAge activated). Sounds good?

2) I thought that calling fn:suball without maxAge was not permitted in fact. I will then use it without maxAge but on very specific folders then, and I'll be careful not to hit OpenSubtitle limit.

Regards,
Sam'
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

1.
Yep, that should be fine.

2.
Well, I try to use strong language to make sure to get the point across. OpenSubtitles doesn't ban people unless those people spam the servers and slow things down for everyone. You have to try really hard (or have no idea what you're doing) to fall into the category. ;)
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

Allright, I have been able to make everything work as expected.

I was thinking that it was a bit hard for me to set everything up for my synology. I first thought that I needed FileBot (in fact not), then I struggle with the installation, the configuration, the Java PATH etc etc.

Would it be interesting if I made a post with screen capture and explanation for a n00b (like me) that would just want to have the subtitles for its movies/series?

Regards,
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

Yes, that would be very interesting. I'm sure I'd help someone.

FYI: Many have promised to write a tutorial, but very very few people have actually posted one. Be one of them. ;)
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

I'll try to do that as soon as possible. I will write it in this section, I will let you modify it (english is not my mother language) and improve it if necessary!
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

Best to make a new thread though. ;)
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

I've posted it here : viewtopic.php?f=3&t=3599

Let me know if it's good, and to hesitate to modify/improve it, or to tell me what to add.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

In fact I have an issue with the TaskManager. When the task is ran, I have that in the log :

Code: Select all

Fetch subtitles for [/volume1/video/Séries/SOME_SHOW]
Get [French] subtitles for 1 files
CmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`
But I did enter my credentials via SSH, is it a PATH thing again?

I also have at the beginning

Code: Select all

/usr/local/bin/filebot: line 21: cd: /root: Permission denied
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

Did you enable home folders in DSM? Are you running as admin, not as root?

Somehow FileBot is called with the current working dir /root which doesn't make sense.

It should look like this:

Code: Select all

echo $HOME
/var/services/homes/admin
You can the configure script to enter OpenSubtitles account settings for your user:

Code: Select all

filebot -script fn:configure
Settings are stored per user. Settings configured for user A will only be available for user A.
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

I enabled home folders in DSM yes.

I'm not running as admin, I'm running as another user which have the administrator privileges. I have deactivated "admin" user for safety.

When I connect via SSH, and echo $HOME I do have like you. (With the user different).

Should I run the script via root?
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

1.
Never run the script as root. You'll just fuck up all the permissions for all others users.

2.
Not sure what's happening. I only test with the admin user. So that might hint towards a solution.
:idea: Please read the FAQ and How to Request Help.
maxoudela
Power User
Posts: 19
Joined: 31 Mar 2016, 12:16

Re: Synology download station and subtitles.

Post by maxoudela »

Allright I don't quite understand the issue, but I added this at the beginning of my task :

Code: Select all

cd /var/services/homes/MY_USER
So I'm sure that it's not trying to be anywhere. I ran the task and it seems to work.
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology download station and subtitles.

Post by rednoah »

Yes, it's strange that the task is started with $PWD pointed to /root but that's probably because you have a custom user and that's probably not something the Synology people test with thoroughly.
:idea: Please read the FAQ and How to Request Help.
Post Reply