Setup Sublimal to work with Sickbeard on Windows 7

November 23, 2012 at 3:51 pm (Oracle) (, , , )

I tried searching for a how to on google but did not find one and hence decided to write one:

I am on Windows 7 64 bit. It turned out to be pretty simple install. All you need to do is get easy_install and pip to be installed and it will take care of the rest. I faced an issue with subliminal on python 2.6 (more on the issue here: https://github.com/Diaoul/subliminal/issues/111) that i did not face on 2.7. So my advice, go with python 2.7 unless you have a reason.

Download and install python-2.7.msi x86 version from http://www.python.org/ftp/python/2.7/python-2.7.msi
and install under C:\Python27

Download and install setuptools-0.6c11.win32-py2.7.exe x86 version from http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe#md5=57e1e64f6b7c7f1d2eddfc9746bbaf20
and install with default python directory as C:\Python27 and Installation directory as C:\Python27\Lib\site-packages\

Set your PATH environment variable to add the following locations: C:\Python27\Tools\Scripts;C:\Python27\Lib\site-packages;C:\Python27\Scripts

So the complete PATH variable should look like below:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Python27\Tools\Scripts;C:\Python27\Lib\site-packages;C:\Python27\Scripts

C:\Python27\Scripts>cd C:\Python27\Scripts

C:\Python27\Scripts>easy_install.exe pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://www.pip-installer.org
Reading http://pip.openplans.org
Best match: pip 1.2.1
Downloading http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#md5=db8a6d8a4564d3dc7f337ebed67b1a85
Processing pip-1.2.1.tar.gz
Running pip-1.2.1\setup.py -q bdist_egg –dist-dir c:\users\ezhome1\appdata\local\temp\easy_install-gg_rdl\pip-1.2.1\egg-dist-tmp-rs5mka
warning: no files found matching ‘*.html’ under directory ‘docs’
warning: no previously-included files matching ‘*.txt’ found under directory ‘docs\_build’
no previously-included directories found matching ‘docs\_build\_sources’
Adding pip 1.2.1 to easy-install.pth file
Installing pip-script.py script to C:\Python27\Scripts
Installing pip.exe script to C:\Python27\Scripts
Installing pip.exe.manifest script to C:\Python27\Scripts
Installing pip-2.7-script.py script to C:\Python27\Scripts
Installing pip-2.7.exe script to C:\Python27\Scripts
Installing pip-2.7.exe.manifest script to C:\Python27\Scripts

Installed c:\python27\lib\site-packages\pip-1.2.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

C:\Python27\Scripts>pip install subliminal
Downloading/unpacking subliminal
Downloading subliminal-0.6.2.tar.gz (61kB): 61kB downloaded
Running setup.py egg_info for package subliminal

Downloading/unpacking beautifulsoup4>=4.0 (from subliminal)
Downloading beautifulsoup4-4.1.3.tar.gz (131kB): 131kB downloaded
Running setup.py egg_info for package beautifulsoup4

Downloading/unpacking guessit>=0.4.1 (from subliminal)
Downloading guessit-0.5.3.tar.gz (45kB): 45kB downloaded
Running setup.py egg_info for package guessit

Downloading/unpacking requests (from subliminal)
Downloading requests-0.14.2.tar.gz (361kB): 361kB downloaded
Running setup.py egg_info for package requests

warning: no files found matching ‘tests\*.’
Downloading/unpacking enzyme>=0.1 (from subliminal)
Downloading enzyme-0.2.tar.gz (70kB): 70kB downloaded
Running setup.py egg_info for package enzyme

Downloading/unpacking html5lib (from subliminal)
Downloading html5lib-0.95.tar.gz (222kB): 222kB downloaded
Running setup.py egg_info for package html5lib

Installing collected packages: subliminal, beautifulsoup4, guessit, requests, enzyme, html5lib
Running setup.py install for subliminal

Running setup.py install for beautifulsoup4

Running setup.py install for guessit

Running setup.py install for requests

warning: no files found matching ‘tests\*.’
Running setup.py install for enzyme

Running setup.py install for html5lib

Successfully installed subliminal beautifulsoup4 guessit requests enzyme html5lib
Cleaning up…

C:\Python27\Scripts>pip install lxml
Downloading/unpacking lxml
Downloading lxml-3.0.1.tar.gz (3.2MB): 3.2MB downloaded
Running setup.py egg_info for package lxml
Building lxml version 3.0.1.
Building without Cython.
ERROR: ‘xslt-config’ is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt

warning: no files found matching ‘lxml.etree.c’ under directory ‘src\lxml’
warning: no files found matching ‘lxml.objectify.c’ under directory ‘src\lxml’
warning: no files found matching ‘lxml.etree.h’ under directory ‘src\lxml’
warning: no files found matching ‘lxml.etree_api.h’ under directory ‘src\lxml’
warning: no files found matching ‘etree_defs.h’ under directory ‘src\lxml’
warning: no files found matching ‘*.txt’ under directory ‘src\lxml\tests’
warning: no files found matching ‘pubkey.asc’ under directory ‘doc’
warning: no files found matching ‘tagpython*.png’ under directory ‘doc’
warning: no files found matching ‘Makefile’ under directory ‘doc’
Installing collected packages: lxml
Running setup.py install for lxml
Building lxml version 3.0.1.
Building without Cython.
ERROR: ‘xslt-config’ is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
building ‘lxml.etree’ extension
error: Unable to find vcvarsall.bat
Complete output from command C:\Python27\python.exe -c “import setuptools;__file__=’c:\\users\\ezhome1\\appdata\\local\\temp\\pip-build\\lxml\\setup.py’;exec(compile(open(__file__).read().replace(‘\r\n’, ‘\n’), __fil
e__, ‘exec’))” install –record c:\users\ezhome1\appdata\local\temp\pip-rn3jek-record\install-record.txt –single-version-externally-managed:
Building lxml version 3.0.1.

Building without Cython.

ERROR: ‘xslt-config’ is not recognized as an internal or external command,

operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt

running install

running build

running build_py

creating build

creating build\lib.win32-2.7

creating build\lib.win32-2.7\lxml

copying src\lxml\builder.py -> build\lib.win32-2.7\lxml

copying src\lxml\cssselect.py -> build\lib.win32-2.7\lxml

copying src\lxml\doctestcompare.py -> build\lib.win32-2.7\lxml

copying src\lxml\ElementInclude.py -> build\lib.win32-2.7\lxml

copying src\lxml\pyclasslookup.py -> build\lib.win32-2.7\lxml

copying src\lxml\sax.py -> build\lib.win32-2.7\lxml

copying src\lxml\usedoctest.py -> build\lib.win32-2.7\lxml

copying src\lxml\_elementpath.py -> build\lib.win32-2.7\lxml

copying src\lxml\__init__.py -> build\lib.win32-2.7\lxml

creating build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\__init__.py -> build\lib.win32-2.7\lxml\includes

creating build\lib.win32-2.7\lxml\html

copying src\lxml\html\builder.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\clean.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\defs.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\diff.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\ElementSoup.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\formfill.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\html5parser.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\soupparser.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\usedoctest.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\_diffcommand.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\_html5builder.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\_setmixin.py -> build\lib.win32-2.7\lxml\html

copying src\lxml\html\__init__.py -> build\lib.win32-2.7\lxml\html

creating build\lib.win32-2.7\lxml\isoschematron

copying src\lxml\isoschematron\__init__.py -> build\lib.win32-2.7\lxml\isoschematron

copying src\lxml\lxml.etree.h -> build\lib.win32-2.7\lxml

copying src\lxml\lxml.etree_api.h -> build\lib.win32-2.7\lxml

copying src\lxml\includes\c14n.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\config.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\relaxng.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\schematron.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\tree.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\uri.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\xinclude.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\xpath.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\xslt.pxd -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\etree_defs.h -> build\lib.win32-2.7\lxml\includes

copying src\lxml\includes\lxml-version.h -> build\lib.win32-2.7\lxml\includes

creating build\lib.win32-2.7\lxml\isoschematron\resources

creating build\lib.win32-2.7\lxml\isoschematron\resources\rng

copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-2.7\lxml\isoschematron\resources\rng

creating build\lib.win32-2.7\lxml\isoschematron\resources\xsl

copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl

copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl

creating build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

running build_ext

building ‘lxml.etree’ extension

error: Unable to find vcvarsall.bat

—————————————-
Command C:\Python27\python.exe -c “import setuptools;__file__=’c:\\users\\ezhome1\\appdata\\local\\temp\\pip-build\\lxml\\setup.py’;exec(compile(open(__file__).read().replace(‘\r\n’, ‘\n’), __file__, ‘exec’))” install —
record c:\users\ezhome1\appdata\local\temp\pip-rn3jek-record\install-record.txt –single-version-externally-managed failed with error code 1 in c:\users\ezhome1\appdata\local\temp\pip-build\lxml
Storing complete log in C:\Users\ezhome1\pip\pip.log

C:\Python27\Scripts>

Manually open file C:\Python27\Scripts\subliminal with notepad and goto line 55 and change it as below:

Original line:
group_cache.add_argument(‘–cache-dir’, action=’store’, dest=’cache_dir’, help=’cache directory to use’, metavar=’DIR’, default=os.path.expanduser(‘~/.config/subliminal’))

Change to:
group_cache.add_argument(‘–cache-dir’, action=’store’, dest=’cache_dir’, help=’cache directory to use’, metavar=’DIR’, default=os.path.expanduser(‘~\config\subliminal’))

and create directory config and sub directory subliminal under your home directory. Fyi, My home directory is c:\users\ezhome1

Few usage options:
c:\Python27\python.exe subliminal –version
c:\Python27\python.exe subliminal -l en PATH “C:\MediaCenter\TVShows\ForGrownUps\SD\English”
c:\Python27\python.exe subliminal -l en PATH “C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY”
c:\Python27\python.exe subliminal -l en -s opensubtitles PATH “C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY”

C:\Python27\Scripts>c:\Python27\python.exe subliminal -l en PATH “C:\MediaCenter\TVShows\ForGrownUps\SD\English”
WARNING: subliminal.core Service bierdopje not available: none of available features could be used. One of [‘xml’] required
WARNING: requests.packages.urllib3.connectionpool Retrying (0 attempts remain) after connection broken by ‘BadStatusLine(“””,)’: /serie/csi/9/7/
ERROR: subliminal.async Exception raised in worker Thread-4
Traceback (most recent call last):
File “c:\Python27\lib\site-packages\subliminal\async.py”, line 47, in run
result = consume_task(task, self.services)
File “c:\Python27\lib\site-packages\subliminal\core.py”, line 131, in consume_task
result = service.list(task.video, task.languages)
File “c:\Python27\lib\site-packages\subliminal\services\__init__.py”, line 154, in list
return self.list_checked(video, languages)
File “c:\Python27\lib\site-packages\subliminal\services\subswiki.py”, line 47, in list_checked
results = self.query(video.path or video.release, languages, get_keywords(video.guess), series=video.series, season=video.season, episode=video.episode)
File “c:\Python27\lib\site-packages\subliminal\services\subswiki.py”, line 58, in query
r = self.session.get(‘%s/serie/%s/%s/%s/’ % (self.server_url, urllib.quote(request_series), season, episode))
File “c:\Python27\lib\site-packages\requests\sessions.py”, line 254, in get
return self.request(‘get’, url, **kwargs)
File “c:\Python27\lib\site-packages\requests\sessions.py”, line 241, in request
r.send(prefetch=prefetch)
File “c:\Python27\lib\site-packages\requests\models.py”, line 637, in send
raise ConnectionError(e)
ConnectionError: HTTPConnectionPool(host=’www.subswiki.com’, port=80): Max retries exceeded with url: /serie/csi/9/7/
**************************************************
Downloaded 16 subtitle(s) for 16 video(s)
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×01 – Reignited.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×05 – The Good Earth.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×02 – The Pact.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×08 – The Wheels on the Bus.srt from thesubdb
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×05 – Misconceptions.srt from tvsubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×08 – Late Admission.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×07 – The Fallen.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×06 – The Apprenticeship.srt from tvsubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×04 – God Complex.srt from tvsubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×03 – 2,918 Miles.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×04 – Unspoken.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×02 – Where There’s Smoke.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×06 – The Lady in the Lake.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\CSI NY\CSI NY – 9×07 – Clue SI.srt from tvsubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×03 – Through the Looking Glass.srt from opensubtitles
C:\MediaCenter\TVShows\ForGrownUps\SD\English\Criminal Minds\Criminal Minds – 8×01 – The Silencer.srt from opensubtitles
**************************************************

C:\Python27\Scripts>

I am right now figuring out how i can use task scheduler to run every hour this command for me. Will try to update the ticket if  i get lucky.

So i fugured it out:

I created a script called C:\Python27\Scripts\CronJob.bat with the following contents and setup windows task scheduler to run every hour. Its been working cool so far.

echo “********************************************************” >> C:\Python27\Scripts\CronJobLog.txt 2>&1
echo %date% %time% >> C:\Python27\Scripts\CronJobLog.txt 2>&1
cd C:\Python27\Scripts
c:\Python27\python.exe subliminal -l en PATH “C:\MediaCenter\TVShows\ForGrownUps\English” >> C:\Python27\Scripts\CronJobLog.txt 2>&1
c:\Python27\python.exe subliminal -l en PATH “C:\MediaCenter\Movies” >> C:\Python27\Scripts\CronJobLog.txt 2>&1
echo %date% %time% >> C:\Python27\Scripts\CronJobLog.txt 2>&1
echo “********************************************************” >> C:\Python27\Scripts\CronJobLog.txt 2>&1

One thing to note is if you have not set your windows machine to show know file types, your file CronJob.bat may get created with .txt extension which needs to be double checked.

Permalink 12 Comments