nzbToMedia icon indicating copy to clipboard operation
nzbToMedia copied to clipboard

Post processing no longer working after upgrade to Sab3

Open GTunney opened this issue 4 years ago • 9 comments

I copied my nzbtomedia config on my QNAP nas from sab 2.3.9 to my new sab 3 install.

When trying to postprocess i get the below error. I have also tried the manual cleanup steps found in Issue#1585 but this resulted in the below error when trying to run.

Any help would be appreciated.

[/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia] # find . -name "*.pyc" -exec rm -f {} ; find: -exec requires an argument [/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia] #

`/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/eol.py:147: LifetimeWarning: Python 2.7 is no longer supported. warnings.warn(msg, LifetimeWarning) Changing to directory: /share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia

-- Cleaning bytecode -- Removing cleanup.pyc Removing eol.pyc Removing nzbToMedia.pyc

Removing cleanup.pyc Removing eol.pyc Removing nzbToMedia.pyc

-- Cleaning folders: [u'libs', u'core'] -- No folders to clean

Returning to directory: /share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SABnzbd-3.0.0

-- Cleanup finished --

Traceback (most recent call last): File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/nzbToCouchPotato.py", line 269, in import nzbToMedia File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/nzbToMedia.py", line 730, in import core File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/core/init.py", line 52, in from core import logger, main_db, version_check, databases, transcoder File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/core/databases.py", line 11, in from core.utils import backup_versioned_file File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/core/utils/init.py", line 13, in from core.utils.common import clean_dir, flatten, get_dirs, process_dir File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/core/utils/common.py", line 14, in from core.utils.files import list_media_files, move_file File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/core/utils/files.py", line 14, in import beets.mediafile File "/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia/libs/common/beets/mediafile.py", line 51, in import imghdr ImportError: No module named imghdr`

GTunney avatar Aug 05 '20 13:08 GTunney

try

cd /share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia
find . -iname "*.pyc" -exec rm -f {} ;
git clean -fdx -e *.* -e !*.py[co] -e !/**/__pycache__/
git clean -fdx core libs

clinton-hall avatar Aug 06 '20 07:08 clinton-hall

Hi Clinton,

Still the same issue after running the above which also resulted in a few errors.

[~] # cd /share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia [/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia] # find . -iname "* .pyc" -exec rm -f {} ; find: -exec requires an argument [/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia] # git clean -fdx - e *.* -e !*.py[co] -e !/**/__pycache__/ -sh: !/**/__pycache__/: event not found [/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia] # git clean -fdx core libs [/share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/nzbToMedia] #

GTunney avatar Aug 06 '20 08:08 GTunney

ok... lets just try a clean install

cd /share/CACHEDEV1_DATA/.qpkg/QSabNZBd3/SAB_CONFIG/
mv nzbToMedia nzbToMedia.old
git clone https://github.com/clinton-hall/nzbToMedia.git
cp nzbToMedia.old/autoProcessMedia.cfg nzbToMedia/autoProcessMedia.cfg

see if that runs ok.

clinton-hall avatar Aug 07 '20 05:08 clinton-hall

actually... I think this might be related to #1758

See if updating python3 via entware works for you.

clinton-hall avatar Aug 07 '20 05:08 clinton-hall

Ok fresh install didn't work. Installed entware and installed python3 but for some reason nzbtomedia is still picking up python 2.7.5 even though python maps to 3.8.3

[~] # which python
/opt/bin/python
[~] # python
Python 3.8.3 (default, Jun 12 2020, 20:24:48)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

/usr/bin/env python also returns python 3.8.3 which is what i believe the eol.py script calls?

Also this only occurred when I changed from Sab 2.3.9 to 3.0 package.

My Sab 2.3.9 still processes absolutely fine despite processing with python 2.7

GTunney avatar Aug 07 '20 07:08 GTunney

actually... I think this might be related to #1758

See if updating python3 via entware works for you.

Hi Clinton,

Is there any particular update on this? OneCD mentioned something about nzbtomedia using the built in python on the NAS and not python3 / entware.

GTunney avatar Aug 12 '20 13:08 GTunney

I'm not sure about this. USUALLY, SABnzbd would call .py scripts in Python, so I thought it was SABnzbd that defined the Python version to be called???

I do know that @OneCDOnly is working on the sherpa project and looking to add nzbToMedia... perhaps this package will resolve this issue?

clinton-hall avatar Aug 12 '20 22:08 clinton-hall

Yup, working fine via sherpa. :+1:

I recall @Safihre recently confirmed that post-processing scripts selected by SABnzbd are executed according to their hashbang directives - which are not necessarily the same as the Python environment SABnzbd is running in.

As sherpa no-longer needed Python 2, I chose to make Python 3 the default:

ln -s /opt/bin/python3 /opt/bin/python

So now, any calls to python invoke Python 3. Including nzbToMedia. :wink:

OneCDOnly avatar Aug 12 '20 23:08 OneCDOnly

I'm not sure about this. USUALLY, SABnzbd would call .py scripts in Python, so I thought it was SABnzbd that defined the Python version to be called???

I do know that @OneCDOnly is working on the sherpa project and looking to add nzbToMedia... perhaps this package will resolve this issue?

Thanks Clinton, I’ll have to look into moving my things over from Stephanes packages. Shame as I’ve used his packages for years but seems every man and his dog is now using Sherpa on QNAPs.

GTunney avatar Aug 13 '20 07:08 GTunney