[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.
EnZioBe
Posts: 30
Joined: 18 Oct 2015, 14:37

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

Post by EnZioBe » 18 Oct 2015, 18:54

Thank you for your clear advice and instructions. What I wanted most of all was to get the post-processing to work, but unfortunately there was no success with any of the test downloads that I tried. :( I did add to the PostScript options the Subliminal.py entry. Going to Addic7ed I see that the subtitles are available for the test downloads, so it's not a case of non-existent subtitles.

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

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

Post by l2g » 18 Oct 2015, 21:06

EnZioBe wrote:Thank you for your clear advice and instructions. What I wanted most of all was to get the post-processing to work, but unfortunately there was no success with any of the test downloads that I tried. :( I did add to the PostScript options the Subliminal.py entry. Going to Addic7ed I see that the subtitles are available for the test downloads, so it's not a case of non-existent subtitles.
On the Subliminal Post-Processing Mode options, make sure you've set UpdateTimestamp to 'Yes'. This is the default option, so i'd imagine you'll be okay

If you're using VideoSort.py as well, you might want to make sure Subliminal.py runs last. You can do this from the same ExtensionScripts menu option already discussed in my last post, see the ScriptOrder option. Alternatively in the VideoSort Options, add .srt to the SatelliteExtensions. Otherwise, VideoSort will just remove the files because they aren't recognized videos.

Also, if your using a 3rd party application (such as CouchPotato, or Sonarr), you may be out of luck. They don't have a SatelliteExtensions type deal and what usually happens is the Subliminal.py downloads their subs, but these tools just erase them when they go to move your videos into your library. I think these people just use the ScanScript version of the tool.

If you think there is a bug, the only thing else i can offer you (in terms of help) is if you capture your logs and let me see them. In the Subliminal Options, there is a Debug mode you can turn on which really helps me out too. If you have to go this route, it might be easier to PM me the logs to prevent spamming this forum. Try my suggested options above first though please. :)

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

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

Post by l2g » 21 Oct 2015, 18:59

Release v0.9.7 (Direct Download Link) in place.

The release details can be found at the head of this thread (quick link).

EnZioBe
Posts: 30
Joined: 18 Oct 2015, 14:37

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

Post by EnZioBe » 03 Nov 2015, 13:23

Despite various attempts to fix a couple of issues, I haven't been able to find a solution.

One of them is described in thread http://forum.nzbget.net/viewtopic.php?f=3&t=2192 . When I try to search for subtitles for a single episode on an ad hoc basis, it appears that a search for all[/] episodes (of any series) in history is carried out, that is not simply for the one that I am interested in.

Similarly, I'm trying to find a way to search for subtitles only for those episodes that I download at a time, that is not having a search being automatically done for all episodes (of any series) in history.

A third issue, or rather question, is as follows: Is there a way to prioritize the subtitle search sources? Say, I want addic7ed to be searched first, and if a subtitle is found, then the search to end there. Can this be done?

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

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

Post by l2g » 03 Nov 2015, 13:56

EnZioBe wrote:When I try to search for subtitles for a single episode on an ad hoc basis, it appears that a search for all[/] episodes (of any series) in history is carried out, that is not simply for the one that I am interested in.

NZBGet can't offer you this functionality because it wasn't designed to manage your video library. But what you're trying to achieve can be done through the command line:

Code: Select all

/path/to/nzbget/scripts/Subliminal.py -f -s /path/to/the/video/you/want/subs/for.mkv
EnZioBe wrote:Similarly, I'm trying to find a way to search for subtitles only for those episodes that I download at a time, that is not having a search being automatically done for all episodes (of any series) in history.
Going back to my first point, NZBGet will download content, and it hands it off to scripts (if you've set this up) to do all the rest of your library management.

For that reason NZBGet doesn't keep a status quo on where your video file ends up at the end of the day. Whether you told it to hand it off to Sickbeard, Sonarr, Couchpotato, or if even you just had VideoSort.py do some magic on it... NZBGet doesn't know or care.

For subtitles, you can use NZBGet's fantastic ScanScript mode to run Subliminal at a periodic intervals of time and provide it directories it should scan. Subliminal will only touch content that is newer then whatever you defined in your MaxAge (Subliminal) settings. It sounds like maybe you have this set to a really high value (other than it's default of 24) causing it to scan everything each time.
EnZioBe wrote:A third issue, or rather question, is as follows: Is there a way to prioritize the subtitle search sources? Say, I want addic7ed to be searched first, and if a subtitle is found, then the search to end there. Can this be done?
No not at this time. All matched content from all providers are pooled together and then scanned even further. It matches the title, the year, the releasing group, resolution (720p, 1080p), audio codec, etc. The more matches; the higher the score. The highest weighted/scored item is then downloaded (this usually always works). To achieve the best effects of this script; make sure you keep all of the video details.

Hence don't rename 'What.A.Great.Video.2015-SCENE.720p.infoid.moreinfo.id.mkv' to ''What.A.Great.Video.mkv' and 'then' scan that for subtitles. It will be like rolling the dice on getting a successful match. No amount of code can ever 'assume' what subs go with a video that has had all of it's detailed content stripped from it.

Hope this helps.

EnZioBe
Posts: 30
Joined: 18 Oct 2015, 14:37

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

Post by EnZioBe » 03 Nov 2015, 15:22

l2g wrote:
EnZioBe wrote:Similarly, I'm trying to find a way to search for subtitles only for those episodes that I download at a time, that is not having a search being automatically done for all episodes (of any series) in history.
Going back to my first point, NZBGet will download content, and it hands it off to scripts (if you've set this up) to do all the rest of your library management.

For that reason NZBGet doesn't keep a status quo on where your video file ends up at the end of the day. Whether you told it to hand it off to Sickbeard, Sonarr, Couchpotato, or if even you just had VideoSort.py do some magic on it... NZBGet doesn't know or care.
Thank you for your reply. It clarifies many things.
I'll adjust MaxAge to a short value although if I understand correctly it should only have an effect on the scheduled scans.
This is a bit off-topic, but I am intrigued by your above comment. The way that I use NZBGet is starting from Sonarr I initiate downloads by NzbGet and then I use VideoSort.py to sort them. How may I be able to do it in reverse, that is after I download an episode with NZBGet to pass it on to Sonarr for further processing? Could I do it by downloading everything to a single directory and then somehow use Sonarr to go through that directory and sort every episode to its proper place?

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

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

Post by l2g » 03 Nov 2015, 16:16

EnZioBe
I personally love hugbug's VideoSort.py. It's the end solution for all the video sorting and library placing I do.

clintonhall has a very popular script called nzbToMedia.py which can pass the content back the processed content back to Sonarr (or CouchPotato, or Sickbeard, etc) for processing (as an alternative to Videosort.py).

Although I personally don't use it, it's popularity speaks for itself as to how well and awesome it works. I'm quite positive that it would definitely handle what you're asking. You should check out his thread and maybe there is enough info there to get you started.

EnZioBe
Posts: 30
Joined: 18 Oct 2015, 14:37

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

Post by EnZioBe » 03 Nov 2015, 16:42

Thanks. I'll follow it up, at least out of curiosity.

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

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

Post by Ayla » 07 Nov 2015, 10:11

Hi Chris (or someone else),

Can you help out, I get an error when running nzbget-subliminal in Debian 8?

I have tried googling but I can't seem to fix the error.

Code: Select all

sudo python nzbget/scripts/nzbget-subliminal/Subliminal.py -l en,da -f -k -S /mnt/synology/myvideo.mkv
2015-11-07 11:08:40,176 - 13741 - INFO - Found 1 matched file(s).
2015-11-07 11:08:40,177 - 13741 - INFO - Using advanced search mode
2015-11-07 11:08:40,328 - 13741 - INFO - Scanning video 'myvideo.mkv' in '/mnt/synology'
2015-11-07 11:08:40,954 - 13741 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "/home/martin/nzbget/scripts/nzbget-subliminal/Subliminal/nzbget/ScriptBase.py", line 2398, in run
    exit_code = main_function(*args, **kwargs)
    File "nzbget/scripts/nzbget-subliminal/Subliminal.py", line 1637, in main
    File "nzbget/scripts/nzbget-subliminal/Subliminal.py", line 1265, in subliminal_fetch
    File "/home/martin/nzbget/scripts/nzbget-subliminal/Subliminal/subliminal/api.py", line 215, in download_best_subtitles
    Provider = provider_entry_point.load()
    File "/home/martin/nzbget/scripts/nzbget-subliminal/Subliminal/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
    File "/home/martin/nzbget/scripts/nzbget-subliminal/Subliminal/subliminal/providers/thesubdb.py", line 6, in <module>
    import requests
    File "/home/martin/nzbget/scripts/nzbget-subliminal/Subliminal/requests/__init__.py", line 53, in <module>
    from urllib3.contrib import pyopenssl
    File "/home/martin/nzbget/scripts/nzbget-subliminal/Subliminal/urllib3/contrib/pyopenssl.py", line 69, in <module>
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
  AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

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

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

Post by l2g » 07 Nov 2015, 17:10

Ayla,

Good find!

It appears newer versions of Python have dropped support for SSL v3 (which is a good thing really since it's so easily exploited). I upgraded urllib3 (a dependent package of Subliminal.py) which already looks after handling this.

It works for me (but it always works for the developer; you know how it goes...). Soo... If you wouldn't mind downloading a copy from the master branch and testing this out for me, I'd be very much appreciative of it!

Quick Link to Master Version (download).

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests