Giter Club home page Giter Club logo

nzb-subliminal's Introduction

Note: This script was intended to be an NZBGet post-processing and scheduling script wrapper for Subliminal. The script will work with SABnzbd (starting at v2.0.0+) and can also work fine as a standalone script for others too. See the Command Line section below for details how you can easily use this on it's own (without NZBGet or SABnzbd).

Paypal

Subliminal Processing Script

Subliminal was originally written by Antoine Bertin (Diaoul Ael). This tool I'm hosting here merely acts as a wrapper to it by enhancing the great functionality it already provides. Subliminal allows us to take a video file (and/or a directory containing videos) you provide it. From there it makes use of a series of websites in efforts to obtain the subtitles associated with the videos it scanned. This wrapper extends this functionallity by controlling how many interenet requests are made for videos without subtitles. This script will prevents querying videos over and over again that simply don't have subtitles at all.

I do however maintain a fork of the Subliminal 0.7.x branch here where I've added my own enhancements to help make this tool do what I want to. Enhancments such as:

  • The script pays attention to the date of the files and only acts on those that are within a certain (configurable) timeframe; the default age is 24 hours. This works really amazing for NZBGet users, but for those using this tool in it's standalone version may find it works for them too. This feature allows you to control how many times the internet is polled against a video that has never had subtitles posted for it. There is more detail on this below in the Command Line section on how to use (or disable) this feature.
  • The script can operate in one of 5 modes:
    • ImpairedOnly: Only attempt to fetch subtitles that are identified as supporting the hearing impaired. Note: This is not an enhancment and exists in the current version of subliminal.
    • StandardOnly: Only attempt to fetch subtitles that are NOT identified as supporting the hearing impaired. Note: This is not an enhancment and exists in the current version of subliminal.
    • BestScore: Just download the best matched subtitles reguardless of whether they are for the hearing impaired or not. Note: This is the default option.
    • ImpairedFirst: This is similar to the BestScore mode above; except the script scores (weighs) the hearing impaired matches a bit higher in efforts to make them be priority over any other subtitles matched.
    • StandardFirst: This is similar to the BestScore mode above; except the script scores (weighs) the hearing impaired matches a bit lower in efforts to make them be the last to be considered as a match.
  • Python v2.6 Support in efforts to target a broader audience.

Most of my changes actually made it back into the original source code (pull request #404). However I still like to maintain my own fork in case of an unforseen enhancment gets pushed upstream that breaks this wrapper.

This tool can also notify you using Apprise when a subtitle has been retrieved too!

Installation Instructions

  1. Ensure you have Python v2.7 installed onto your system.
# Pull in dependencies:
pip install -r requirements.txt
  1. Simply place the Subliminal.py and Subliminal directory together.
    • NZBGet users: you'll want to place these inside of your nzbget/scripts directory. Please ensure you are running (at least) NZBGet v11.0 or higher. You can acquire the latest version of of it from here.
    • SABnzbd users: you'll want to place these inside of your sabnzbd/scripts directory. You may also want to read this wiki link on maintaining your own Subliminal's Configuration file.
    • The Non-NZBGet and SABnzbd users can also use this script via a cron (or simply call it from the command line) to automatically poll directories for the latest subtitles for the video content within it. See the Command Line section below for more instructions on how to do this.

Note: The Subliminal directory provides all of the nessisary dependencies in order for this script to work correctly. The directory is only required if you do not have the packages already available to your global environment. These dependant packages are all identified under the Dependencies section below.

Supported Subtitle Sites

The table below identifies the provider Subliminal.py supports and the location that content is retrieved from.

Provider Source
addic7ed http://www.addic7ed.com/
opensubtitles http://www.opensubtitles.org/
tvsubtitles http://www.tvsubtitles.net/
podnapisi http://www.podnapisi.net/
thesubdb http://thesubdb.com/

Dependencies

The following dependencies are already provided for you within the Subliminal directory and no further effort is required by you. However, it should be known that Subliminal.py depends on the following packages:

Name Version Source
pysrt 1.0.1 https://pypi.python.org/pypi/pysrt/1.0.1
babelfish 0.5.4 https://pypi.python.org/pypi/babelfish/0.5.4
beautifulsoup4 4.3.2 https://pypi.python.org/pypi/beautifulsoup4/4.3.2
python-dateutil 2.2 https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz
dogpile-cache 0.5.4 https://pypi.python.org/pypi/dogpile.cache/0.5.4
dogpile-core 0.4.1 https://pypi.python.org/pypi/dogpile.core/0.4.1
enzyme 0.4.1 https://pypi.python.org/pypi/enzyme/0.4.1
guesslanguage 0.2.1 https://pypi.python.org/pypi/guesslanguage/0.2.1
guessit 0.10.3 https://pypi.python.org/pypi/guessit/0.10.3
html5lib 0.999 https://pypi.python.org/pypi/html5lib/0.999
ordereddict 1.1 https://pypi.python.org/pypi/ordereddict/1.1
repoze.lru 0.6 https://pypi.python.org/pypi/repoze.lru/0.6
setuptools 0.6.10 http://svn.python.org/projects/sandbox/branches/setuptools-0.6/pkg_resources.py
silpa_common 0.3 https://pypi.python.org/pypi/silpa_common/0.3
six 1.6.1 https://pypi.python.org/pypi/six/1.6.1
stevedore 0.14 https://pypi.python.org/pypi/stevedore/0.14
subliminal [P] 0.7.5 https://pypi.python.org/pypi/subliminal/0.7.5
pyasn1 0.1.7 https://pypi.python.org/pypi/pyasn1/0.1.7
pyxdg 0.25 https://pypi.python.org/pypi/pyxdg/0.25
chared 1.2.1 https://code.google.com/archive/p/chared/
decorator 4.3.0 https://pypi.org/project/decorator/4.3.0

Note: The items above denoted with a [P] were patched in efforts to:

  • Make their libaries compatible with Python v2.6.
  • Fix bugs to add stability to the overall functionality.
  • Add the nessesary enhancments that benifit this wrapper tool.

To be as transparent as possible, all patches have been provided in the /patches directory.

Command Line

Subliminal.py has a built in command line interface that can be easily tied to a cron entry or can be easilly called from the command line to automate the fetching of subtitles.

Here are the switches available to you:

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 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. The
                        default value is 24 hours.
  -n ENCODING, --encoding=ENCODING
                        The system encoding to use (utf-8, ISO-8859-1, etc).
                        The default value is 'UTF-8'.
  -l LANG, --language=LANG
                        The language the fetch the subtitles in (en, fr, etc).
                        The default value is 'en'.
  -p PROVIDER1,PROVIDER2,etc, --providers=PROVIDER1,PROVIDER2,etc
                        Specify a list of providers (use commas as delimiters)
                        to identify the providers you wish to use. The
                        following will be used by default: 'opensubtitles,tvsu
                        btitles,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.
  -x PATH1,PATH2,etc, --cross-reference=PATH1,PATH2,etc
                        Specify an optional list of directories to scan for
                        subs first before checking on the internet. This is
                        for directories containing subs (.srt files) that you
                        have already downloaded ahead of time.
  -z SIZE_IN_MB, --minsize=SIZE_IN_MB
                        Specify the minimum size a video must be to be worthy
                        of of checking for subtiles. This value is interpreted
                        in MB (Megabytes) and defaults to 150 MB.
  -c MINSCORE, --minscore=MINSCORE
                        When scoring multiple matched subtitles for a video,
                        this value identifies the threshold to assume the
                        subtitle is no good and should be thrown away when
                        being compared against others. It currently defaults
                        to 20.
  -k, --ignore-embedded
                        If embedded subtitles were detected, choose not to use
                        them and continue to search for the subtitles hosted
                        by the identified provider(s).
  -e ENCODING, --force-encoding=ENCODING
                        Optionally specify the subtitle's file encoding toa
                        specific type (utf-8, ISO-8859-1, etc). If none is
                        specified then the file is left as is.
  -f, --force           Force a download reguardless of the file age. This
                        switch negates any value specified by the --age (-a)
                        switch.
  -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 value is: BestScore
  --addic7ed-user=USER  Optionally use login credentials when accessing
                        Addic7ed's server. This option is ignored if the
                        --addic7ed-pass switch is not specified.
  --addic7ed-pass=PASS  Optionally use login credentials when accessing
                        Addic7ed's server. This option is ignored if the
                        --addic7ed-user switch is not specified.
  --opensubs-user=USER  Optionally use login credentials when accessing Open
                        Subtitles's server. This option is ignored if the
                        --opensubs-pass switch is not specified.
  --opensubs-pass=PASS  Optionally use login credentials when accessing Open
                        Subtitles's server. This option is ignored if the
                        --opensubs-user switch is not specified.
  -t, --tidy-subs       Post process tidying of subtitle.
  -u URL(s), --notify-urls=URL(s)
                        Specify 1 or more notification URLs in their URL
                        format ie: growl://mypass@localhost. See
                        https://github.com/caronc/apprise for more information
                        on the different kinds of supported Notification URLs.
  -T COUNT, --throttle-threshold=COUNT
                        The threshold defines the number of concurrent
                        requests made to the remote subtitle websites before a
                        temporary wait/pause occurs (defined by --throttle).
                        The goal of the threshold is to prevent one from being
                        banned for abusing the server (which can happen if you
                        make to many requests).  This setting is ideal for
                        those users who are scanning and getting subtitles for
                        a very large media library. Set this value to 0
                        (zero) if you want to disable this feature. It
                        currently defaults to 5.
  -W SEC, --throttle=SEC
                        Defines the number of seconds a throttle/block will
                        occur for when/if a throttle threshold is reached. It
                        currently defaults to 3.
  -L FILE, --logfile=FILE
                        Send output to the specified logfile instead of
                        stdout.
  -D, --debug           Debug Mode

Here is simple example:

# Scan a single directory (recursively) for english subtitles
python Subliminal.py -s -f -S /usr/share/TVShows

# Or just omit the (recently) depricated -S switch to achive the same
# results:
python Subliminal.py -s -f /usr/share/TVShows

You can scan multiple directories with the following command:

# Scan a single directory (recursively) for english subtitles
python Subliminal.py -s -f -S "/usr/share/TVShows, /usr/share/Movies"

# Or just omit the (recently) depricated -S switch to achive the same
# results:
python Subliminal.py -s -f /usr/share/TVShows /usr/share/Movies

Another nice feature this tool offers is the ability to expire the need to check certain content over and over again. Considering that most of us keep all our videos in one common location. It would be excessive overkill to poll the internet each and every time for each and every file we have (for subtitles) over and over again. We can assume, that if there are no subtitles for a given video within the last 24 hours of it's existance on our system, then there simply aren't going to be any later. I realize this isn't always the case; but for most situations it will be.

In the above examples, I provided a --force (-f) switch which bypasses this feature. But if you want to set up a cron entry to scan your library on a regular basis, this feature can save you time and effort. A cron could be easily configured to scan your library every hour as so:

# $> crontab -e
0 * * * * /path/to/Subliminal.py -s /usr/share/TVShows /usr/share/Movies

If 24 hours seems to short of a window for you, then just specify the --age (-a) switch and adjust the time to your needs. Remember: it's value is represented in hours.

nzb-subliminal's People

Contributors

caronc avatar sguillope avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nzb-subliminal's Issues

Individual files support?

Does it work with individual files? For now, I get something like this:

> ./Subliminal.py -p addic7ed,opensubtitles,podnapisi ~/Desktop/Inland\ Empire.avi
2015-04-09 08:00:13,479 - 38486 - INFO - There were no files found.

While Podnapisi service for sure has the requested subtitles.

Just in case of age questions:

> ls -ltr ~/Desktop/Inland\ Empire.avi
-rw-rw-rw-  1 zoroo  staff  2205722624 Apr  9  2015 Inland Empire.avi

language code in subtitle filename

hi caron,

this is only an aesthetics issue, but can you add the country code letters - e.g. "en" for english to the filename?

my media player, plex picks up on this info and displays it. without it, it only shows "unknown" next to the subtitle.

cheers,

dave

Default category

Just installed the subliminal script and I noticed that the default TV category for the post-processing mode is "tv, tv2". While nzbget defaults to "Series", might be better to include that as well :)

SkipEmbedded does not always work on .mkv files containing subtitles

I'm a little confused as to how the SkipEmbedded setting works. The description is:

Identify how you want to handle embedded subititles if they are detected in the video file being scanned. If you set this value to 'no', you will use match embedded subtitles instead and further no further script processing will take place.
If you set this to 'yes', you will ignore the fact that embedded subtitles were detected and just continue to exersice this tool to fetch some from the providers identified.
NOTE: Embedded subtitles can only be detected if you are using the advanced search mode identified above. Therefore this switch has no bearing on a Basic check.

What i want is to get subtitles for all of my listed languages. But if one of these languages exist as an embedded subtitle, do not look for that language, but still look for and download the remaining languages. Is this possible?
I think i want to set this to 'no' but then if an embedded english subtitle exists I will wind up with 2 english subtitles(one embedded and one external)

Search for pt-BR subtitles

Hi!

What option should I use when searching for brazilian portugue subtitles? I've tried:
-l pt-BR, pob, pb

The result is:
An error occured processing the language list

If I use "pt" I end up fetching portugues subs.

Thanks!

MIN_SCORE

Is it possible to use: -m MIN_SCORE, --min-score MIN_SCORE
?

SyntaxError: invalid syntax, line 389

SyntaxError: invalid syntax
File "Subliminal/Subliminal.py", line 389
DEFAULT_VIDEO_PERMISSIONS = 0o644

Getting this suddenly. Should it be 0644 perhaps ? I'll try and close if it works like that.

Python error

When running this script on a standard ubuntu 16.04 server I get the following error:

ValueError: A 0.7-series setuptools cannot be installed with distribute. Found one at /usr/lib/python2.7/dist-packages

The fix I have been applying is from this thread thanks to ronajon.

easiest (and dirtiest) way is to change value '0.7' on line 2275 of file 'Subliminal/pkg_resources.py to another value. eg 0.6

I have setup nzbget-subliminal a few different times in the last few months and every time I have had to make this change before anything will work.

Question/Feature Request: SRT files only

I'm gonna switch from filebot to subliminal today and was wondering if subliminal could force .srt files only like filebot can ? I don't want any other formats like sub/idx/ssa/etc.

In filebot I can do --output srt to only have it download srt files. Is there such a thing in subliminal ? Or does it do this by default already ?

Launching script as Post-Processing is detected as cli

Hi,

I have an issue where when adding the script as Post-Processing yields the result INFO - There were no files found.

After some digging, this is related to that check : https://github.com/caronc/nzbget-subliminal/blob/master/Subliminal.py#L2119

When launched as Post-Process, NZBGet calls the script with a star * argument, which prevents the code from being detected as a post-process, since it sets the scandir variable. I don't know why the script is called with this argument. I'm using NZBGet version 18.1.

I've managed to fix it using this:

elif len(_args) and _args[0] != '*':

Would this fix be accepted as a PR? Or is there something more to it?

Some subtitles have question marks.

Some subtitles have question marks that are replacing central european characters..first i thought that problem was with subtitle writers, i thought that they didnt encoded properly files.. first i tried to put my keyboard in windows to serbian, than i tried to change in control panel/region/change system locale to serbian, then i tried to save srt file with notepad but with ansi encoding, and nothing changed..next i tried to put different encodes in your script
-n ISO-8859-2
-n ISO-8859-16
-n ISO-8859-5
-n Windows-1250
also i tried with -e command all those encodings, and nothing
than i went to opensubtitles (i tested two movies and both srt files were downloaded in serbian and from opensubtitles with nzb subliminal) and downloaded every srt file for that movies in serbian to see will i get question marks, but every subtitles was ok..i found exact subtitles that nzb subliminal downloaded and only difference is that when subtitle is downloaded with nzb i get opensubtitles ad at the start of the subtitle, everything else is the same. here are two screenshots for you to see

https://imgur.com/pBUq3cD
https://imgur.com/56dX3Mg

on the left is subtitle i downloaded from opensubtitles, on the right is subtitle downloaded with nzb subliminal..

edit: today i downloaded 11 movies with radarr, and last six moves that were downloaded have subtitles with question marks..i saw that radarr dont put movies in folders when movie is downloaded, it was done when all movies was downloaded..so than subtitle script was started.. maybe it help

Guessit issues

Scanning video u'Scorpion.2014.S0E06.1080p.x264.WEB-DL.NLSubs-QoQ.mkv' in u'/mnt/download/complete/SCORPION (2014) S01E06 x264 (WEB-DL) 1080p QUSTOM NLSubs'
2014-11-07 17:32:50,349 - 98162 - ERROR - Skipping video: Insufficient data to process the guess
2014-11-07 17:32:50,501 - 98162 - ERROR - Fatal Exception:
Traceback (most recent call last):
File "/root/nzbget-subliminal-master/Subliminal/nzbget/ScriptBase.py", line 2139, in run
exit_code = main_function(_args, *_kwargs)
File "/root/nzbget-subliminal-master/Subliminal.py", line 1107, in main
use_nzbheaders=False,
File "/root/nzbget-subliminal-master/Subliminal.py", line 710, in subliminal_fetch
use_nzbheaders=use_nzbheaders,
File "/root/nzbget-subliminal-master/Subliminal/subliminal/video.py", line 63, in fromguess
return Episode.fromguess(name, guess)
File "/root/nzbget-subliminal-master/Subliminal/subliminal/video.py", line 106, in fromguess
raise ValueError('Insufficient data to process the guess')
ValueError: Insufficient data to process the guess

WARNING - Provider 'podnapisi' is not available, discarding it

Hi, can i ask few questions?

First one is in the title. I installed nzb-subliminal yesterday, and from begining i geting this warning.. i plan to use podnapisi only, because there are good amount of serbian/croatian subtitles.. with opensubtitles i sometimes get subtitles that are copy paste from google translator..other providers dont have serbian/croatian subs..

Second question.. i'm using raspberry pi 3 with minidlna, so my srt file name must be the same like video file..podnapisi or opensubtitles sometimes dont have my primary serbian language srt file so i wanna add croatian language in command line -l sr,hr but than if two languages exist, subliminal will download both languages with rs.srt and hr.srt and than subtitle will not work on minidlna.. can i put two languages -l sr,hr and download only one subtitles with -s command

Third one.. i made a test.sh file from command line and put that file in the same folder where subliminal.py and subliminal folder is:
#!/bin/bash

python Subliminal.py -s -f -l sr,hr -p podnapisi,opensubtitles -e Windows-1250 -S
/mnt/dietpi_userdata/Video

and made that script executable with:
chmod a+x test.sh

when i test it with double click, everything work, so i put that test.sh in sonarr custom script to be triggered after sonarr download episode and i get error in sonarr log "python: can't open file 'Subliminal.py': [Errno 2] No such file or directory" what i'm doing wrong?
I managed to work out third question

And last one.. Titlovi.com is by far the best subtitles provider for Bosnian/Croatian/Macedonian/Slovenian/Serbian languages..there is a official Titlovi.com kodi plugin in the work https://github.com/tturkalj/service.subtitles.titlovi-com-official
How hard will it be to implement that code in your program?

Thanks for your time..

Encoding doesn't work.

My turkish, french and arabic subtitles (yes I have lots of Plex friends) are not showing properly. For turkish for example, the source encoding is ISO-8859-9. When I download the file from opensubtitles (http://dl.opensubtitles.org/nl/download/sub/6441695), and encode it myself using 'iconv' on linux, then it seems fine.

Subliminal fetched the same script and even though the encoding function did something, it didn't do it right. The special characters look different than in the original file, but they are still 'garbled'

let me know how I can help to fix this.

Solved: Not visible in WebUI NZBGET on Qnap

Hello,

Solved Issue: (anyway, solved for me, thought you migth want to know)

Change line 23 and 282 from

NZBGET POST-PROCESSING/SCHEDULER SCRIPT ### to:

NZBGET POST-PROCESSING SCRIPT

Then the script will be detected and visible in the WebUI from NZBGET 12 on Qnap, only then the setting can be made through WebUI.

John Halfords, The Netherlands

SABnzbd support

Hi, it's me again!

Would it be possible to maybe also include a script that can be used as SABnzbd post processing script?
https://sabnzbd.org/wiki/scripts/post-processing-scripts
I know ist basically a 1 line script, but it would make it easier for users.
We can then also list this extension on our website.
It worked great for NZB-notify, users love it :)

Loading configuration failed when copying nzbget-subliminal to scripts directory

Hi,

I'm using Fedora 23 and when I'm copying the nzbget-subliminal directory to the scripts directory of nzbget (version 16.4) and then click on settings I have this error message:

Loading configuration failed
Could not load template configuration file nzbget.conf. The file contains descriptions of options and is needed to display settings page. The file comes with NZBGet distribution archive and is usually automaically installed into the right location. This seems not to be a case with your installation though.

Please edit your configuration file (/usr/share/httpd/.nzbget) in a text editor and set the option ConfigTemplate to point to the template configuration file nzbget.conf.

I have no idea how to fix this and there is nothing in the logs. When I'm removing nzbget-subliminal from the scripts directory everything is working again and I can access the settings menu.

Any idea on how to debug that ?

Thanks in advance.

Regards,

Error with log output

I think this is possibly a bug in log output - here's a log of it looking for subs for a TV series, Cardinal, as called by a manual call:

C:\Utilities\SAB Post Processing Scripts>python Subliminal.py -f "I:\TV Library 04\Cardinal"

....this issue is that is seems to be looking for TV Library as the series name, rather than the series Cardinal - or so the log seems to imply. But I've checked the subs downloaded, and they are indeed for Cardinal. So think it's more of a log output issue than a real issue maybe...

Also - no idea what the the invalid file messages is about, there is no invalid file in there (and certainly not with such a funky name!)

Also - super super OCD level minor, but there's a type on the word service - Addic7ed using authentication serice.

2018-01-22 12:17:22,542 - 16872 - INFO - Found 9 matched file(s).
2018-01-22 12:17:22,542 - 16872 - INFO - Using advanced search mode
2018-01-22 12:17:22,796 - 16872 - WARNING - Skipping - Invalid file: ใฉ‰ๅ‘œโ–ๆฅŒ็‰ข็‰กโนใฐไœ็‰กๆฅคๆ…ฎๅฑฌๆ•“็กๆนฏใ€ ๅฐฑๆ…ƒๆ‘ฒๆนฉๆฑกโด ๅŒ ใ„ฐใ…โ€ฑโ€ญๆ…ƒๆ‘ฒๆนฉๆฑกๅœ ไ‰…ไฑ„ใ„ญใ ฐ็€ฐๆดฎ็™ซ
2018-01-22 12:17:22,855 - 16872 - INFO - Scanning video 'Cardinal - S01E03 - Edie and Eric WEBDL-1080p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 01'
2018-01-22 12:17:22,905 - 16872 - INFO - Scanning video 'Cardinal - S01E02 - Delorme WEBDL-1080p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 01'
2018-01-22 12:17:22,970 - 16872 - INFO - Scanning video 'Cardinal - S01E05 - Keith WEBDL-1080p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 01'
2018-01-22 12:17:23,020 - 16872 - INFO - Scanning video 'Cardinal - S01E04 - Woody WEBDL-1080p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 01'
2018-01-22 12:17:23,069 - 16872 - INFO - Scanning video 'Cardinal - S02E02 - Kevin HDTV-720p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 02'
2018-01-22 12:17:47,015 - 16872 - INFO - Addic7ed using authentication serice.
2018-01-22 12:17:47,789 - 16872 - INFO - Listing subtitles with provider 'opensubtitles' for video <Episode [u'TV Library', 2x2]> with languages set([<Language [en]>])
2018-01-22 12:17:48,194 - 16872 - INFO - Found 1 subtitle(s) on opensubtitles
2018-01-22 12:17:48,194 - 16872 - INFO - Listing subtitles with provider 'addic7ed' for video <Episode [u'TV Library', 2x2]> with languages set([<Language [en]>])
2018-01-22 12:17:48,591 - 16872 - INFO - Found 0 subtitle(s) on addic7ed
2018-01-22 12:17:48,591 - 16872 - INFO - Listing subtitles with provider 'tvsubtitles' for video <Episode [u'TV Library', 2x2]> with languages set([<Language [en]>])
2018-01-22 12:17:48,592 - 16872 - INFO - Found 0 subtitle(s) on tvsubtitles
2018-01-22 12:17:48,617 - 16872 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [en]> with score 46 into u'Cardinal - S02E02 - Kevin HDTV-720p.srt'
2018-01-22 12:18:07,936 - 16872 - INFO - Successfully placed Cardinal - S02E02 - Kevin HDTV-720p.srt
2018-01-22 12:18:07,959 - 16872 - INFO - Post processing subtitles Cardinal - S02E02 - Kevin HDTV-720p.srt encoding.
2018-01-22 12:18:07,980 - 16872 - INFO - Scanning video 'Cardinal - S02E03 - Terri HDTV-720p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 02'
2018-01-22 12:18:20,375 - 16872 - INFO - Addic7ed using authentication serice.
2018-01-22 12:18:21,236 - 16872 - INFO - Listing subtitles with provider 'opensubtitles' for video <Episode [u'TV Library', 2x3]> with languages set([<Language [en]>])
2018-01-22 12:18:22,937 - 16872 - INFO - Found 1 subtitle(s) on opensubtitles
2018-01-22 12:18:22,938 - 16872 - INFO - Listing subtitles with provider 'addic7ed' for video <Episode [u'TV Library', 2x3]> with languages set([<Language [en]>])
2018-01-22 12:18:24,046 - 16872 - INFO - Found 0 subtitle(s) on addic7ed
2018-01-22 12:18:24,046 - 16872 - INFO - Listing subtitles with provider 'tvsubtitles' for video <Episode [u'TV Library', 2x3]> with languages set([<Language [en]>])
2018-01-22 12:18:24,046 - 16872 - INFO - Found 0 subtitle(s) on tvsubtitles
2018-01-22 12:18:24,059 - 16872 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [en]> with score 46 into u'Cardinal - S02E03 - Terri HDTV-720p.srt'
2018-01-22 12:18:34,306 - 16872 - INFO - Successfully placed Cardinal - S02E03 - Terri HDTV-720p.srt
2018-01-22 12:18:34,309 - 16872 - INFO - Post processing subtitles Cardinal - S02E03 - Terri HDTV-720p.srt encoding.
2018-01-22 12:18:34,332 - 16872 - INFO - Scanning video 'Cardinal - S02E01 - Red HDTV-720p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 02'
2018-01-22 12:18:48,717 - 16872 - INFO - Addic7ed using authentication serice.
2018-01-22 12:18:50,065 - 16872 - INFO - Listing subtitles with provider 'opensubtitles' for video <Episode [u'TV Library', 2x1]> with languages set([<Language [en]>])
2018-01-22 12:18:54,832 - 16872 - INFO - Found 1 subtitle(s) on opensubtitles
2018-01-22 12:18:54,832 - 16872 - INFO - Listing subtitles with provider 'addic7ed' for video <Episode [u'TV Library', 2x1]> with languages set([<Language [en]>])
2018-01-22 12:18:55,713 - 16872 - INFO - Found 0 subtitle(s) on addic7ed
2018-01-22 12:18:55,714 - 16872 - INFO - Listing subtitles with provider 'tvsubtitles' for video <Episode [u'TV Library', 2x1]> with languages set([<Language [en]>])
2018-01-22 12:18:55,716 - 16872 - INFO - Found 0 subtitle(s) on tvsubtitles
2018-01-22 12:18:55,729 - 16872 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [en]> with score 46 into u'Cardinal - S02E01 - Red HDTV-720p.srt'
2018-01-22 12:19:12,190 - 16872 - INFO - Successfully placed Cardinal - S02E01 - Red HDTV-720p.srt
2018-01-22 12:19:12,207 - 16872 - INFO - Post processing subtitles Cardinal - S02E01 - Red HDTV-720p.srt encoding.
2018-01-22 12:19:12,232 - 16872 - INFO - Scanning video 'Cardinal - S01E06 - Catherine WEBDL-1080p.mkv' in 'I:\\TV Library 04\\Cardinal\\Season 01'

KeyError: 'year'

Hi there.

I'm getting a fatal error with one particular video file:

The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4

(Just to explain the path used in the commands below, I subsequently placed this episode in a 'problematic' subfolder to enable faster testing/limited-to-relevant debug info.)

Release 0.10.0:

$ /opt/nzbget/scripts/Subliminal.py -D -t -e utf-8 -f '/media/Storage2/The Vietnam War (2017)/s01/problematic'
[INFO] [DEBUG] Script mode forced off.
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) TIDYSUB="True"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) TIDYSUB="1"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) FORCEENCODING="utf-8"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) FORCEENCODING="utf-8"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) FORCE="True"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) FORCE="1"
2017-10-17 01:51:20,765 - 24537 - DEBUG - get(default) SCANDIRECTORIES=None
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) MAXAGE="24"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) MAXAGE="24"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) MINSIZE="150"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) MINSIZE="150"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) MINSCORE="20"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) MINSCORE="20"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) LANGUAGES="en"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) LANGUAGES="en"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) SYSTEMENCODING="UTF-8"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) SYSTEMENCODING="UTF-8"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) FETCHMODE="BestScore"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) FETCHMODE="BestScore"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(environment) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2017-10-17 01:51:20,765 - 24537 - DEBUG - set(config) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:51:20,766 - 24537 - DEBUG - set(environment) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:51:20,766 - 24537 - DEBUG - get(config) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:51:20,766 - 24537 - DEBUG - get(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2017-10-17 01:51:20,766 - 24537 - DEBUG - get(config) MAXAGE="24"
2017-10-17 01:51:20,766 - 24537 - DEBUG - get(config) MINSIZE="150"
2017-10-17 01:51:20,766 - 24537 - DEBUG - get(config) FORCE="True"
2017-10-17 01:51:20,766 - 24537 - DEBUG - get(config) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) XREFPATHS=None
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) SINGLE="False"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get_files('/media/Storage2/The Vietnam War (2017)/s01/problematic') with 11 filter(s)
2017-10-17 01:51:20,767 - 24537 - DEBUG - Allowed The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4 (suffix)
2017-10-17 01:51:20,767 - 24537 - INFO - Found 1 matched file(s).
2017-10-17 01:51:20,767 - 24537 - DEBUG - Scanning "/media/Storage2/The Vietnam War (2017)/s01/problematic/The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4" (2106.86 MB)
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(system) TEMPDIR="/tmp/nzbget-user"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) CACHEDIR="/tmp/nzbget-user"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(config) FORCEENCODING="utf-8"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(config) TIDYSUB="True"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(config) MINSCORE="20"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) IGNOREEMBEDDED="no"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) SEARCHMODE="advanced"
2017-10-17 01:51:20,767 - 24537 - INFO - Using advanced search mode
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) MOVIEPROVIDERS=""
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) PROVIDERS="['opensubtitles', 'tvsubtitles', 'podnapisi', 'addic7ed', 'thesubdb']"
2017-10-17 01:51:20,767 - 24537 - DEBUG - get(default) TVSHOWPROVIDERS=""
2017-10-17 01:51:20,768 - 24537 - DEBUG - get(default) PROVIDERS="['opensubtitles', 'tvsubtitles', 'podnapisi', 'addic7ed', 'thesubdb']"
2017-10-17 01:51:20,768 - 24537 - DEBUG - Using the following movie providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
2017-10-17 01:51:20,768 - 24537 - DEBUG - Using the following tv show providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
2017-10-17 01:51:20,768 - 24537 - DEBUG - get(default) ADDIC7EDUSER=None
2017-10-17 01:51:20,768 - 24537 - DEBUG - get(default) ADDIC7EDPASS=None
2017-10-17 01:51:20,768 - 24537 - DEBUG - get(config) LANGUAGES="en"
2017-10-17 01:51:20,768 - 24537 - DEBUG - get(config) FETCHMODE="BestScore"
2017-10-17 01:51:20,768 - 24537 - DEBUG - Fetch Mode: BestScore
2017-10-17 01:51:20,775 - 24537 - DEBUG - get(config) SYSTEMENCODING="UTF-8"
2017-10-17 01:51:20,778 - 24537 - DEBUG - get_files('/media/Storage2/The Vietnam War (2017)/s01/problematic') with 1 filter(s)
2017-10-17 01:51:20,778 - 24537 - DEBUG - Scanning [advanced] using /media/Storage2/The Vietnam War (2017)/s01/problematic/The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4 lang=en
2017-10-17 01:51:20,779 - 24537 - DEBUG - get(default) TVCATEGORIES="[]"
2017-10-17 01:51:20,779 - 24537 - DEBUG - Guessing using: /media/Storage2/The Vietnam War (2017)/s01/problematic/The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4
2017-10-17 01:51:20,892 - 24537 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "/opt/nzbget/scripts/Subliminal/nzbget/ScriptBase.py", line 2935, in run
    exit_code = main_function(*args, **kwargs)
    File "/opt/nzbget/scripts/Subliminal.py", line 1936, in main
    use_nzbheaders=False,
    File "/opt/nzbget/scripts/Subliminal.py", line 1406, in subliminal_fetch
    use_nzbheaders=use_nzbheaders,
    File "/opt/nzbget/scripts/Subliminal.py", line 688, in guess_info
    guess['series'] += ' ' + str(guess['year'])
  KeyError: 'year'

2017-10-17 01:51:20,892 - 24537 - DEBUG - Exiting with return code: 94

Master (60b0ffd):

$ ./nzb-subliminal-master/Subliminal.py -D -t -e utf-8 -f '/media/Storage2/The Vietnam War (2017)/s01/problematic'
2017-10-17 01:55:52,143 - 24978 - DEBUG - Script Mode: shell
2017-10-17 01:55:52,143 - 24978 - DEBUG - set(config) TIDYSUB="True"
2017-10-17 01:55:52,143 - 24978 - DEBUG - set(environment) TIDYSUB="1"
2017-10-17 01:55:52,143 - 24978 - DEBUG - set(config) FORCEENCODING="utf-8"
2017-10-17 01:55:52,143 - 24978 - DEBUG - set(environment) FORCEENCODING="utf-8"
2017-10-17 01:55:52,143 - 24978 - DEBUG - set(config) FORCE="True"
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(environment) FORCE="1"
2017-10-17 01:55:52,144 - 24978 - DEBUG - get(default) MAXAGE=None
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(config) MAXAGE="24"
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(environment) MAXAGE="24"
2017-10-17 01:55:52,144 - 24978 - DEBUG - get(default) MINSIZE=None
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(config) MINSIZE="150"
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(environment) MINSIZE="150"
2017-10-17 01:55:52,144 - 24978 - DEBUG - get(default) MINSCORE=None
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(config) MINSCORE="20"
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(environment) MINSCORE="20"
2017-10-17 01:55:52,144 - 24978 - DEBUG - get(default) LANGUAGES=None
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(config) LANGUAGES="en"
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(environment) LANGUAGES="en"
2017-10-17 01:55:52,144 - 24978 - DEBUG - get(default) SYSTEMENCODING=None
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(config) SYSTEMENCODING="UTF-8"
2017-10-17 01:55:52,144 - 24978 - DEBUG - set(environment) SYSTEMENCODING="UTF-8"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(default) FETCHMODE=None
2017-10-17 01:55:52,145 - 24978 - DEBUG - set(config) FETCHMODE="BestScore"
2017-10-17 01:55:52,145 - 24978 - DEBUG - set(environment) FETCHMODE="BestScore"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(default) VIDEOEXTENSIONS=None
2017-10-17 01:55:52,145 - 24978 - DEBUG - set(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2017-10-17 01:55:52,145 - 24978 - DEBUG - set(environment) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(default) SCANDIRECTORIES=None
2017-10-17 01:55:52,145 - 24978 - DEBUG - set(config) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:55:52,145 - 24978 - DEBUG - set(environment) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(config) MAXAGE="24"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(config) MINSIZE="150"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(config) FORCE="True"
2017-10-17 01:55:52,145 - 24978 - DEBUG - get(config) SCANDIRECTORIES="/media/Storage2/The Vietnam War (2017)/s01/problematic"
2017-10-17 01:55:52,146 - 24978 - DEBUG - get(default) XREFPATHS=None
2017-10-17 01:55:52,146 - 24978 - DEBUG - get(default) SINGLE="False"
2017-10-17 01:55:52,146 - 24978 - DEBUG - get_files('/media/Storage2/The Vietnam War (2017)/s01/problematic') with 11 filter(s)
2017-10-17 01:55:52,146 - 24978 - DEBUG - Allowed The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4 (suffix)
2017-10-17 01:55:52,146 - 24978 - INFO - Found 1 matched file(s).
2017-10-17 01:55:52,146 - 24978 - DEBUG - Scanning "/media/Storage2/The Vietnam War (2017)/s01/problematic/The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4" (2106.86 MB)
2017-10-17 01:55:52,146 - 24978 - DEBUG - get(system) TEMPDIR="/tmp/nzbget-user"
2017-10-17 01:55:52,146 - 24978 - DEBUG - get(default) CACHEDIR="/tmp/nzbget-user"
2017-10-17 01:55:52,146 - 24978 - DEBUG - get(config) FORCEENCODING="utf-8"
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(config) TIDYSUB="True"
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(config) MINSCORE="20"
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) IGNOREEMBEDDED="no"
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) SEARCHMODE="advanced"
2017-10-17 01:55:52,147 - 24978 - INFO - Using advanced search mode
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) MOVIEPROVIDERS=""
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) PROVIDERS="['opensubtitles', 'tvsubtitles', 'podnapisi', 'addic7ed', 'thesubdb']"
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) TVSHOWPROVIDERS=""
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) PROVIDERS="['opensubtitles', 'tvsubtitles', 'podnapisi', 'addic7ed', 'thesubdb']"
2017-10-17 01:55:52,147 - 24978 - DEBUG - Using the following movie providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
2017-10-17 01:55:52,147 - 24978 - DEBUG - Using the following tv show providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) ADDIC7EDUSER=None
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(default) ADDIC7EDPASS=None
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(config) LANGUAGES="en"
2017-10-17 01:55:52,147 - 24978 - DEBUG - get(config) FETCHMODE="BestScore"
2017-10-17 01:55:52,147 - 24978 - DEBUG - Fetch Mode: BestScore
2017-10-17 01:55:52,154 - 24978 - DEBUG - get(config) SYSTEMENCODING="UTF-8"
2017-10-17 01:55:52,157 - 24978 - DEBUG - get_files('/media/Storage2/The Vietnam War (2017)/s01/problematic') with 1 filter(s)
2017-10-17 01:55:52,158 - 24978 - DEBUG - Scanning [advanced] using /media/Storage2/The Vietnam War (2017)/s01/problematic/The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4 lang=en
2017-10-17 01:55:52,158 - 24978 - DEBUG - get(default) TVCATEGORIES="[]"
2017-10-17 01:55:52,158 - 24978 - DEBUG - Guessing using: /media/Storage2/The Vietnam War (2017)/s01/problematic/The Vietnam War (2017).s01e10.The Weight of Memory (March 1973-Onward).Bluray-1080p.mp4
2017-10-17 01:55:52,267 - 24978 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "/home/user/nzb-subliminal-master/Subliminal/nzbget/ScriptBase.py", line 3027, in run
    exit_code = main_function(*args, **kwargs)
    File "./nzb-subliminal-master/Subliminal.py", line 1949, in main
    File "./nzb-subliminal-master/Subliminal.py", line 1428, in subliminal_fetch
    File "./nzb-subliminal-master/Subliminal.py", line 710, in guess_info
  KeyError: 'year'

2017-10-17 01:55:52,267 - 24978 - DEBUG - Exiting with return code: 1

I did find the relevant use of the key in the script, but I don't understand what's going on so I'm afraid I don't have a fix to submit. I did find that changing line 688 (in 0.10.0) from:

guess['series'] += ' ' + str(guess['year'])

to:

guess['series']

seemed to allow subtitles to download, which I think is because it prevents any year from being specified.

Related, for other episodes in this series the year is being incorrectly guessed as one of the periods stated in the title rather than the actual year of the series (2017). Example file names:

  • The Vietnam War (2017).s01e07.The Veneer of Civilization (June 1968-May 1969).Bluray-1080p.mp4
  • The Vietnam War (2017).s01e09.A Disrespectful Loyalty (May 1970-March 1973).Bluray-1080p.mp4

There's absolutely no urgency on this from my point of view, but I thought I should log it. Thanks!

Cachefiles in homefolder.

These three files usally always resides in my homefolder. (/home/kodi)

cachefile.dbm
cachefile.dbm.dogpile.lock
cachefile.dbm.rw.lock

Regular subliminal uses appdirs.

nzbget is at /opt/ppscripts/nzbget-subliminal

question/feature request: add 'ondertitel.com' as a provider

I've been using this plugin for awhile now and grateful for all the work done. Though as of late I notice more and more subtitles can be found on http://ondertitel.com/ there where other providers fail. Therefore I manually process most f my downloads again. Also this provider is also pretty quick with new releases. I was wondering if support can be added for this site?

Detect already present 3-letter language codes.

I've been using Filebot and switched to Subliminal to see if it works better for me. Currently my entire library is thus mostly 3-letter country coded subs like *.eng.srt, *.dut.srt, *.fre.srt.

I just ran Subliminal and (withouth -o) it's searching for subs even though I already have them in that certain language.

Can you make it detect 3-letter country codes too, so it can skip searching for that language ?

Changing the amount of on-screen logging

hi there, great app. have moved across to it from the original subliminal script.

i'm wondering if there is any way to control the amount of onscreen logging?

what i'd like to do is exclude the "Skipping - Subtitle(s) already exist for" reports, so that i only see those which have had subtitles downloaded, or are missing.

is this functionality available, or would it need to be coded in?

cheers,

dave

ERROR - Unexpected error in provider 'addic7ed'

hi Caronc,

I started getting this error message the other day. I have deleted my copy of your files and redownloaded them (as i wanted to make sure i was using your master branch again - i think you have moved back to developing on that instead of no-karma (?) i purely use addicted for my subtitles.

any thoughts on what is happening here?

edit: Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

Error message:
2015-03-25 16:49:22,025 - 1112 - ERROR - Unexpected error in provider 'addic7ed'
Traceback (most recent call last):
File "/Applications/nzbget-subliminal/Subliminal/subliminal/api.py", line 256, in download_best_subtitles
provider_subtitles = provider.list_subtitles(video, provider_video_languages)
File "/Applications/nzbget-subliminal/Subliminal/subliminal/providers/addic7ed.py", line 159, in list_subtitles
return [s for s in self.query(video.series, video.season)
File "/Applications/nzbget-subliminal/Subliminal/subliminal/providers/addic7ed.py", line 123, in query
show_ids = self.get_show_ids()
File "/Applications/nzbget-subliminal/Subliminal/dogpile/cache/region.py", line 1013, in decorate
should_cache_fn)
File "/Applications/nzbget-subliminal/Subliminal/dogpile/cache/region.py", line 640, in get_or_create
async_creator) as value:
File "/Applications/nzbget-subliminal/Subliminal/dogpile/core/dogpile.py", line 158, in enter
return self._enter()
File "/Applications/nzbget-subliminal/Subliminal/dogpile/core/dogpile.py", line 91, in _enter
value = value_fn()
File "/Applications/nzbget-subliminal/Subliminal/dogpile/cache/region.py", line 598, in get_value
value = self.backend.get(key)
File "/Applications/nzbget-subliminal/Subliminal/dogpile/cache/backends/file.py", line 218, in get
with self._dbm_file(False) as dbm:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/Applications/nzbget-subliminal/Subliminal/dogpile/cache/backends/file.py", line 213, in _dbm_file
"w" if write else "r")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/anydbm.py", line 84, in open
mod = import(result)
ImportError: No module named gdbm

Add Custom Action to Scan Library

Based on this post here, it was requested to support the Custom Action functionality recently built into NZBGet which will issue a Subliminal Scan on the libraries defined.

Large video dir

I have a large video dir, tv shows, individual sub dir goes well, but when using the main dir, the following error occurs:

2014-12-02 06:04:31,920 - 19068 - ERROR - Fatal Exception:
Traceback (most recent call last):
File "./Subliminal/nzbget/ScriptBase.py", line 2130, in run
exit_code = main_function(_args, *_kwargs)
File "./Subliminal.py", line 1065, in main
fullstats=True,
File "./Subliminal/nzbget/ScriptBase.py", line 1833, in get_files
return core_function(_args, *_kwargs)
File "./Subliminal/nzbget/ScriptBase.py", line 1884, in _get_files
skip_directories=skip_directories,
File "./Subliminal/nzbget/ScriptBase.py", line 2098, in _get_files
datetime.fromtimestamp(stat_obj[ST_MTIME])
ValueError: year is out of range

Getting KeyError

Just within the last few days, this error has started occurring multiple times during each subtitle check. I haven't made any changes to my system. Running on Windows 10 (Creator's update). It doesn't error on every single subtitle search, just 2-3 times on every check.

ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: KeyError: None
-- | -- | --
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: element_name = specs[element_id][1]
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: File "K:\Processing\NZBget_Scripts\Subliminal\enzyme\mkv.py", line 61, in _parse_seekhead
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: self._parse_seekhead(seek_head, segment, stream, specs)
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: File "K:\Processing\NZBget_Scripts\Subliminal\enzyme\mkv.py", line 54, in __init__
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: mkv = enzyme.MKV(f)
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: File "K:\Processing\NZBget_Scripts\Subliminal\subliminal\video.py", line 236, in scan_video
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: video=video,
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: File "K:\Processing\NZBget_Scripts\Subliminal.py", line 1426, in subliminal_fetch
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: use_nzbheaders=False,
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: File "K:\Processing\NZBget_Scripts\Subliminal.py", line 1864, in scheduler_main
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: exit_code = main_function(*args, **kwargs)
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: File "K:\Processing\NZBget_Scripts\Subliminal\nzbget\ScriptBase.py", line 2935, in run
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: Traceback (most recent call last):
INFO | Sun Sep 17 2017 14:26:42 | Subliminal: Scanning video 'ShowName.S02E01.EpisodeName.mkv' in 'K:\\Media\\TV\\Elena of Avalor\\Season 02'
ERROR | Sun Sep 17 2017 14:26:42 | Subliminal: KeyError: None

Standalone

Hello again,

This project neatly wraps subliminal and addresses issues you found, and you are also adding auth.

One issue i see is the reliance (in cmdline mode) of a folder to scan, that data can actually not be available if 3rd-party-app has cleaned/renamed it -- however, the original names could still be available via the 3rd-party-app db, therefore, a method to simply send an original name would be useful.

Also, I guess the app saves the state of its decisions in order to act on them at some later time, it would be useful if this state list/object could be returned for saving elsewhere and then that data pushed back to your app at a later time. This implies a "try_again_in_mins" be returned so that 3rd-party-app know when at least to schedule a next call to your app. And this way, the data to be saved on whatever device is optionally managed by 3rd-party-app instead of yours.

Given that goals of this project can be enjoyed outside of NZBGET/SAB, then this project is suited to go through the same as Apprise, no?

JD

Issues with unicode support?

I had this error when scanning my TV shows:

2015-10-10 23:58:00,900 - 7871 - ERROR - Unexpected error in provider 'podnapisi'
Traceback (most recent call last):
  File "/usr/src/nzbget-subliminal/Subliminal/subliminal/api.py", line 256, in download_best_subtitle
s
    provider_subtitles = provider.list_subtitles(video, provider_video_languages)
  File "/usr/src/nzbget-subliminal/Subliminal/subliminal/providers/podnapisi.py", line 314, in list_s
ubtitles
    episode=video.episode)]
  File "/usr/src/nzbget-subliminal/Subliminal/subliminal/providers/podnapisi.py", line 259, in query
    releases = [ str(releases.string.strip()), ]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 0: ordinal not in range(
128)

I have files with accentuated characters in their filenames and it might be what triggers it.

always skip certain folders

hi caronc,
i have another use case for you to consider.
i have some tv shows which will never have subtitles created for them, so what if your script could detect the presence of a .subignore file in the directory then skip searching for subtitles for that show?
thanks in advance,
dave

Subtitles with dates in them from Addic7ed do not fetch correctly

For example:

Addic7ed has 2 versions of 'The Flash':

  1. The Flash which references an old series from 1990 that no longer airs (IMDB Reference).
  2. The.Flash.2014 which references a newer series that came out in 2014 (IMDB Reference) which most people are watching these days.

The problem is that Subliminal searches Addic7ed for 'The Flash' and is using results hit from the first show and not the second. Subliminal isn't correctly accounting for the year in the file name to help search for the newer series.

TypeError: invalid arguments

Hello,

I get the error "TypeError: invalid arguments".
Hope you can help me.

Log:
INFO 2015-04-18 17:18:02 Executing post-process-script Subliminal.py for Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get_files('/share/Download/nzb/Movies/_Test') with 1 filter(s)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Allowed Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.nzb.queued (regex)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(system) NZBDIR="/share/Download/nzb"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get_files('/share/Download/nzb') with 1 filter(s)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] NZB-Files located: Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.nzb.queued (2015-04-18 17:11:18)
INFO 2015-04-18 17:18:07 Subliminal: NZB-File detected: Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.nzb.queued
INFO 2015-04-18 17:18:07 Subliminal: NZBParse - NZB-File parsed 4 meta entries
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(system) NZBID="153"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) MINSIZE="150"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) OVERWRITE="no"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) SINGLE="yes"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) UPDATETIMESTAMP="yes"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) UPDATEPERMISSIONS="no"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) VIDEOPERMISSIONS="644"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get_files('/share/Download/dst/Movies/_Test/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG') with 11 filter(s)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Allowed Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.avi (suffix)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Allowed A4A.mkv (suffix)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Filtered "/share/Download/dst/Movies/_Test/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG/Waar vind je de Angels/A4A.mkv" (21.74 MB)
INFO 2015-04-18 17:18:07 Subliminal: Found 1 matched file(s).
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Scanning "/share/Download/dst/Movies/_Test/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG/MOVIE@720p-Xvid/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.avi" (2129.23 MB)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Video timestamp updated.
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(system) TEMPDIR="/share/Download/tmp"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) CACHEDIR="/share/Download/tmp/subliminal"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) FORCEENCODING="None"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) MINSCORE="20"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) SKIPEMBEDDED="yes"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) SEARCHMODE="advanced"
INFO 2015-04-18 17:18:07 Subliminal: Using advanced search mode
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) MOVIEPROVIDERS=""
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) PROVIDERS="opensubtitles, tvsubtitles, podnapisi, addic7ed, thesubdb"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) TVSHOWPROVIDERS=""
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) PROVIDERS="opensubtitles, tvsubtitles, podnapisi, addic7ed, thesubdb"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Using the following movie providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Using the following tv show providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) LANGUAGES="nl"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) FETCHMODE="StandardFirst"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Fetch Mode: StandardFirst
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get_files('/share/Download/dst/Movies/_Test/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG/MOVIE@720p-Xvid') with 1 filter(s)
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Scanning [advanced] using /share/Download/dst/Movies/_Test/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG/MOVIE@720p-Xvid/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.avi lang=nl
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] get(config) TVCATEGORIES="tv; tv2; Series"
INFO 2015-04-18 17:18:07 Subliminal: [DEBUG] Deobfuscate - Stripped filename down to: MOVIE@720p-Xvid/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.avi
INFO 2015-04-18 17:18:08 Subliminal: [DEBUG] get(config) SYSTEMENCODING="UTF-8"
INFO 2015-04-18 17:18:08 Subliminal: [DEBUG] Guessing using: MOVIE@720p-Xvid/Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG.avi
ERROR 2015-04-18 17:18:13 Subliminal: Traceback (most recent call last):
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/nzbget/ScriptBase.py", line 2295, in run
INFO 2015-04-18 17:18:13 Subliminal: exit_code = main_function(_args, *_kwargs)
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal.py", line 1330, in postprocess_main
INFO 2015-04-18 17:18:13 Subliminal: overwrite=overwrite,
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal.py", line 1026, in subliminal_fetch
INFO 2015-04-18 17:18:13 Subliminal: use_nzbheaders=use_nzbheaders,
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal.py", line 555, in guess_info
INFO 2015-04-18 17:18:13 Subliminal: opts={'nolanguage': True, 'nocountry': True},
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/guessit/matcher.py", line 110, in init
INFO 2015-04-18 17:18:13 Subliminal: from guessit.plugins import transformers
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/guessit/plugins/transformers.py", line 212, in
INFO 2015-04-18 17:18:13 Subliminal: reload()
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/guessit/plugins/transformers.py", line 210, in reload
INFO 2015-04-18 17:18:13 Subliminal: reload_options(all_transformers())
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/guessit/options.py", line 70, in reload
INFO 2015-04-18 17:18:13 Subliminal: _opts, _naming_opts, _output_opts, _information_opts, _webservice_opts, _other_opts = build_opts(transformers)
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/guessit/options.py", line 63, in build_opts
INFO 2015-04-18 17:18:13 Subliminal: transformer.register_options(opts, naming_opts, output_opts, information_opts, webservice_opts, other_opts)
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/Download/ppscripts/Subliminal/guessit/transfo/expected_series.py", line 37, in register_options
INFO 2015-04-18 17:18:13 Subliminal: help='List of expected series to parse. Separate series names with ";"')
ERROR 2015-04-18 17:18:13 Subliminal: File "/share/HDA_DATA/.qpkg/Python/lib/python2.7/optparse.py", line 1018, in add_option
INFO 2015-04-18 17:18:13 Subliminal: raise TypeError, "invalid arguments"
ERROR 2015-04-18 17:18:13 Subliminal: TypeError: invalid arguments
ERROR 2015-04-18 17:18:13 Post-process-script Subliminal.py for Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG failed
INFO 2015-04-18 17:18:13 Executing post-process-script Logger.py for Two.Night.Stand.2014.LIMITED.720p.BRRip.XviD.AC3-RARBG

Python v2.7.11 converting new lines (\r\n) to \r\r\n when subtitle is retrieved

This is a really bizarre issue I've been working off-line with an un-named individual experiencing this problem.

The environment this seems to affect (so far) is Python 2.7.11 under Microsoft Windows 10

The scenario is that the subs are correctly retrieved and unzipped to the local storage. However all new lines (\r\n) ([CR][LF]) are being saved with an extra carriage return instead: \r\r\n ([CR][CR][LF]).

As a result, software that interprets these subtitles simply can't do it. It displays the entire subtitle file in one shot and then does nothing thereafter.

Addic7edUsername error: name 'abc' is not defined

Hi. When using the subliminal package, I'm able to give the parameters addictedusername & pw.
Subtitles are downloaded.
I've got it working in a freebsd jail via guide : https://forums.freenas.org/index.php?threads/how-to-install-subliminal.24136/#post-147852

When I use Subliminal.py & change the config file, uncommenting Addic7edUsername & Addic7edPassword and setting them to the same values, I'm getting a

File "Subliminal.py", line 143, in
Addic7edUsername=abc
NameError: name 'abc' is not defined

... where I obviously have abc replaced by my actual addic7ed username.
What am I not seeing ? What else do you need in order to debug ?

update: it seems none of the options can be set in Subliminal.py

IOError 'No such file or directory' when saving srt file

I want to use your script to search for subs manually. When I use the following commands, I receive an IOError 'No such file or directory':

python Subliminal.py -l nl -p opensubtitles -b -f -m BestScore -S /volume1/Media/Movies/All/MovieTitle/

2018-01-30 12:54:24,753 - 30894 - INFO - Found 1 matched file(s).
2018-01-30 12:54:24,754 - 30894 - INFO - Using basic search mode
2018-01-30 12:54:25,426 - 30894 - INFO - Listing subtitles with provider 'opensubtitles' for video <Movie [u'MovieTitle', 2017]> with languages set([<Language [nl]>])
2018-01-30 12:54:25,579 - 30894 - INFO - Found 4 subtitle(s) on opensubtitles
2018-01-30 12:54:25,736 - 30894 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [nl]> with score 24 into u'MovieTitle.nl.srt'
2018-01-30 12:54:26,283 - 30894 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "/volume1/Scripts/python_modules/nzb-subliminal-master/Subliminal/nzbget/ScriptBase.py", line 3038, in run
    exit_code = main_function(*args, **kwargs)
    File "Subliminal.py", line 1999, in main
    use_nzbheaders=False,
    File "Subliminal.py", line 1675, in subliminal_fetch
    move(move_from, expected_file)
    File "/usr/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
    File "/usr/lib/python2.7/shutil.py", line 130, in copy2
    copyfile(src, dst)
    File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
  IOError: [Errno 2] No such file or directory: u'/tmp/nzbget-ward/MovieTitle/MovieTitle.nl.srt'

So it tries to add the srt file in a tmp directory which I don"t have. I also seems that it uses a directory with my username in it 'nzbget-ward'

podnapisi: UnicodeEncodeError: 'ascii' codec can't encode characters in position 53-54: ordinal not in range(128)

Log entries:

Sat Oct 28 18:35:52 2017	ERROR	Subliminal: Unexpected error in provider 'podnapisi'
Sat Oct 28 18:35:52 2017	INFO	Subliminal: Traceback (most recent call last):
Sat Oct 28 18:35:52 2017	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/subliminal/api.py", line 256, in download_best_subtitles
Sat Oct 28 18:35:52 2017	INFO	Subliminal:     provider_subtitles = provider.list_subtitles(video, provider_video_languages)
Sat Oct 28 18:35:52 2017	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/subliminal/providers/podnapisi.py", line 327, in list_subtitles
Sat Oct 28 18:35:52 2017	INFO	Subliminal:     year=video.year)]
Sat Oct 28 18:35:52 2017	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/subliminal/providers/podnapisi.py", line 274, in query
Sat Oct 28 18:35:52 2017	INFO	Subliminal:     releases.append(str(r.get_text()))
Sat Oct 28 18:35:52 2017	INFO	Subliminal: UnicodeEncodeError: 'ascii' codec can't encode characters in position 53-54: ordinal not in range(128)
``

OpenSSL error

Hi,

When running a scan with this parameters:

/home/ubuntu/nzbget-subliminal/Subliminal.py -S /home/ubuntu/Media/ \
-a 360 \
-l en \
-e utf-8 \
--addic7ed-user=XXX \
--addic7ed-pass=XXX \
-t

I get the following error:

2017-10-11 13:18:36,713 - 19986 - ERROR - Fatal Exception:
  Traceback (most recent call last):
    File "/home/ubuntu/nzbget-subliminal/Subliminal/nzbget/ScriptBase.py", line 2935, in run
    exit_code = main_function(*args, **kwargs)
    File "/home/ubuntu/nzbget-subliminal/Subliminal.py", line 1936, in main
    use_nzbheaders=False,
    File "/home/ubuntu/nzbget-subliminal/Subliminal.py", line 1547, in subliminal_fetch
    hi_score_adjust=hi_score_adjust,
    File "/home/ubuntu/nzbget-subliminal/Subliminal/subliminal/api.py", line 215, in download_best_subtitles
    Provider = provider_entry_point.load()
    File "/home/ubuntu/nzbget-subliminal/Subliminal/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
    File "/home/ubuntu/nzbget-subliminal/Subliminal/subliminal/providers/__init__.py", line 10, in <module>
    import requests
    File "/home/ubuntu/nzbget-subliminal/Subliminal/requests/__init__.py", line 53, in <module>
    from urllib3.contrib import pyopenssl
    File "/home/ubuntu/nzbget-subliminal/Subliminal/urllib3/contrib/pyopenssl.py", line 53, in <module>
    import OpenSSL.SSL
    File "/home/ubuntu/nzbget-subliminal/Subliminal/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
    File "/home/ubuntu/nzbget-subliminal/Subliminal/OpenSSL/SSL.py", line 105, in <module>
    SSL_ST_INIT = _lib.SSL_ST_INIT
  AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Maybe I need to update pyOpenSSL?

Unexpected error in provider 'addic7ed'

With respect to issue #35 , get_show_ids() from within the addi7ed plugin failed to cache shows. See below:

Unexpected error in provider 'addic7ed'
Traceback (most recent call last):
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\subliminal\api.py", line 256, in download_best_subtitles
provider_subtitles = provider.list_subtitles(video, provider_video_languages)
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\subliminal\providers\addic7ed.py", line 221, in list_subtitles
return [s for s in self.query(video.series, video.season)
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\subliminal\providers\addic7ed.py", line 185, in query
show_ids = self.get_show_ids()
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\cache\region.py", line 1013, in decorate
should_cache_fn)
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\cache\region.py", line 640, in get_or_create
async_creator) as value:
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\core\dogpile.py", line 158, in __enter__
return self._enter()
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\core\dogpile.py", line 98, in _enter
generated = self._enter_create(createdtime)
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\core\dogpile.py", line 149, in _enter_create
created = self.creator()
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\cache\region.py", line 612, in gen_value
created_value = creator()
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\dogpile\cache\region.py", line 1009, in creator
return fn(*arg, **kw)
File "C:\Users\xxxv\Documents\GitHub\tests\nzb-subliminal-master\Subliminal\subliminal\providers\addic7ed.py", line 162, in get_show_ids
int(html_show['href'][6:])
ValueError: invalid literal for int() with base 10: '

Fails to include dist-info data files of subliminal after compiling .

Hello caronc thanks so much for your work . Help wanted here : -

I am trying to convert a small python code which uses the download_best_subtitle function to an executable using pyinstaller . But sadly its not working right . I am sure that i must have not included all the files or may not have included the right modules in the spec file . I think the error occurs because , somehow the program is not able to see the subliminal-2.0.5.dist-info which contains the entry point data to be accessed by the compiled exe . here is the spec file code which i am using ......Can't seem to make it work . :(

# -*- mode: python -*-

block_cipher = None
options = [('v',None,'OPTION')]

a = Analysis(['subtiler_getter.py'],
             pathex=['C:\\Users\\Natesh\\Desktop\\subtitle trying','C:\Program Files\Python35\Lib\site-packages'],
             binaries=[],
             datas=[('guessit/tlds', 'guessit/tlds'), ('babelfish/data', 'babelfish/data'),('subliminal-2.0.5.dist-info/*','data')],
             hiddenimports=['subliminal-2.0.5.dist-info','dogpile.cache.backends.file','dogpile.cache','subliminal','babelfish','stevedore','appdirs'],
             hookspath=['.'],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
a.data+=[("subliminal-2.0.5.dist-info","subliminal-2.0.5.dist-info")]
			 
			 
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='Subtitler',
          debug=True,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               name='Subtitler')

Can you please give me the exact command or the spec file for pyinstaller which is needed to convert this into a working compiled executable ? . I would be really very grateful. @caronc .

Here is the simple code which i am trying for three days to convert to exe . ( novice here :) ) : -


import subliminal
import sys,os,requests
import argparse;
import logging;
from babelfish import Language

# configure the cache

subliminal.region.configure('dogpile.cache.dbm', arguments={'filename': 'cachefile.dbm'})



Path = input("Enter the path for the video :- ") ;

if os.path.isfile(args.Path):
	videos = [subliminal.scan_video(args.Path)];
else:
	videos = subliminal.scan_videos(args.Path) ;

subs = subliminal.download_best_subtitles(videos,{Language('eng')} ) ;
print(list(subs.values()))
for v in videos:
	subliminal.save_subtitles(v, subs[v]) ;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.