[PP-Script / Scan-Script] Automatically Fetch Subtitles

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
kloaknet
Posts: 337
Joined: 23 Jul 2014, 08:52

Re: [PP-Script] Automatically Fetch Subtitles

Post by kloaknet » 24 Aug 2014, 17:48

sorry, some how I am always the guy that stumbles upon bugs anywhere possible :oops:. Ill update the stuff again (master), report tomorrow back if I find some issues, and just subscribed too this thread again ;) , guess subscription got lost in the transition to the new topic. Maybe you should contact the guy from subliminal too, and inform him about your improvements ;)

Ayla
Posts: 21
Joined: 26 Aug 2014, 17:02

Re: [PP-Script] Automatically Fetch Subtitles

Post by Ayla » 26 Aug 2014, 17:07

Thanks for working on Subtitles integration :)

I use Nzbdrone and Couchpotato, together with NZBGet.

After I have downloaded this script from github and placed it in NZBGet's Scripts folder, what changes do I need to make in NZBGet settings to make it work?

I would like it to download the subtitle, before Nzbdrone renames and moves the video file (also, I would like to set it up so that Nzbdrone moves the subtitle file as well).

Thanks for the help!

PS. Have you considered moving the settings to a file of it's own, so that when we do a git pull, the settings aren't overwritten?

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Automatically Fetch Subtitles

Post by l2g » 26 Aug 2014, 17:59

Ayla wrote:After I have downloaded this script from github and placed it in NZBGet's Scripts folder, what changes do I need to make in NZBGet settings to make it work?

I would like it to download the subtitle, before Nzbdrone renames and moves the video file (also, I would like to set it up so that Nzbdrone moves the subtitle file as well).
If you use the PostProcess part of this script, you'll need to make sure you configure NZBDrone and CouchPotato to ignore .srt file types (otherwise it'll just remove them).

You can also set up the Scheduler to poll the directories NZBDrone and CouchPotato move your content to. Presumable you have somewhere on your system 2 main directories? something like : /usr/share/TVShows and /usr/share/Movies. Or if your using Microsoft, perhaps the paths are more like: C:\My Movies and C:\My TVShows. Either way, set up your Scheduler with these 2 directories in it (separate them with a comma and/or space), and give it a Task Time such as *:00,*:30 so that every half hour, NZBGet will wake up and scan the content you've fetched and attempt to fill in the missing subtitles you retrieived for you.

One last thing worth mentioning is... if CouchPotato or NZBDrone are renaming your files and eliminating a lot of the added details that are regularly kept in the file name (such as 720p, -RELEASEGROUP, HDTV, etc) you may lose accuracy in the subs you fetch since these keywords play a key role in getting an exact match from the providers.
Ayla wrote:PS. Have you considered moving the settings to a file of it's own, so that when we do a git pull, the settings aren't overwritten?
I'm kind of surprised your losing your settings when you do a git pull. I don't lose them at all (i'm running CentOS 6.5); perhaps that makes a difference? I honestly don't like the idea of multiple configuration files, especially since they're handled so nicely in NZBGet. If you're worried about losing your settings, i think you can use the backup option that is built into the NZBGet GUI (in the configuration). Then you can do a restore afterwards.

Edit: typo's :)
Last edited by l2g on 27 Aug 2014, 15:46, edited 1 time in total.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-Script] Automatically Fetch Subtitles

Post by hugbug » 26 Aug 2014, 18:39

He doesn't loose the settings. The question was a wild shot :shock:

Ayla
Posts: 21
Joined: 26 Aug 2014, 17:02

Re: [PP-Script] Automatically Fetch Subtitles

Post by Ayla » 27 Aug 2014, 06:24

hugbug wrote:He doesn't loose the settings. The question was a wild shot :shock:
Yes, sorry, I hadn't tested the script yet, I just saw that the settings was at the top of the .py file, so assumed they would be overwritten on updates.

I will test it now, thanks for the help :)

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-Script] Automatically Fetch Subtitles

Post by hugbug » 27 Aug 2014, 07:22

Ayla wrote:I just saw that the settings was at the top of the .py file
These are not the settings. That's a description of the settings, which NZBGet web interface uses when presenting the settings page.
Don't edit the py-file. Instead open NZBGet settings page, you'll see a section for that script, change all settings there.

Ayla
Posts: 21
Joined: 26 Aug 2014, 17:02

Re: [PP-Script] Automatically Fetch Subtitles

Post by Ayla » 27 Aug 2014, 07:38

hugbug wrote:
Ayla wrote:I just saw that the settings was at the top of the .py file
These are not the settings. That's a description of the settings, which NZBGet web interface uses when presenting the settings page.
Don't edit the py-file. Instead open NZBGet settings page, you'll see a section for that script, change all settings there.
Ah, I didn't know that. Very cool that the settings are available in the web UI - thanks for the help!

It seems to work even though the script is in a subfolder in NZBGet's scripts folder, is that correct?
My full path is:

Code: Select all

/Users/martin/Library/Application Support/NZBGet/scripts/nzbget-subliminal/Subliminal.py
It's easier that way when doing git pull's directly to the scripts folder.

Also, how can I confirm that the script is running/working?

It doesn't seem to do anything and I can't see anything in the log in the web UI.

I have scheduled it to run at:

Code: Select all

*:00,*:30
And I have pointed it to my two main folders (ScanDirectories):

Code: Select all

/Volumes/Promise/Movies, /Volumes/Promise/TV Shows

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-Script] Automatically Fetch Subtitles

Post by hugbug » 27 Aug 2014, 07:45

Ayla wrote:It seems to work even though the script is in a subfolder in NZBGet's scripts folder, is that correct?
My full path is:

Code: Select all

/Users/martin/Library/Application Support/NZBGet/scripts/nzbget-subliminal/Subliminal.py
That's correct.

It's easier that way when doing git pull's directly to the scripts folder.
Ayla wrote:Also, how can I confirm that the script is running/working?
If the logging (options InfoTarget, etc. in NZBGet) is active, each time a script is executed a line is added to the log, something like:

Code: Select all

Executing script Subliminal.py
As a test, try the script in post-processing mode (instead of scheduler mode). Add new (small) nzb-file, then to make sure the script is selected for this nzb-file open download details (by licking on the nzb-name in the downloads list), then on button "Postprocess", the script must be selected here. Once the download is completed, the script must be executed.

Ayla
Posts: 21
Joined: 26 Aug 2014, 17:02

Re: [PP-Script] Automatically Fetch Subtitles

Post by Ayla » 27 Aug 2014, 08:54

It seems to be working now, through the Scheduler :)

I can see that for some movies a .rar file was downloaded (inside was a .sub file).

Is there any way to avoid this?

Also, it seems that even though I have 'Overwrite' set to 'No', the script downloads the same subtitle every time it runs (every 30 min).

Here is the log where it's matching the movie "The Rover (2014)". Even though a subtitle was already present, I can see that the modification date/time changes on the subtitle after the script has run:

Code: Select all

ERROR	Wed Aug 27 2014 11:30:04	Subliminal: Could not locate subtitle previously fetched!
INFO	Wed Aug 27 2014 11:30:04	Subliminal: Matched 1 possible subtitle(s) for T.R.2014.720p.WEB-DL.x264-ETRG.mkv
INFO	Wed Aug 27 2014 11:30:04	Subliminal: Found 0 subtitles
INFO	Wed Aug 27 2014 11:30:04	Subliminal: Listing subtitles with provider 'opensubtitles' for video <Movie [u'The Rover', 2014]> with languages set([<Language [und]>])
INFO	Wed Aug 27 2014 11:30:03	Subliminal: Downloading subtitle <PodnapisiSubtitle [en]> with score 30 into u'/Volumes/Promise/Movies/The Rover (2014)/T.R.2014.720p.WEB-DL.x264-ETRG.en.srt'
INFO	Wed Aug 27 2014 11:30:03	Subliminal: Computed score 30 with matches set([u'year', u'video_codec', u'title', u'resolution', u'release_group'])
INFO	Wed Aug 27 2014 11:30:03	Subliminal: Computed score 30 with matches set([u'year', u'video_codec', u'title', u'resolution', u'release_group'])
INFO	Wed Aug 27 2014 11:30:03	Subliminal: Found 0 subtitles
INFO	Wed Aug 27 2014 11:30:03	Subliminal: Listing subtitles with provider 'opensubtitles' for video <Movie [u'The Rover', 2014]> with languages set([<Language [en]>, <Language [da]>])
INFO	Wed Aug 27 2014 11:30:03	Subliminal: Found 0 subtitles
INFO	Wed Aug 27 2014 11:30:02	Subliminal: Listing subtitles with provider 'thesubdb' for video <Movie [u'The Rover', 2014]> with languages set([<Language [en]>])
INFO	Wed Aug 27 2014 11:30:02	Subliminal: Found 2 subtitles
INFO	Wed Aug 27 2014 11:30:01	Subliminal: Listing subtitles with provider 'podnapisi' for video <Movie [u'The Rover', 2014]> with languages set([<Language [en]>, <Language [da]>])
INFO	Wed Aug 27 2014 11:30:01	Subliminal: Skipping provider 'tvsubtitles': no video to search for
INFO	Wed Aug 27 2014 11:30:01	Subliminal: Skipping provider 'addic7ed': no video to search for
INFO	Wed Aug 27 2014 11:30:01	Subliminal: Scanning video 'T.R.2014.720p.WEB-DL.x264-ETRG.mkv' in '/Volumes/Promise/Movies/The Rover (2014)'
INFO	Wed Aug 27 2014 11:30:01	Subliminal: Skipping - Subtitles already exist for: T.R.2014.720p.WEB-DL.x264-ETRG

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Automatically Fetch Subtitles

Post by l2g » 27 Aug 2014, 13:49

Ayla wrote:I can see that for some movies a .rar file was downloaded (inside was a .sub file).

Is there any way to avoid this?
Really? So it downloads a rar file and just leaves it like that? Are you sure the download you fetched from UseNet isn't the one that came with the rar file containing subs?
Adding additional scanning of rar files just to detect if they contain subs might be a bit overkill for the intents of this script. Can you PM me the NZB file you have that is having issues with the post processing?

I'm leaving for the long weekend, so i may not get back to you until early next week (sorry about that in advance).

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests