Closed jcasteels closed 8 years ago
I'm running into the same issue from a build I downloaded last night.
I'm not sure it's the build if i retry with the old version i get the same error on the requests when i try running SABPostProcess.py from SABnzbd. Maybe it's the module versions ??
I'm running into this on my Synology DS216+ as well. Cloned the repo today.
File "/volume1/itunes/Process/sickbeard_mp4_automator/postConversion.py", line 8, in from readSettings import ReadSettings File "/volume1/itunes/Process/sickbeard_mp4_automator/readSettings.py", line 11, in from babelfish import Language ImportError: No module named babelfish
Manual.py works fine...
Ok, resolved my issue by pointing to a different python executable.
Only time I've seen this become an issue is when multiple Python environments end up existing on the same system and the environment loaded up by some of the post processing scripts is different than the one loaded by manual.py and missing the dependencies.
Sent from my iPhone
On May 20, 2016, at 08:01, Deddiekoel notifications@github.com wrote:
I'm running into this on my Synology DS216+ as well. Cloned the repo today.
File "/volume1/itunes/Process/sickbeard_mp4_automator/postConversion.py", line 8, in from readSettings import ReadSettings File "/volume1/itunes/Process/sickbeard_mp4_automator/readSettings.py", line 11, in from babelfish import Language ImportError: No module named babelfish
Manual.py works fine...
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub
It seems like it, I'm trying to figure out what is happening where. Currently subliminal isn't working.
Script result: 2016-05-20 15:00:46 - SickbeardPostConversion - INFO - Sickbeard extra script post processing started. 2016-05-20 15:00:46 - readSettings - WARNING - Audio bitrate was invalid, defaulting to 256 per channel. 2016-05-20 15:00:49 - readSettings - ERROR - Subliminal is not installed, automatically downloading of subs has been disabled. Traceback (most recent call last): File "/volume1/itunes/Process/sickbeard_mp4_automator/readSettings.py", line 262, in init import subliminal File "build/bdist.linux-x86_64/egg/subliminal/init.py", line 11, in File "build/bdist.linux-x86_64/egg/subliminal/core.py", line 13, in ImportError: cannot import name guessit 2016-05-20 15:00:49 - SickbeardPostConversion - INFO - Processing /volume1/itunes/TV Shows/The Blacklist/Season 3/The Blacklist - S03E23 Alexander Kirk Conclusion (2).mp4. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Reading video stream. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Video codec detected: h264. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Pix Fmt: yuv420p. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Reading audio streams. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Audio detected for stream #1: aac [eng]. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Creating audio stream 0 from source stream 1. 2016-05-20 15:00:56 - mkvtomp4 - INFO - Reading subtitle streams. 2016-05-20 15:00:56 - mkvtomp4 - ERROR - Unable to verify subtitle languages for download. Traceback (most recent call last): File "/volume1/itunes/Process/sickbeard_mp4_automator/mkvtomp4.py", line 479, in generateOptions languages.add(Language(alpha3)) File "build/bdist.linux-x86_64/egg/babelfish/language.py", line 82, in init raise ValueError('%r is not a valid language' % language) ValueError: 'dut' is not a valid language 2016-05-20 15:00:56 - mkvtomp4 - INFO - Starting conversion. 2016-05-20 15:03:43 - mkvtomp4 - INFO - /volume1/itunes/TV Shows/The Blacklist/Season 3/The Blacklist - S03E23 Alexander Kirk Conclusion (2).mp4 created. 2016-05-20 15:03:50 - SickbeardPostConversion - INFO - Tagging /volume1/itunes/TV Shows/The Blacklist/Season 3/The Blacklist - S03E23 Alexander Kirk Conclusion (2).mp4 with ID 266189 season 3 episode 23. 2016-05-20 15:03:59 - tvdb_mp4 - INFO - Tagging file: /volume1/itunes/TV Shows/The Blacklist/Season 3/The Blacklist - S03E23 Alexander Kirk Conclusion (2).mp4. 2016-05-20 15:04:00 - tvdb_mp4 - INFO - Trying to write tags. 2016-05-20 15:04:00 - tvdb_mp4 - INFO - Tags written successfully. 2016-05-20 15:04:00 - mkvtomp4 - INFO - Relocating MOOV atom to start of file. 2016-05-20 15:04:00 - qtfaststart - INFO - Removing free atom at 32 (8 bytes) 2016-05-20 15:04:00 - qtfaststart - INFO - Patching stco with 60060 entries 2016-05-20 15:04:00 - qtfaststart - INFO - Patching stco with 60060 entries 2016-05-20 15:04:00 - qtfaststart - INFO - Writing output... 2016-05-20 15:05:11 - SickbeardPostConversion - ERROR - Couldn't refresh Sickbeard, check your autoProcess.ini settings. Traceback (most recent call last): File "/volume1/itunes/Process/sickbeard_mp4_automator/postConversion.py", line 63, in refresh = json.load(urllib.urlopen(settings.getRefreshURL(tvdb_id))) File "/usr/lib/python2.7/urllib.py", line 87, in urlopen return opener.open(url) File "/usr/lib/python2.7/urllib.py", line 213, in open return getattr(self, name)(url) File "/usr/lib/python2.7/urllib.py", line 350, in open_http h.endheaders(data) File "/usr/lib/python2.7/httplib.py", line 1100, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 931, in _send_output self.send(msg) File "/usr/lib/python2.7/httplib.py", line 893, in send self.connect() File "/usr/lib/python2.7/httplib.py", line 870, in connect self.timeout, self.source_address) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err IOError: [Errno socket error] [Errno 111] Connection refused
@Deddiekoel can you tell me what you just did to point it running on Synology as well. As far as i know i only installed python2.7 from packages and nothing else.
I also installed easy_install and all the packages (like the readme.md mentioned...)
@Deddiekoel i did that too. But where did you point to a different python i want to now that. Cause that might solve my issue
In SickRage in the "extra scripts" part I used the absolute path. But that only got me past the Babelfish error. Now I have other problems. I want to try removing and reinstalling Python now.
Connection is being refused by Sickbeard for the refresh causing that error. Check your Sickbeard settings in autoProcess.ini
Sent from my iPhone
On May 20, 2016, at 09:10, Deddiekoel notifications@github.com wrote:
Ok, reinstalled. Now pointing to /usr/bin/python in the extra_scripts field. This should be the same one that manual.py would use. Still getting the subliminal errors. Strange this is, when I run "import guessit" in python it works. Trying guessit v2 that comes with subliminal.
Another thing I've noticed is that manual.py is significantly faster then the post processing scripts. So, for me manual gives me better results and it gives me better performance...
Manual.py and the integrated scripts are all just empty shells that reference the same functions in mkvtomp4.py. Conversion should be identical speeds. The only delay may come from the integrated scripts waiting for refreshing.
Sent from my iPhone
On May 20, 2016, at 09:50, Deddiekoel notifications@github.com wrote:
Ok, reinstalled. Now pointing to /usr/bin/python in the extra_scripts field. This should be the same one that manual.py would use. Still getting the subliminal errors. Strange this is, when I run "import guessit" in python it works. Trying guessit v2 that comes with subliminal.
Another thing I've noticed is that manual.py is significantly faster then the post processing scripts. So, for me manual gives me better results and it gives me better performance...
— You are receiving this because you commented. Reply to this email directly or view it on GitHub
@Deddiekoel @mdhiggins still don't understand what my error is then. Can i hardcode the python path somewhere in the script to call it? cause i don't use the same setup as @Deddiekoel. Or do i find my environment variables on synology to change this? Does anybody now where those are stated in syno?
Ok, switching to guessit v2 fixed the errors in the post processing scripts but they broke manual.py...(as it says in the readme.md)
This is my SickRage part in the .ini
[Sickrage] host = localhost port = 8083 username = password = web_root = ssl = 0 api_key = xxx
I had a username & password in there as well, but that didn't make a difference.
Also getting this in the SickRage logs: 2016-05-20 15:51:33 - mkvtomp4 - INFO - Unable to download subtitles. Traceback (most recent call last): File "/volume1/itunes/Process/sickbeard_mp4_automator/mkvtomp4.py", line 500, in generateOptions video = subliminal.scan_video(os.path.abspath(inputfile), subtitles=True, embedded_subtitles=True) TypeError: scan_video() got an unexpected keyword argument 'subtitles'
Oh, speed is the same. Ran manual.py on a smaller file before. Switching back to guessit<2 makes manual.py work again, however it does state the following:
Subliminal is not installed, automatically downloading of subs has been disabled.
Traceback (most recent call last):
File "/volume1/itunes/Process/sickbeard_mp4_automator/readSettings.py", line 262, in init
import subliminal
File "build/bdist.linux-x86_64/egg/subliminal/init.py", line 11, in
That's the same error the post processing spits out. Manual also downloads the artwork, where post processing doesn't...
Disabled downloading of subtitles. As SickRage does that as well. But still confused as to why the manual scripts downloads the artwork and the post-processing doesn't...
Is the postprocessing script actually running?
Sent from my iPhone
On May 20, 2016, at 10:42, Deddiekoel notifications@github.com wrote:
Disabled downloading of subtitles. As SickRage does that as well. But still confused as to why the manual scripts downloads the artwork and the post-processing doesn't...
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
Yes, it's converted the .mkv to an mp4 and it's written metadata. However it hasn't downloaded the artwork nor has it picked up the .srt file that is in the same location as the .mkv.
Going to try to create a shell script to feed into the manual script.
For what purpose?
Also I think since subliminal has switched to the new version of guess it I may have to update to the new version as well. You could try using an older version of subliminal that still uses guess it 1 so there's not conflict until I have time to rewrite manual.py
Sent from my iPhone
On May 20, 2016, at 12:56, Deddiekoel notifications@github.com wrote:
Going to try to create a shell script to feed into the manual script.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
Ok, that seems like a good idea. Do you know what version of subliminal that is?
And for me the purpose is that the manual script works a lot better then the postConversion script. Routing into manual seems to meet my needs for now.
After that I could also take a stab at the postConversion script.
It just seems silly since the errors you are experiencing are definitely from some quirk with your setup we've yet to identify. Shoehorning manual.py is just a bandaid.
On my phone and not sure when they switched over so can't say for sure but if you check their git it should be easy to tell.
Is there any logging from postConversion.py in the log files that indicates why it isn't doing artwork? It might be a permissions thing with the artwork file in your temp directory.
Sent from my iPhone
On May 20, 2016, at 13:02, Deddiekoel notifications@github.com wrote:
Ok, that seems like a good idea. Do you know what version of subliminal that is?
And for me the purpose is that the manual script works a lot better then the postConversion script. Routing into manual seems to meet my needs for now.
After that I could also take a stab at the postConversion script.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub
Ok, agreed. I'll revert to the older version of subliminal and see what logging I can get!
@mdhiggins i don't think my issue is still used for my problem but @Deddiekoel took my post over. You can therefor close my issue since i solved my issue There where indeed 2 different python versions on the synology now it's running over the correct one and SABPostProcess.py works perfect!
How did you point to the correct Python? Absolute path?
Yeah most of the time these issues with dependencies not showing up is likely secondary to multiple instances of python existing on the same machine and only one of them having the proper packages installed with PIP.
Its been a huge headache for troubleshooting (not that its anyones fault) since I switched over from just dumping the packages into the root of the script vs trying to do it properly with PIP. Makes me wonder if that was the right move after all lol.
Just merged in a commit that might resolve the artwork issue, and should at the very least provide some additional logging that will indicate when there is a problem downloading the artwork. If you wanna update and try that.
The manual.py rewrite will take some time as guessit 2 is completely different from guessit 1 and all the syntax will need to be rewritten
Looks like subliminal just released version 2.0 RC1 which uses the newer version of guessit. Anything less than version 2.0 should still be compatible.
In fast, just like with guessit doing the following should be acceptable until I can update for these new versions
pip install subliminal<2
Sweet! Will try that one.
Any ideas on how to fix the original issue on OS X? As far as I can tell, I only have one version of python installed (2.7.11).
@abhishekjain14 what happens when you run "import babelfish" from the python commandline?
@mdhiggins your remark about the permissions seems accurate. Just ran a shell script as post processing and the result was an .mp4 file without the artwork!
For anyone interested this was my shell script:
#!/bin/bash
/usr/bin/python /path/to/sickbeard_mp4_automator/manual.py -i "$1" -tv "$3" -s "$4" -e "$5" -a -cmp4
It returns with no output. For comparison, "import babelfis" throws an error:
Python 2.7.11 (default, Jan 22 2016, 08:29:18) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import babelfish import babelfis Traceback (most recent call last): File "
", line 1, in ImportError: No module named babelfis
Ok, then that would suggest that you do have multiple instances of Python running...
Is there any way to get rid of multiple versions or force Sonarr to use a particular one?
Not familiar with Sonarr. But if you can control what Python binary it uses that would be the way.
@mdhiggins dowgraded my subliminal version and PostConversion.py runs without errors (sub download still off though). Two things are still off. The name of the file is stripped of the title of the episode. So "Show S0xE0y Title.mkv" becomes "Show S0xE0y.mp4". Don't know why that is. And the artwork is still missing.
Ok, (with some effort) I dropped the sickbeard-custom user and created it prior to reinstalling the package. First test indicates artwork now being downloaded! But the issue with the call back to Sickbeard persists...
Sickbeard callback works if you configure the sickbeard part. Not so much if you only config the SickRage part.
Since I hijacked this issue I'd figure I'd recap my findings.
The babelfish issue seems to be caused by multiple instances of Python running on the system and one of those missing the babelfish module. The solution is to make sure that you know what python version has the module and point sickbeard there for post-processing.
On my Synology I also had some issues. For me following fixed those:
@mdhiggins also wanted to say that this module is fantastic, truly magical stuff!
@Deddiekoel To follow up, I was able to specify a Python binary by replacing the /usr/bin/env python at the top of postSonarr.py (Probably not the best way to do it, but it does the job). I am getting a different error, but not one that has to do with this issue. Thanks for all of the help!
Just pushed a commit that adds a line to readSettings.py that spits out the path to the python executable. this should be helpful in identifying if a python binary does not match (for example if manual.py works and some other script doesn't and the python binary paths don't match) then there's 2 instances of python on your setup and one doesn't meet the requirements to run the script.
Dear all,
I upgraded to the latest sickbeard_mp4_automater and changed from sickbeard to sonarr but running in the following problem when the script runs
Supergirl.S01E05.RNFO.720p.HDTV.X264-DIMENSION
File "/usr/local/sabnzbd/var/scripts/sickbeard_mp4_automator-master/postSonarr.py", line 5, in
from readSettings import ReadSettings
File "/volume1/@appstore/sabnzbd/var/scripts/sickbeard_mp4_automator-master/readSettings.py", line 11, in
from babelfish import Language
ImportError: No module named babelfish
but babelfish is installed
pip list babelfish (0.5.5) beautifulsoup4 (4.4.1) chardet (2.3.0) click (6.3) decorator (4.0.9) dict (0.0.5) dogpile.cache (0.5.7) dogpile.core (0.4.1) enzyme (0.4.1) get (0.0.7) guessit (0.11.0) modules (1.0.0) pbr (1.8.1) pip (8.1.2) post (0.0.5) public (0.0.0) pysrt (1.1.0) python-dateutil (2.5.1) qtfaststart (1.8) query-string (0.0.5) rebulk (0.7.1) request (0.0.5) requests (2.9.1) requests-cache (0.4.11) self (0.0.5) setuptools (2.2) six (1.10.0) stevedore (1.12.0) subliminal (1.1.1) VideoConverter (1.1.0) wheel (0.29.0)
When i try to do it from sab without sonarr SABpostProcess.py i get a simular error but the about requests what you see is also installed
python -V Python 2.7.9
Processing with the manual.py works perfectly i do not get any error there.
Thanks for the support