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

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Moolan
Posts: 14
Joined: 22 Sep 2014, 09:40

Re: [PP-Script] Automatically Fetch Subtitles

Post by Moolan » 24 Sep 2014, 08:27

Hi I2g,

So I ran:

Code: Select all

python /Users/Username/Library/Application\ Support/NZBGet/scripts/Subliminal/Subliminal.py -p opensubtitles,tvsubtitles,thesubdb -f -S /Users/Username/Movies/TV\ Shows/True\ Blood/Season\ 07/True\ Blood\ -\ S07E02\ -\ I\ Found\ You.mkv
I received:

Code: Select all

2014-09-24 18:13:20,822 - 313 - INFO - Found 1 matched file(s).
2014-09-24 18:13:20,822 - 313 - INFO - Using advanced search mode
2014-09-24 18:13:20,822 - 313 - INFO - Using the following providers: opensubtitles, thesubdb, tvsubtitles
2014-09-24 18:13:21,050 - 313 - INFO - Scanning video 'True Blood - S07E02 - I Found You.mkv' in '/Users/Username/Movies/TV Shows/True Blood/Season 07'
2014-09-24 18:13:23,816 - 313 - INFO - Skipping provider 'tvsubtitles': no video to search for
2014-09-24 18:13:23,816 - 313 - INFO - Listing subtitles with provider 'opensubtitles' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-24 18:13:24,267 - 313 - INFO - Found 2 subtitles
2014-09-24 18:13:24,267 - 313 - INFO - Listing subtitles with provider 'thesubdb' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-24 18:13:25,676 - 313 - INFO - Found 0 subtitles
2014-09-24 18:13:25,677 - 313 - INFO - 'episode' is not a valid movie_kind for <Movie [u'True Blood']>
2014-09-24 18:13:25,677 - 313 - INFO - Computed score 0 with matches set([])
2014-09-24 18:13:25,677 - 313 - INFO - 'episode' is not a valid movie_kind for <Movie [u'True Blood']>
2014-09-24 18:13:25,677 - 313 - INFO - Computed score 0 with matches set([])
2014-09-24 18:13:25,677 - 313 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [en]> with score 0 into u'/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E02 - I Found You.en.srt'
2014-09-24 18:13:27,944 - 313 - INFO - Matched 1 possible subtitle(s) for True Blood - S07E02 - I Found You.mkv
Funny thing is after I ran the code, I reran the original command:

Code: Select all

Usernames-Mac-Mini:~ Username$ python /Users/Username/Library/Application\ Support/NZBGet/scripts/Subliminal/Subliminal.py -f -S /Users/Username/Movies/TV\ Shows/True\ Blood/Season\ 07/True\ Blood\ -\ S07E02\ -\ I\ Found\ You.mkv
I got:

Code: Select all

Usernames-Mac-Mini:~ Username$ python /Users/Username/Library/Application\ Support/NZBGet/scripts/Subliminal/Subliminal.py -f -S /Users/Username/Movies/TV\ Shows/True\ Blood/Season\ 07/True\ Blood\ -\ S07E02\ -\ I\ Found\ You.mkv
2014-09-24 18:38:52,378 - 389 - INFO - Found 1 matched file(s).
2014-09-24 18:38:52,379 - 389 - INFO - Using advanced search mode
2014-09-24 18:38:52,380 - 389 - INFO - Using the following providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
2014-09-24 18:38:52,380 - 389 - WARNING - Addic7ed provider dropped due to missing credentials
2014-09-24 18:38:52,393 - 389 - INFO - Scanning video 'True Blood - S07E02 - I Found You.mkv' in '/Users/Username/Movies/TV Shows/True Blood/Season 07'
2014-09-24 18:38:53,536 - 389 - INFO - Skipping provider 'tvsubtitles': no video to search for
2014-09-24 18:38:53,537 - 389 - INFO - Listing subtitles with provider 'podnapisi' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-24 18:38:55,821 - 389 - INFO - Found 0 subtitles
2014-09-24 18:38:55,822 - 389 - INFO - Listing subtitles with provider 'thesubdb' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-24 18:38:57,430 - 389 - INFO - Found 0 subtitles
2014-09-24 18:38:57,430 - 389 - INFO - Listing subtitles with provider 'opensubtitles' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-24 18:38:57,844 - 389 - INFO - Found 2 subtitles
2014-09-24 18:38:57,845 - 389 - INFO - 'episode' is not a valid movie_kind for <Movie [u'True Blood']>
2014-09-24 18:38:57,845 - 389 - INFO - Computed score 0 with matches set([])
2014-09-24 18:38:57,845 - 389 - INFO - 'episode' is not a valid movie_kind for <Movie [u'True Blood']>
2014-09-24 18:38:57,845 - 389 - INFO - Computed score 0 with matches set([])
2014-09-24 18:38:57,845 - 389 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [en]> with score 0 into u'/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E02 - I Found You.en.srt'
2014-09-24 18:38:59,989 - 389 - INFO - Matched 1 possible subtitle(s) for True Blood - S07E02 - I Found You.mkv
No errors. I guess my problem could be simply due to podnapisi wasn't working at the time of testing. :?: Notice though I did not get the same number of hits as you did. Weird...

I don't think the subliminal is shared between Plex and NZBGet. Running:

Code: Select all

subliminal --version
I got:

Code: Select all

-bash: subliminimal: command not found

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

Re: [PP-Script] Automatically Fetch Subtitles

Post by l2g » 24 Sep 2014, 15:29

Moolan,

The fact that you can't run 'submlinal' by itself on the command line at least tells me you don't have a global version of subliminal installed causing the wrong one to be referenced (good thing!). But the results you're experiencing still have me scratching my head. You're right by pointing out that now you found 0 results using the podnapisi provider. Yet you had 30 last time (which was really wrong too). It's just really, really weird.

Here is another thing you could try:
In your NZBGet configuration, you'll have a 'temporary' directory identified (it's global for all NZBScripts to use). For me, its set to ~/.NZBGet/tmp/ (but it might be different for you). Another directory that you'll have will be right in your /tmp directory. /tmp/nzbget-yoursysloginhere.
In both of these directories sits a file entitled subliminal.cache.dbm. For the one defined by NZBGet (configuration), you will probably also have to look in a subdirectory called subliminal for this file. I want you to delete these 2 files..

You see, to avoid beating a providers website to death, some content that is retrieved is cached here. By deleting this file, subliminal (Subliminal.py) will be forced to re-fetch all this information again (and re-cache it). Maybe your cache is just foobared for the podnapisi provider... *shrugs*. This step will rule this out anyway. :)

But the fact this is happening with your Plex addon too tells me the problem might be lower and specific to the version of python your using too. I'm sure the Plex Addon has a different cache file being written somewhere else on your system. It would be pretty crazy to think that 3 seperate cach files are all corrupt at the same time... But hey... who knows... You definitely stumped me as to how i can help you out here. For now your best option may be to just not use the podnapisi provider if the above doesn't work. If i think of something else, i'll definitely pass the info along! I'll have a look into the code too (hopefully this weekend) and see if i can spot something that would cause what you're experiencing. But at this time, i don't think there is a bug yet...

Moolan
Posts: 14
Joined: 22 Sep 2014, 09:40

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

Post by Moolan » 24 Sep 2014, 21:36

Hi I2g,

Thank you so much for your time.

I can confirm the Python version the comes with OS X is 2.7.5. I wonder would this has cause the differences.

I have tried deleting the cache in /NZBGet/cache/Subliminal/ the result is the same. My OS /tmp folder showed no files relating to NZBGet which makes sense as I just restarted the system.

I have also noticed in your case, the file is categorised as an "Episode" while mine is categorised as a "Movie", see below:

Mine:

Code: Select all

Listing subtitles with provider 'podnapisi' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
Yours:

Code: Select all

Listing subtitles with provider 'podnapisi' for video <Episode [u'True Blood', 7x2]> with languages set([<Language [en]>])
Also, checking the log for Plex Subliminal Agent (after clearing), is still giving me same error as I initially had - but I dont plan to keep this Agent anyway.

-----------------------

A bit more update, I ran the same script on the same episode in Linux and the output were exactly the same as yours. I figured it must be a difference in Python version, so I updated the Python to v2.7.8 using http://wolfpaulus.com/jounal/mac/installing_python_osx/

The outputs were the same, still thinking its a "Movie". I am out of ideas.

-----------------------

More updates: After some more testing in Linux, I found its the folder structure which caused this weird "movie" category. I will fix it up properly over the weekends and report back.

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

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

Post by l2g » 26 Sep 2014, 12:26

Moolan,
The Movie/TVSeries is determined from 'guessit'. Maybe your bug lies here somewhere.

Can you run the following (it's basically the same command you've been running, except with debug mode and exclusively dealing with podnapisi:

Code: Select all

python /Users/Username/Library/Application\ Support/NZBGet/scripts/Subliminal/Subliminal.py -D -p podnapisi -f -S /Users/Username/Movies/TV\ Shows/True\ Blood/Season\ 07/True\ Blood\ -\ S07E02\ -\ I\ Found\ You.mkv
It's qutie a bit more verbose, but could you please paste the output back here when your done?

Also, just run 'guessit' from your command prompt (just trying to see if you have a global version of it; similar to what we did with 'subliminal').

Thanks!

Moolan
Posts: 14
Joined: 22 Sep 2014, 09:40

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

Post by Moolan » 27 Sep 2014, 07:15

Hi I2g,

I have moved all my TV shows to a properly named folder and all is right again. I did notice Subliminal doesnt like special characters e.g. episodes from Hannibal will throw up errors.

I tried on a different episode this time, but the result is similar. Note 'Controlled" is just to make sure the problem still exist.

Controlled Input:

Code: Select all

Usernames-Mac-Mini:~ Username$ python /Users/Username/Library/Application\ Support/NZBGet/scripts/Subliminal/Subliminal.py -f -S /Users/Username/Movies/TV\ Shows/True\ Blood/Season\ 07/True\ Blood\ -\ S07E01\ -\ Jesus\ Gonna\ Be\ Here.mkv 
Controlled Output:

Code: Select all

2014-09-27 17:10:24,650 - 591 - INFO - Found 1 matched file(s).
2014-09-27 17:10:24,650 - 591 - INFO - Using advanced search mode
2014-09-27 17:10:24,650 - 591 - INFO - Using the following providers: podnapisi, opensubtitles, addic7ed, thesubdb, tvsubtitles
2014-09-27 17:10:24,650 - 591 - WARNING - Addic7ed provider dropped due to missing credentials
2014-09-27 17:10:24,808 - 591 - INFO - Scanning video 'True Blood - S07E01 - Jesus Gonna Be Here.mkv' in '/Users/Username/Movies/TV Shows/True Blood/Season 07'
2014-09-27 17:10:26,361 - 591 - INFO - Skipping provider 'tvsubtitles': no video to search for
2014-09-27 17:10:26,361 - 591 - INFO - Listing subtitles with provider 'podnapisi' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-27 17:10:28,835 - 591 - INFO - Found 0 subtitles
2014-09-27 17:10:28,835 - 591 - INFO - Listing subtitles with provider 'thesubdb' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-27 17:10:30,444 - 591 - INFO - Found 0 subtitles
2014-09-27 17:10:30,444 - 591 - INFO - Listing subtitles with provider 'opensubtitles' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-27 17:10:31,059 - 591 - INFO - Found 1 subtitles
2014-09-27 17:10:31,059 - 591 - INFO - 'episode' is not a valid movie_kind for <Movie [u'True Blood']>
2014-09-27 17:10:31,059 - 591 - INFO - Computed score 0 with matches set([])
2014-09-27 17:10:31,059 - 591 - INFO - Downloading subtitle <OpenSubtitlesSubtitle [en]> with score 0 into u'/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.en.srt'
2014-09-27 17:10:34,943 - 591 - INFO - Matched 1 possible subtitle(s) for True Blood - S07E01 - Jesus Gonna Be Here.mkv
Debug Input:

Code: Select all

Usernames-Mac-Mini:~ Username$ python /Users/Username/Library/Application\ Support/NZBGet/scripts/Subliminal/Subliminal.py -D -p podnapisi -f -S /Users/Username/Movies/TV\ Shows/True\ Blood/Season\ 07/True\ Blood\ -\ S07E01\ -\ Jesus\ Gonna\ Be\ Here.mkv 
Debug Output:

Code: Select all

[INFO] [DEBUG] Script mode forced off.
2014-09-27 17:05:25,066 - 561 - DEBUG - set(config) FORCE="True"
2014-09-27 17:05:25,066 - 561 - DEBUG - set(environment) FORCE="1"
2014-09-27 17:05:25,066 - 561 - DEBUG - set(config) PROVIDERS="podnapisi"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(environment) PROVIDERS="podnapisi"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(config) MAXAGE="24"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(environment) MAXAGE="24"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(config) LANGUAGES="en"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(environment) LANGUAGES="en"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(config) FETCHMODE="BestScore"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(environment) FETCHMODE="BestScore"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(environment) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(config) SCANDIRECTORIES="/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv"
2014-09-27 17:05:25,067 - 561 - DEBUG - set(environment) SCANDIRECTORIES="/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv"
2014-09-27 17:05:25,067 - 561 - DEBUG - get(config) VIDEOEXTENSIONS=".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2014-09-27 17:05:25,068 - 561 - DEBUG - get(config) MAXAGE="24"
2014-09-27 17:05:25,068 - 561 - DEBUG - get(config) FORCE="True"
2014-09-27 17:05:25,068 - 561 - DEBUG - get(config) SCANDIRECTORIES="/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv"
2014-09-27 17:05:25,069 - 561 - DEBUG - get(default) SINGLE="False"
2014-09-27 17:05:25,069 - 561 - DEBUG - get_files('/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv') with 11 filter(s)
2014-09-27 17:05:25,069 - 561 - DEBUG - Allowed True Blood - S07E01 - Jesus Gonna Be Here.mkv (suffix)
2014-09-27 17:05:25,069 - 561 - INFO - Found 1 matched file(s).
2014-09-27 17:05:25,069 - 561 - DEBUG - Scanning "/Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv"
2014-09-27 17:05:25,069 - 561 - DEBUG - get(default) OVERWRITE="no"
2014-09-27 17:05:25,069 - 561 - DEBUG - get(system) TEMPDIR="/var/folders/12/kymcdrrn6k91k7lplmcrns540000gn/T/nzbget-Username"
2014-09-27 17:05:25,069 - 561 - DEBUG - get(default) CACHEDIR="/var/folders/12/kymcdrrn6k91k7lplmcrns540000gn/T/nzbget-Username"
2014-09-27 17:05:25,069 - 561 - DEBUG - get(default) SEARCHMODE="advanced"
2014-09-27 17:05:25,070 - 561 - INFO - Using advanced search mode
2014-09-27 17:05:25,070 - 561 - DEBUG - get(config) PROVIDERS="podnapisi"
2014-09-27 17:05:25,070 - 561 - INFO - Using the following providers: podnapisi
2014-09-27 17:05:25,070 - 561 - DEBUG - get(config) LANGUAGES="en"
2014-09-27 17:05:25,070 - 561 - DEBUG - get(config) FETCHMODE="BestScore"
2014-09-27 17:05:25,070 - 561 - DEBUG - Fetch Mode: BestScore
2014-09-27 17:05:25,475 - 561 - DEBUG - get_files('/Users/Username/Movies/TV Shows/True Blood/Season 07') with 1 filter(s)
2014-09-27 17:05:25,476 - 561 - DEBUG - Scanning [advanced] using /Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv lang=en
2014-09-27 17:05:25,476 - 561 - INFO - Scanning video 'True Blood - S07E01 - Jesus Gonna Be Here.mkv' in '/Users/Username/Movies/TV Shows/True Blood/Season 07'
2014-09-27 17:05:25,816 - 561 - DEBUG - Size is 1801792545
2014-09-27 17:05:25,861 - 561 - DEBUG - Computed hashes {u'opensubtitles': u'fc860419de32f58c', u'thesubdb': u'c088ba8507ff43a094d488ff5b0a5301'}
2014-09-27 17:05:25,861 - 561 - DEBUG - Found subtitles set([])
2014-09-27 17:05:25,906 - 561 - DEBUG - Found video_codec h264 with enzyme
2014-09-27 17:05:25,906 - 561 - DEBUG - Found audio_codec AC3 with enzyme
2014-09-27 17:05:25,906 - 561 - DEBUG - MKV has no subtitle track
2014-09-27 17:05:25,906 - 561 - DEBUG - get(default) TVCATEGORIES="[]"
2014-09-27 17:05:25,906 - 561 - DEBUG - Guessing using: /Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv
2014-09-27 17:05:25,916 - 561 - DEBUG - get(default) CATEGORY=""
2014-09-27 17:05:25,916 - 561 - DEBUG - Type: movie
2014-09-27 17:05:26,488 - 561 - DEBUG - Skipping provider 'opensubtitles': not in the list
2014-09-27 17:05:26,488 - 561 - DEBUG - Skipping provider 'addic7ed': not in the list
2014-09-27 17:05:26,488 - 561 - DEBUG - Skipping provider 'thesubdb': not in the list
2014-09-27 17:05:26,488 - 561 - DEBUG - Skipping provider 'tvsubtitles': not in the list
2014-09-27 17:05:26,488 - 561 - INFO - Listing subtitles with provider 'podnapisi' for video <Movie [u'True Blood']> with languages set([<Language [en]>])
2014-09-27 17:05:26,488 - 561 - DEBUG - Searching episode {u'sK': u'True Blood', u'sJ': 2, u'sXML': 1}
2014-09-27 17:05:29,395 - 561 - INFO - Found 0 subtitles
2014-09-27 17:05:29,395 - 561 - WARNING - No subtitles were found.
Input:

Code: Select all

Usernames-Mac-Mini:~ Username$ guessit --version
Output:

Code: Select all

-bash: guessit: command not found
I hope this is helpful in nailing those bugs.

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

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

Post by l2g » 29 Sep 2014, 13:52

Moolan,

I appologize, i haven't had time to work on it this weekend. Sadly the debug switch doesn't seem to reveal to much of how guessit got to deciding it was a movie:
2014-09-27 17:05:25,916 - 561 - DEBUG - Type: movie

However! It did show the path it has to work with:
2014-09-27 17:05:25,906 - 561 - DEBUG - Guessing using: /Users/Username/Movies/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv

As human beings (with our memories) we can look at that and just know right away it's a TV Show. But i think where guessit is getting hung up on is the fact the path contains 'Movies' in the path it is parsing. Guessit works with you (as it's user). If you tell it to look in a directory entitled 'Movies', it thinks you're helping it it out.

Can I suggest just create 2 directories for your downloads (you can use the Categories in NZBGet to automate this whole process for you; it works really well!).
  1. Create a category called 'movies' which puts content here: /Users/Username/Movies
  2. Create another category entitled 'tv' that puts content here: /Users/Username/TV Shows.
Using categories, you can easily set it up to parse the nzb/rss feed coming in and set the category based on specific keywords found within it (set this in the Aliases field). For movies put: 'movies*' (without quotes). For TV, i use: 'hdtv, tv*, s??e??' (again... without quotes).

Right now, I would guess that if your episodes resided in /Users/Username/TV Shows/True Blood/Season 07/True Blood - S07E01 - Jesus Gonna Be Here.mkv, you might have better luck. I'm still being stuborn here and not acknowledging a bug *yet* :).

Edit: For future reference too, this line shows you where you can find your subliminal cache file (in case you want to ever remove it in the future):
2014-09-27 17:05:25,069 - 561 - DEBUG - get(default) CACHEDIR="/var/folders/12/kymcdrrn6k91k7lplmcrns540000gn/T/nzbget-Username"

deoneR
Posts: 22
Joined: 30 May 2013, 16:35

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

Post by deoneR » 29 Sep 2014, 19:49

Hello,

I just setup nzbget with this script on my vu+ duo2 (enigma2 receiver). Nzbget is running fine but i can't get this script to run - i'm getting this error lines in my log:

Code: Select all

Mon Sep 29 16:02:00 2014	INFO	Executing scheduler-script Subliminal.py for Task2
Mon Sep 29 16:02:01 2014	INFO	Subliminal: Traceback (most recent call last):
Mon Sep 29 16:02:01 2014	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal.py", line 199, in <module>
Mon Sep 29 16:02:01 2014	INFO	Subliminal:     from guessit import matcher
Mon Sep 29 16:02:01 2014	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/guessit/__init__.py", line 23, in <module>
Mon Sep 29 16:02:01 2014	INFO	Subliminal:     import pkg_resources
Mon Sep 29 16:02:01 2014	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/pkg_resources.py", line 679, in <module>
Mon Sep 29 16:02:01 2014	INFO	Subliminal:     class Environment(object):
Mon Sep 29 16:02:01 2014	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/pkg_resources.py", line 682, in Environment
Mon Sep 29 16:02:01 2014	INFO	Subliminal:     def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
Mon Sep 29 16:02:01 2014	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/pkg_resources.py", line 73, in get_supported_platform
Mon Sep 29 16:02:01 2014	INFO	Subliminal:     plat = get_build_platform(); m = macosVersionString.match(plat)
Mon Sep 29 16:02:01 2014	INFO	Subliminal:   File "/usr/share/nzbget/scripts/Subliminal/pkg_resources.py", line 210, in get_build_platform
Mon Sep 29 16:02:01 2014	INFO	Subliminal:     from distutils.util import get_platform
Mon Sep 29 16:02:01 2014	INFO	Subliminal: ImportError: No module named distutils.util
my python version

Code: Select all

Python 2.7.2 (default, Jun 13 2014, 22:20:20)
[GCC 4.6.4 20120303 (prerelease)] on linux2
what am i doing wrong?

thanks for any help

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

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

Post by l2g » 29 Sep 2014, 20:56

DeoneR:

distutils ships with Python to my knowledge... it's part of the python core package.
I'm not familiar with the vu+ duo2 (enigma2 receiver), but upon Googling it, it sure looks cool. Do you know if you have shell access to it (i'm guessing you do and thats how NZBGet got on it?).. Python Too? I think your python release may requiring adjusting (distutils by default is definitely part of the v2.7.x tree).

This link suggests some alternatives to installing distutils (if it isn't already avaialble)
As root... one of these commands may solve your problem:

Code: Select all

# Opkg is a lightweight package management system. (used by some tools like your using)
# this may or may not work for you... worth a try:
opkg install python-distutils
# ...or... Red Hat Based (CentOS, Fedora, RHEL):
yum install python-libs
# ...or... Debian Based (Ubuntu, Debian, etc):
sudo apt-get install python-distutils

deoneR
Posts: 22
Joined: 30 May 2013, 16:35

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

Post by deoneR » 30 Sep 2014, 16:14

hey l2g,

i searched for the distutils package for the platform and just installed it (python-distutils_2.7.2-r8.17_mips32el.ipk) and everything is working now without any problem :)

thanks for the help

/e
one more question - how can i stop the script vom renaming the srt file to moviename.en.srt to just moviename.srt (i want to get rid auf the .en)

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

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

Post by l2g » 30 Sep 2014, 20:05

deoneR wrote:one more question - how can i stop the script vom renaming the srt file to moviename.en.srt to just moviename.srt (i want to get rid auf the .en)
Of course, this is called 'Single Mode'. By default this is already set when you run it through NZBGet (unless you turn the option off). Buf when debugging or just running it manually from the command line, just specify the the --single (or -s) switch. Hence:

Code: Select all

# Scan a directory of movies (recursively)
./Subliminal.py -f -s -S /path/to/movies/dir/

# Or... Justs scan a single movie
./Subliminal.py -f -s -S /path/to/movies/dir/mymovie/mymovie.mkv

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests