[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.
l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by l2g » 05 Aug 2014, 17:08

kloaknet wrote:So guessit is imported! but cannot find the pkg_resources stuff in the guessit folder(s) ;)
Heh... so then the saga continues right? :) Lets go for a round 6 then, shall we? This one I tried to take extra caution for. I followed all of the imports manually and then fetched them from my global environment to include.

Round 6: subliminal-ppscript-0.7.4-0-006.zip
  • added missing dependency pkg_resources.py (from python-setuptools)
  • added (detected) missing dependency six.py (from python-six)
  • added (detected) missing dependency charade (from python-charade)
  • added (detected) missing dependency xdg (from pyxdg)
  • added all of the proper licensing data making the contents a bit more presentable by crediting the appropriate authors of the dependent packages. At the same time I set the licensing information in directories that identify the versions i used. This is useful for those who want to go my route and not use a /lib folder. I prefer to make the libraries global for all packages to share bugfixes from.
Lets hope we got everything this time! I'm hoping the next release will have the Scheduler version included so you can set it up to fetch subtitles for content that simply is to new to have any yet. It was a great idea mentioned in an early comment (in this thread).

kloaknet
Posts: 337
Joined: 23 Jul 2014, 08:52

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by kloaknet » 06 Aug 2014, 15:13

Got some new stuff :D:

Code: Select all

error	Wed Aug 06 2014 17:03:55	Post-process-script subliminal/Subliminal.py for Royal.Pains.S06E03.480p.HDTV.x264-REenCO failed
info	Wed Aug 06 2014 17:03:55	Subliminal: DBNoSuchFileError: (2, 'No such file or directory')
info	Wed Aug 06 2014 17:03:55	Subliminal: d.open(file, db.DB_HASH, flags, mode)
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/usr/local/lib/python2.7/bsddb/__init__.py", line 364, in hashopen
info	Wed Aug 06 2014 17:03:55	Subliminal: return bsddb.hashopen(file, flag, mode)
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/usr/local/lib/python2.7/dbhash.py", line 18, in open
info	Wed Aug 06 2014 17:03:55	Subliminal: return mod.open(file, flag, mode)
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/usr/local/lib/python2.7/anydbm.py", line 83, in open
info	Wed Aug 06 2014 17:03:55	Subliminal: fh = self.dbmmodule.open(self.filename, 'c')
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/share/Apps/NZBget/ppscripts/subliminal/lib/dogpile/cache/backends/file.py", line 182, in _init_dbm_file
info	Wed Aug 06 2014 17:03:55	Subliminal: self._init_dbm_file()
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/share/Apps/NZBget/ppscripts/subliminal/lib/dogpile/cache/backends/file.py", line 158, in __init__
info	Wed Aug 06 2014 17:03:55	Subliminal: self.backend = backend_cls(arguments or {})
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/share/Apps/NZBget/ppscripts/subliminal/lib/dogpile/cache/region.py", line 237, in configure
info	Wed Aug 06 2014 17:03:55	Subliminal: arguments={'filename': cache_file, 'lock_factory': MutexLock},
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/share/Apps/NZBget/ppscripts/subliminal/Subliminal.py", line 284, in main
info	Wed Aug 06 2014 17:03:55	Subliminal: exit_code = main_function(*args, **kwargs)
info	Wed Aug 06 2014 17:03:55	Subliminal: File "/share/Apps/NZBget/ppscripts/subliminal/lib/nzbget/ScriptBase.py", line 950, in run
info	Wed Aug 06 2014 17:03:55	Subliminal: Traceback (most recent call last):
info	Wed Aug 06 2014 17:03:55	Subliminal: 2014-08-06 17:03:55,192 - 14349 - ERROR - Fatal Exception:
info	Wed Aug 06 2014 17:03:54	Subliminal: 2014-08-06 17:03:54,658 - 14349 - WARNING - NZB-File not found: /opt/sybhttpd/localhost.drives/SATA_DISK/Download/Royal.Pains.S06E03.480p.HDTV.x264-REenCO.nzb
info	Wed Aug 06 2014 17:03:54	Subliminal: 2014-08-06 17:03:54,630 - 14349 - INFO - Script Mode: POSTPROCESS
warning	Wed Aug 06 2014 17:03:47	Subliminal: Fixing permissions for /share/Apps/NZBget/ppscripts/subliminal/Subliminal.py
info	Wed Aug 06 2014 17:03:47	Executing post-process-script subliminal/Subliminal.py for Royal.Pains.S06E03.480p.HDTV.x264-REenCO
info	Wed Aug 06 2014 17:03:47	Post-process-script FailureLink.py for Royal.Pains.S06E03.480p.HDTV.x264-REenCO skipped
info	Wed Aug 06 2014 17:03:46	Executing post-process-script FailureLink.py for Royal.Pains.S06E03.480p.HDTV.x264-REenCO
info	Wed Aug 06 2014 17:03:45	Cleanup for Royal.Pains.S06E03.480p.HDTV.x264-REenCO successful
info	Wed Aug 06 2014 17:03:45	Deleting file lif88dple135duvlttrapzdxbeys3qt1.par2
info	Wed Aug 06 2014 17:03:45	Cleaning up Royal.Pains.S06E03.480p.HDTV.x264-REenCO
info	Wed Aug 06 2014 17:03:45	Pausing download before cleanup
info	Wed Aug 06 2014 17:03:45	No renamed files found for Royal.Pains.S06E03.480p.HDTV.x264-REenCO
info	Wed Aug 06 2014 17:03:45	Checking renamed files for Royal.Pains.S06E03.480p.HDTV.x264-REenCO
info	Wed Aug 06 2014 17:03:45	Unpausing download after unpack
info	Wed Aug 06 2014 17:03:45	Unpack for Royal.Pains.S06E03.480p.HDTV.x264-REenCO successful
Note that, I guess by default, the nzb.queued files are stored in \share\Apps\NZBget\.nzbget\nzb, just as the my download dir is \share\Download. If I am right, the SATA_DISK (drive name) location should be put before the \share\ in the above. I guess all the next errors are related to the wrong nzb dir.

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

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by l2g » 06 Aug 2014, 20:36

kloaknet wrote:Got some new stuff :D:

Code: Select all

..snip..
info	Wed Aug 06 2014 17:03:55	Subliminal: DBNoSuchFileError: (2, 'No such file or directory')
..snip..
From the error your getting, it seems like you're really close. Dogpile is a dependency of subliminal, and works from within a cache file (stored on your filesystem) that it creates/manages. The error seems to point out that the path you specified the CacheDir (a configuration option to this PPScript) to be doesn't exist. Now, the copy of the script you have might just work if you create the path in advance. That all said, there is no reason why the script can't create a missing folder if it's detected for you. So that right there is what is included in the attachment below...
Well they say 7 is a lucky number right?
Round 7: subliminal-ppscript-0.7.4-0-007.zip

On a side note, i have a fork of Subliminal.py i'm going to dump on you soon that lets you run it from the command line, the scheduler (in NZBGet) and post processing (what the current one is doing now). It might have probably been better if this Round 7 just included the new rewrite now to save frusteration, but it's not quite done yet. So hopefully the attached will suffice for now.
kloaknet wrote: Note that, I guess by default, the nzb.queued files are stored in \share\Apps\NZBget\.nzbget\nzb, just as the my download dir is \share\Download. If I am right, the SATA_DISK (drive name) location should be put before the \share\ in the above. I guess all the next errors are related to the wrong nzb dir.
I'll have to look into this for you because there are benifits to having my pynzbget find the NZB-File. It will parse out meta information from it and use it in the event the download is ever obsfuscated. Not parsing the file really isn't a big deal at all, but has me curious why it's not being found. One of the arguments NZBGet passes into the Post Process Script (in this case Subliminal.py) is a NZBPP_NZBFILENAME which is the full path to the NZB-File. Perhaps you're running an earlier (PP) script that is moving this on you (or another process is?). Perhaps my back end should get more clever and try to look in other spots if it can't find the file in the path passed. the SATA_DISK path isn't coming from my script at all.

Also, your logs seem to be written in the reverse order they actually get written in, what version of NZBGet are you using?

kloaknet
Posts: 337
Joined: 23 Jul 2014, 08:52

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by kloaknet » 07 Aug 2014, 15:39

My NZBGet runs on PCH-C200, the most recent version available for this device is the 13.0-testing-r963. I just copy your folder into the ppscript dir.

The log is upside down because I just copy the stuff from the GUI towards the forum :roll:

I guess the most usefull code block is at the end tbh.

Code: Select all

info	Thu Aug 07 2014 16:24:49	Collection Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO added to history
info	Thu Aug 07 2014 16:24:49	Cleaning up download queue for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO
info	Thu Aug 07 2014 16:24:49	Unpausing download after post-process-script
info	Thu Aug 07 2014 16:24:49	Post-process-script subliminal/Subliminal.py for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO skipped
info	Thu Aug 07 2014 16:24:49	Subliminal: 2014-08-07 16:24:49,105 - 30214 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 16:24:48	Subliminal: 2014-08-07 16:24:48,754 - 30214 - INFO - Connected to SQLite Database
info	Thu Aug 07 2014 16:24:41	Subliminal: 2014-08-07 16:24:41,167 - 30214 - WARNING - NZB-File not found: /opt/sybhttpd/localhost.drives/SATA_DISK/Download/Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO.nzb
info	Thu Aug 07 2014 16:24:41	Subliminal: 2014-08-07 16:24:41,153 - 30214 - INFO - Script Mode: POSTPROCESS
info	Thu Aug 07 2014 16:24:35	Subliminal: nzbget.conf(1199): Invalid value for option "Task1.Time": "Hؒ"
info	Thu Aug 07 2014 16:24:35	Executing post-process-script subliminal/Subliminal.py for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO
info	Thu Aug 07 2014 16:24:35	Post-process-script FailureLink.py for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO skipped
info	Thu Aug 07 2014 16:24:34	FailureLink: nzbget.conf(1199): Invalid value for option "Task1.Time": "Hؒ"
info	Thu Aug 07 2014 16:24:34	Executing post-process-script FailureLink.py for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO
info	Thu Aug 07 2014 16:24:33	Cleanup for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO successful
info	Thu Aug 07 2014 16:24:33	Deleting file ux01jlvi7gow8sj036hkvr6xbruc67ve.par2
info	Thu Aug 07 2014 16:24:33	Cleaning up Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO
info	Thu Aug 07 2014 16:24:33	Pausing download before cleanup
info	Thu Aug 07 2014 16:24:33	No renamed files found for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO
info	Thu Aug 07 2014 16:24:33	Checking renamed files for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO
info	Thu Aug 07 2014 16:24:33	Unpausing download after unpack
info	Thu Aug 07 2014 16:24:33	Unpack for Teen.Wolf.S04E07.PROPER.480p.HDTV.x264-REenCO successful
info	Thu Aug 07 2014 16:24:33	Deleting file ux01jlvi7gow8sj036hkvr6xbruc67ve.r02
The below release did get the TV category assigned via the CATEGORIES mapping option, a

(for some strange reason NZBGet has an issue with the scheduler option in it (not related to subliminal), while Task1.Time=00:00 is set in the log)

Code: Select all

info	Thu Aug 07 2014 16:51:02	Post-process-script subliminal/Subliminal.py for Turn.S01E10.HDTV.x264-KILLERS skipped
info	Thu Aug 07 2014 16:51:02	Subliminal: 2014-08-07 16:51:02,400 - 1047 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 16:51:01	Subliminal: 2014-08-07 16:51:01,001 - 1047 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 16:51:00	Subliminal: 2014-08-07 16:51:00,719 - 1047 - INFO - Connected to SQLite Database
info	Thu Aug 07 2014 16:50:51	Subliminal: 2014-08-07 16:50:51,772 - 1047 - WARNING - NZB-File not found: /opt/sybhttpd/localhost.drives/SATA_DISK/Download/Turn.S01E10.HDTV.x264-KILLERS.nzb
info	Thu Aug 07 2014 16:50:51	Subliminal: 2014-08-07 16:50:51,747 - 1047 - INFO - Script Mode: POSTPROCESS
info	Thu Aug 07 2014 16:50:44	Subliminal: nzbget.conf(1199): Invalid value for option "Task1.Time": "Hؒ"
info	Thu Aug 07 2014 16:50:44	Executing post-process-script subliminal/Subliminal.py for Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 16:50:44	Post-process-script FailureLink.py for Turn.S01E10.HDTV.x264-KILLERS skipped
info	Thu Aug 07 2014 16:50:42	FailureLink: nzbget.conf(1199): Invalid value for option "Task1.Time": "Hؒ"
next try (re post processing, after soft reload after having removed the scheduler option)

Code: Select all

info	Thu Aug 07 2014 17:01:18	Collection Turn.S01E10.HDTV.x264-KILLERS added to history
info	Thu Aug 07 2014 17:01:18	Unpausing download after post-process-script
info	Thu Aug 07 2014 17:01:18	Post-process-script subliminal/Subliminal.py for Turn.S01E10.HDTV.x264-KILLERS skipped
info	Thu Aug 07 2014 17:01:18	Subliminal: 2014-08-07 17:01:18,513 - 2736 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 17:01:17	Subliminal: 2014-08-07 17:01:17,154 - 2736 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 17:01:16	Subliminal: 2014-08-07 17:01:16,873 - 2736 - INFO - Connected to SQLite Database
info	Thu Aug 07 2014 17:01:10	Subliminal: 2014-08-07 17:01:10,267 - 2736 - WARNING - NZB-File not found: /opt/sybhttpd/localhost.drives/SATA_DISK/Download/Turn.S01E10.HDTV.x264-KILLERS.nzb
info	Thu Aug 07 2014 17:01:10	Subliminal: 2014-08-07 17:01:10,242 - 2736 - INFO - Script Mode: POSTPROCESS
info	Thu Aug 07 2014 17:01:03	Subliminal: nzbget.conf(1199): Invalid value for option "Task1.Time": "Hؒ"
info	Thu Aug 07 2014 17:01:03	Executing post-process-script subliminal/Subliminal.py for Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 17:01:03	Nothing to cleanup for Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 17:01:03	Cleaning up Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 17:01:03	Pausing download before cleanup
info	Thu Aug 07 2014 17:01:03	Queueing Turn.S01E10.HDTV.x264-KILLERS for post-processing
info	Thu Aug 07 2014 17:01:03	Turn.S01E10.HDTV.x264-KILLERS returned from history back to download queue
After a total restart of NZBGet, scheduler issue gone, and post proces the file again:

Code: Select all

info	Thu Aug 07 2014 17:05:04	Collection Turn.S01E10.HDTV.x264-KILLERS added to history
info	Thu Aug 07 2014 17:05:04	Unpausing download after post-process-script
info	Thu Aug 07 2014 17:05:04	Post-process-script subliminal/Subliminal.py for Turn.S01E10.HDTV.x264-KILLERS skipped
info	Thu Aug 07 2014 17:05:04	Subliminal: 2014-08-07 17:05:04,142 - 4323 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 17:05:02	Subliminal: 2014-08-07 17:05:02,772 - 4323 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 17:05:02	Subliminal: 2014-08-07 17:05:02,495 - 4323 - INFO - Connected to SQLite Database
info	Thu Aug 07 2014 17:04:55	Subliminal: 2014-08-07 17:04:55,625 - 4323 - WARNING - NZB-File not found: /opt/sybhttpd/localhost.drives/SATA_DISK/Download/Turn.S01E10.HDTV.x264-KILLERS.nzb
info	Thu Aug 07 2014 17:04:55	Subliminal: 2014-08-07 17:04:55,611 - 4323 - INFO - Script Mode: POSTPROCESS
info	Thu Aug 07 2014 17:04:49	Executing post-process-script subliminal/Subliminal.py for Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 17:04:49	Nothing to cleanup for Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 17:04:48	Cleaning up Turn.S01E10.HDTV.x264-KILLERS
info	Thu Aug 07 2014 17:04:48	Pausing download before cleanup
info	Thu Aug 07 2014 17:04:48	Queueing Turn.S01E10.HDTV.x264-KILLERS for post-processing
info	Thu Aug 07 2014 17:04:48	Turn.S01E10.HDTV.x264-KILLERS returned from history back to download queue
Note that the \Apps\NZBget\.nzbget\tmp\subliminal folder is created, and it contains the file subliminal.cache.dbm

another try with another file (newly added, only pp script is subliminal)

Code: Select all

info	Thu Aug 07 2014 17:17:36	Collection Under.the.Dome.S02E06.HDTV.x264-LOL added to history
info	Thu Aug 07 2014 17:17:36	Unpausing download after post-process-script
info	Thu Aug 07 2014 17:17:36	Post-process-script subliminal/Subliminal.py for Under.the.Dome.S02E06.HDTV.x264-LOL skipped
info	Thu Aug 07 2014 17:17:36	Subliminal: 2014-08-07 17:17:36,017 - 6682 - WARNING - No subtitles were found.
info	Thu Aug 07 2014 17:17:35	Subliminal: 2014-08-07 17:17:35,730 - 6682 - INFO - Connected to SQLite Database
info	Thu Aug 07 2014 17:17:28	Subliminal: 2014-08-07 17:17:28,238 - 6682 - WARNING - NZB-File not found: /opt/sybhttpd/localhost.drives/SATA_DISK/Download/Under.the.Dome.S02E06.HDTV.x264-LOL.nzb
info	Thu Aug 07 2014 17:17:28	Subliminal: 2014-08-07 17:17:28,203 - 6682 - INFO - Script Mode: POSTPROCESS
info	Thu Aug 07 2014 17:17:22	Executing post-process-script subliminal/Subliminal.py for Under.the.Dome.S02E06.HDTV.x264-LOL
info	Thu Aug 07 2014 17:17:22	Post-process-script FailureLink.py for Under.the.Dome.S02E06.HDTV.x264-LOL skipped
info	Thu Aug 07 2014 17:17:20	Executing post-process-script FailureLink.py for Under.the.Dome.S02E06.HDTV.x264-LOL
info	Thu Aug 07 2014 17:17:20	Cleanup for Under.the.Dome.S02E06.HDTV.x264-LOL successful
info	Thu Aug 07 2014 17:17:20	Deleting file 4nl416KNdRW0UnGjqMA73D4515mLOv20tN35J8L.vol15+14.PAR2

bgoldie
Posts: 20
Joined: 12 Jan 2013, 19:23

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by bgoldie » 07 Aug 2014, 20:52

kloaknet wrote:My NZBGet runs on PCH-C200, the most recent version available for this device is the 13.0-testing-r963.
Sorry to derail the topic but you can update NZBGet on the C200 without waiting for somebody to package it.

Download the latest Mipsel testing release e.g. nzbget-14.0-testing-r1070-bin-mipsel-static from here: http://nzbget.net/download
Extract the files and copy the default nzbget.conf (not YOUR main config file) into the webui folder and then copy the nzbget binary and the webui folder onto the Popcorn Hour into the .nzb folder. Restart NZBGet either by Telnet

Code: Select all

/nmt/apps/server/nzb stop
/nmt/apps/server/nzb start
or in the PCH gui (Usenet Client). Once it has restarted, you should be on the latest version.

If you have any questions please start a new topic or send them to me via PM.

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

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by hugbug » 08 Aug 2014, 18:58

l2g wrote:One of the arguments NZBGet passes into the Post Process Script (in this case Subliminal.py) is a NZBPP_NZBFILENAME which is the full path to the NZB-File.
NZBPP_NZBFILENAME is the original filename of nzb-file. After adding to queue it is renamed to .queued (or .2.queued if .queued was already there).

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

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by l2g » 09 Aug 2014, 12:24

kloaknet wrote:I guess the most usefull code block is at the end tbh
All is good :) You're right with that statement for sure.
hugbug wrote:NZBPP_NZBFILENAME is the original filename of nzb-file. After adding to queue it is renamed to .queued (or .2.queued if .queued was already there).
I like when you share tidbits like this! I will actually adjust my pynzbget to handle mulitple nzbfiles found now with the .queued extension. If i find more then one, i'll use the 'access' time of the file to determine the one most likely being used. Can i assume that your count keeps going... .3.queued, .4.queued, etc?)

Back on topic:
kloaknet: I haven't forgotten about the great testing you've been doing. But at this point, rather then debug further the copy that has been floating here, i'm going to post (and host on github) a complete rewrite of it which i'd much rather debug (easier). it doesn't rely on NZBGet (but works best with it of course). You can test it from the command line as well as use the scheduler to run against files that have been downloaded in the past. It'll be worth it, i promise! :)

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

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by l2g » 10 Aug 2014, 00:20

Okay,

The complete rewrite is done, packaged and pushed to GitHub.
Although i provide extra content (to be as transparent as possible), you really only need 2 directories from the contents of the repository to run the plugin:
  • Subliminal.py
  • Subliminal (the directory)
Copy both of these into your nzbget/scripts directory and you should be good to go.

Features:
  • * Post Processing remains available to you except with some extra features (hearing impaired, overwrite, and single mode).
    * Scheduling Support is available now as well. You can configure NZBGet to poll directories at regular intervals for subtitles in the event they weren't available during Post Processing. There is a variable for this entitled MaxAge which tells Subliminal that after a certain period elapses (relative to when the file was retrieved) to stop searching for subs. This prevents constantly hitting the internet for content that is just simply never going to be available to you.
    * CLI (Command Line Interface) allows you to the Subliminal.py manually if you like from the command line now. Run it with -h to see some options if you like. A simple command might be:
    • * Subliminal.py -f -S /a/path/to/your/show.mkv which simply scans the file specified and retrieves the subtitles for it if they exist.
      * Subliminal.py -f -S /a/path/to/your/show/directory which recursively scans a directory and fetches the subtitles for all videos it detects.
      * Subliminal.py -f -S /a/path/to/your/show/directory,/another/path/to/your/show/directory,/a/path/to/your/show/file.mp4 which lets you mix files and directories and scan everything in one command line. You'll note that i used the -f switch; this is only nessisary if the content your fetching wasn't recently obtained. Part of the security feature (used by the scheduler) is to only look at new stuff to prevent constantly thrashing over content that just has nothing to fetch from.
CLI Help Menu

Code: Select all

Usage: Subliminal.py [options]

Options:
  -h, --help            show this help message and exit
  -S DIR, --scandir=DIR
                        The directory to scan against. Note: that by setting
                        this variable, it is implied that you are not running
                        this from the command line.
  -a AGE, --maxage=AGE  The maximum age a file can be to be considered
                        searchable. This value is represented in hours
  -l LANG, --language=LANG
                        The language the fetch the subtitles in (en, fr, etc).
  -p PROVIDER1,PROVIDER2,etc, --providers=PROVIDER1,PROVIDER2,etc
                        Specify a list of providers (use comma's as
                        delimiters) to identify the providers you wish to use.
                        The following will be used by default: 'opensubtitles,
                        tvsubtitles,podnapisi,addic7ed,thesubdb'
  -s, --single          Download content without the language code in the
                        subtitle filename.
  -b, --basic           Do not attempt to parse additional information from
                        the video file. Running in a basic mode is much faster
                        but can make it more difficult to determine the
                        correct subtitle if more then one is matched.
  -f, --force           Force a download reguardless of the file age
  -o, --overwrite       Overwrite a subtitle in the event one is already
                        present.
  -m MODE, --fetch-mode=MODE
                        Identify the fetch mode you wish to invoke, the
                        options are: 'ImpairedOnly', 'StandardOnly',
                        'BestScore', 'StandardFirst', 'ImpairedFirst'.  The
                        default is BestScore
  -U USERNAME, --addic7ed-username=USERNAME
                        You must specify a Addic7ed username if you wish to
                        use them as one of your chosen providers.
  -P PASSWORD, --addic7ed-password=PASSWORD
                        You must specify a Addic7ed password if you wish to
                        use them as one of your chosen providers.
  -L FILE, --logfile=FILE
                        Send output to the specified logfile instead of
                        stdout.
  -D, --debug           Debug Mode
The CLI, Post Processing and Scheduling all easily wrap around the pynzbget framework I wrote.
* Aug 11th, 2014 Update: added basic/advance mode to emulate the filename/hash option that existed in the older script.
* Aug 23th, 2014 Update: New script modes, ImpairedOnly, StandardOnly, BestScore, ImpairedFirst, StandardFirst

Thank you HugBug for all your help in explaining how the scheduing works and ways to detect one type of processing from another!
Last edited by l2g on 23 Aug 2014, 19:05, edited 4 times in total.

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

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by hugbug » 11 Aug 2014, 10:03

Can you bring option SearchMode back?

Code: Select all

# Search mode (filename, hash).
#
# Filename - the program guesses informations from file name and a text-based
#            search will be done with services.
# Hash - hashes of the file will be computed and used during the search for
#        services that supports this functionnality. This produces best
#        results but reading of video files and computing of hashes take
#        time and is a CPU intensive process.
#SearchMode=filename
I'd rather risk fetching wrong subtitles than wait 10 minutes or more for every downloaded video file.

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

Re: [PP-Script] Subliminal - Subtitles, faster than your tho

Post by l2g » 11 Aug 2014, 20:50

hugbug wrote:Can you bring option SearchMode back?
Done (commit bc53de)! :)

I just renamed the convention slightly from hash/filename to basic/advanced. It defaults to the full out processing, but you can switch your's back to basic and it should work as you intended (much, much faster, but less accuracy). I also added it to the CLI for testing -b (--basic) and of course for just manual use.

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests