Release: Subliminal Subtitles (Addic7ed, Podnapisi, OpenSubtitles)

Subliminal uses multiple providers to give users a vast choice and have a better chance to find the best matching subtitles. Providers are extensible through a dedicated entry point.

  • Addic7ed
  • BierDopje
  • OpenSubtitles
  • Podnapisi
  • TheSubDB
  • TvSubtitles


thx to @bramwalet & @panni for developement

Download at https://github.com/pannal/Sub-Zero 

@panni said:
I've just moved my Subliminal.bundle fork into Sub-Zero. [Please continue here.]
Thanks again bramwalet for providing the initial plugin, and thanks to all of you helping to improve this bundle. Please continue to do so in the dedicated Sub-Zero thread.


This looks like a really cool library. I really like the idea of the combined search interfaces.

Unfortunately, it has a lot of dependencies. Most notably beautifulsoup, but there are others. So just taking this code a trying to adapt it to a Plex subtitle plugin would require every user to manually install a lot of external packages. While not impossible, it's a big hurdle. I don't know how many support questions I've had in just creating the symlinks required for non-appstore plugins so that Plex won't delete them.

Now, had subliminal been made into a webservice it could really be a good provider.

Cheers

There is a similar standalone library that I used when I had Mediaportal. Subtitledownloader library with built in providers as well as a LOT of customised addons.

Not sure which one should be easier to implement.
http://www.team-mediaportal.com/extensions/movies-videos/subtitledownloader


At least jwdempsey has made my day with his PlexTools plugin. Manual and automatic subtitle download from opensubtitles and subtitles are stored in a proper way alongside the video.

Skickat från min GT-I9505 via Tapatalk

I am currently working on a subliminal plugin agent for plex.


If anyone wants to participate in an alpha test, please let me know.


Features for now:

  • focused on TV series,
  • search all currently supported providers,
  • download best matching subtitles with default settings
  • store subtitle file next to movie file in media Dir


    Preferences:
  • enable/disable specific providers in agent preferences
  • supply credentials for addic7ed


    Please let me know if you are interested.

I am currently working on a subliminal plugin agent for plex.

If anyone wants to participate in an alpha test, please let me know.

Features for now:
- focused on TV series,
- search all currently supported providers,
- download best matching subtitles with default settings
- store subtitle file next to movie file in media Dir

Preferences:
- enable/disable specific providers in agent preferences
- supply credentials for addic7ed

Please let me know if you are interested.

this sounds amazing !! 

is there a github project to this ?

Yes, you can find the bundle on my github account:

https://github.com/bramwalet/Subliminal.bundle


Please note that its an alpha version and not finished yet…


Install as usual, but make sure subliminal plugin is above LocalMedia agent plugin in list of metadata agents of both TV series and movies.

This is because subliminal places SRT files next to media files. They will be scanned by local media plugin and visible in Plex. If you do not place the plugin above local media, it requires a refresh of metadata for the subtitles to appear.


Please report any issues on the github project with plugin log file.


Enjoy the plugin!

ok. i'm glad to test it.

Hey,

I'd love to try this out, but it isn't showing up in my PMS.

Main Error log:

Jul 18, 2014 00:05:06 [0x7f326bfff700] DEBUG - Request: [127.0.0.1:49184] GET /:/plugins/com.plexapp.agents.subliminal (6 live)
Jul 18, 2014 00:05:06 [0x7f326bfff700] WARN - Request for plug-in [com.plexapp.agents.subliminal] but it doesn't exist.
Jul 18, 2014 00:05:06 [0x7f326bfff700] VERBOSE - Completed request: GET /:/plugins/com.plexapp.agents.subliminal: 404
Jul 18, 2014 00:05:07 [0x7f3268ff9700] DEBUG - [com.plexapp.agents.subliminal] Agent not known by system, so we're starting for sure.
Jul 18, 2014 00:05:07 [0x7f3268ff9700] DEBUG - Starting file watcher for com.plexapp.agents.subliminal
Jul 18, 2014 00:05:07 [0x7f3268ff9700] DEBUG - Spawned plug-in com.plexapp.agents.subliminal with PID 9761
Jul 18, 2014 00:05:07 [0x7f3268ff9700] DEBUG - [com.plexapp.agents.subliminal] Sending command: GET /:/prefixes

Plugin main log:

cat Logs/PMS\ Plugin\ Logs/com.plexapp.system.log |grep subliminal
2014-07-18 00:05:06,032 (7fa1ae7fc700) :  INFO (agentservice:158) - Agents in com.plexapp.agents.subliminal not in info dictionary - pinging!
2014-07-18 00:05:06,032 (7fa1ae7fc700) :  DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.subliminal'
2014-07-18 00:05:06,037 (7fa1ae7fc700) :  ERROR (networking:223) - Error opening URL 'http://127.0.0.1:32400/:/plugins/com.plexapp.agents.subliminal'
 

Update: got it, wrong permissions on plugin folder.

Would it be possible to add a scraper for subscene.com? And would it be possible to sort the providers to my likings? How good is the subliminal auto-guess-best-subtitle? (I've found subscene/addic7ed to be way better than opensubtitles.org).

Thank you!

Update 2, some errors:

2014-07-18 00:13:40,991 (7fa813fff700) :  CRITICAL (agentkit:974) - Exception in the update function of agent named 'Subliminal Movie Subtitles', called with guid 'com.plexapp.agents.imdb://tt0499549?lang=en' (most recent call last):
  File "/bulk/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 972, in _update
    agent.update(obj, media, lang)
  File "/bulk/Library/Application Support/Plex Media Server/Plug-ins/Subliminal.bundle/Contents/Code/__init__.py", line 79, in update
    videos.append(scannedVideo)
NameError: global name 'videos' is not defined

You're missing videos = [] in #69

Update 3:

Would it be possible to place the downloaded subtitles in a (configurable) subfolder (./subs for example)? The default behaviour heavily clutters the series folders for me.

Update 4:

I'm getting several series without subtitle results perhaps originating at:

2014-07-18 01:10:14,464 (7f145effd700) :  DEBUG (logger:21) - subliminal.providers: Skipping discarded provider 'podnapisi'
2014-07-18 01:10:14,464 (7f145effd700) :  DEBUG (logger:21) - subliminal.providers: Skipping discarded provider 'addic7ed'
2014-07-18 01:10:14,464 (7f145effd700) :  DEBUG (logger:21) - subliminal.providers: Skipping discarded provider 'tvsubtitles'

Those are found by running subliminal -leng "filename", though ...

Update 5:

https://github.com/bramwalet/Subliminal.bundle/issues/2

Both issues handled on github. Thanks for your feedback.


This plugin is dependent on the subliminal library, I could add providers myself later, but first get the main features stable.


We can only influence the matching by a limited number of settings. If you are familiar with API docs, take a look at theirs: http://subliminal.readthedocs.org/en/latest/api/api.html


I could make certain flags (hearing impaired) or minimum score a Preference. But I am not sure if I can set the order of preference for providers. But you could disable certain providers.


A configurable sub folder is only useful if this will be picked up by local media agent. I am not sure if it does.

Another option is to store the subtitles as metadata, just like podnapisi agent or open subtitles agent. But placing the sub on the filesystem is the default behavior of the API.

The only different folder the LocalMedia plugin currently handles is (that was to my surprise, given the rant thread from 3 years ago in this forum regarding that matter) the global Subtitles folder:

https://github.com/plexinc-agents/LocalMedia.bundle/blob/master/Contents/Code/localmedia.py#L138

I'm going to look into subtitle-subfolders, just forked the LocalMedia agent.

Where is the global subtitle folder located, somewhere inside the application folder of Plex Media Server? Not relative to the media folders, I think?

Can’t find anything on

Core.app_support_path

Library/Application Support/Plex Media Server/Subtitles if I read the source correctly

hey, bramwalet, two things. please open another thread, i would suggest, as soon as you reach beta. Because i can't change the Topic , which says "request" instead of "release" which it is now.

and than, i would recommend to talk to the dev of the Unsupported Appstore , so that this wonderful plugin keeps automatically updated on our PMS.

again, thank you very much. great work. i'll check it as soon as i have time to.

I've added the following features to the Subliminal agent (I guess it will be merged into master soon):

- subtitle folder selection

- custom subtitle folder

https://github.com/pannal/Subliminal.bundle

Also, for supporting those features, please install LocalMediaExtended.bundle:

https://github.com/pannal/LocalMediaExtended.bundle

Without that, the folders aren't recognized. You should disable your "Local Media Assets" plugin and enable "Local Media Assets Extended", and place it just below the Subliminal agent (which should be placed topmost in the list).

Hi snikay, will open a new thread once we reach beta. But for now, it's relatively unstable and new features are added quite fast.

Today together with panni we added the following features:

- Save subtitles in subfolders or a global folder, based on preferences

- Save subtitles as metadata (this is the default) or on the filesystem

- Set 'hearing impaired'  and 'minimum score'  when searching for best subtitles in preferences

I also prepared the license files of the bundle and all referenced libraries. So I think we can start beta soon, and I will submit the bundle to the unofficial appstore also. 

So if you have already checked out the github repo, please update. And if you want to check this bundle out, now is a good time.

Let me know what you think, if you find any issues or have feature requests, please submit them to the github project or create a pull request.

i just checked it out. and it is amazing ! THIS is how a subtitle-Agent should look like! THANKS!

The only thing i think is that "Subtitle Folder ("current folder" is the folder the current media file lives in)" should only be visible/clickable if "Store subtitles next to media files (instead of metadata)" is checked.

Same goes for the login credentials of Addic7ed. If this is possible. But everything else is just fantastic !

Ps. what do you guys think, is the best minimum score to download ? maybe around 80 ? 

I’m glad you like it!

But I am afraid its not possible to disable or enable certain preferences.

oh.. ok. well , than this is just perfect :)

How is this agent triggered? Only on adding new files or will it also search at specific interval? Usually subtitles are not available at the time I download tv series but maybe a week later or so.


Skickat från min GT-I9505 via Tapatalk

How is this agent triggered? Only on adding new files or will it also search at specific interval? Usually subtitles are not available at the time I download tv series but maybe a week later or so.

This agent is triggered when a new file is added or a refresh is triggered in the Plex client. This is default metadata agent behavior.

I can imagine you want to keep searching for best matching subtitles. There are multiple ways to do this. But they would all require a metadata refresh from Plex.

The best way I think there is, is to use Plex Media Scanner and schedule it to refresh a certain section of your library. See the article on the Plex website: https://support.plex.tv/hc/en-us/articles/201242707-Plex-Media-Scanner-via-Command-Line

Please be aware that the subliminal agent can be configured to include/exclude embedded and external subtitles in the search. When existing subtitles are present, no providers will be searched for subtitles (given that they provide the right language). If you want to have subtitles as soon as they become available, this is going to work. If you want to update subtitles and download better matching ones, then you should disable these settings. Subliminal caches the download results so whenever you re-download a file, you are not going to hit the subtitle provider site. But be aware that certain providers might block users/IP when a lot of downloads take place. With a full library refresh, this could become an issue.

Using other methods (such as running Subliminal standalone on a scheduled interval) would still require you to refresh metadata, using Local Media plugin, to make sure Plex Media Server picks up the new subtitles. 

Ps. what do you guys think, is the best minimum score to download ? maybe around 80 ? 

I just figured out that for episodes a setting of 0-71 is recommended and for movies a setting of 0-31 is recommended. So this is a problem because the Preferences currently only support one setting both for movies and for series. So I created an issue on github to resolve this somehow.

But I think the value should be somewhat lower, if you look at the debug logs of the plugin you can see what matches are found and which of the subtitle is chosen.

You can find the following statements in the logfile:

INFO (logkit:16) - subliminal.subtitle: Computed score 74 with matches set([u'series', u'year', u'episode', u'hash', u'season'])

And the subtitle that will be downloaded can be found with a statement looking like this:

INFO (logkit:16) - subliminal.api: Downloading subtitle with score 74

A subtitle which is matched using a hash for OpenSubtitles has a score of 74, without hash I can see a value of 60.

So I suggest you take a look at the values in your logfile and find a good minimum setting based on the result you get.