Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gz files have no extraction command (only .tar.gz do) #1715

Closed
rnd256 opened this issue Feb 4, 2020 · 5 comments · Fixed by #1781
Closed

.gz files have no extraction command (only .tar.gz do) #1715

rnd256 opened this issue Feb 4, 2020 · 5 comments · Fixed by #1781

Comments

@rnd256
Copy link

rnd256 commented Feb 4, 2020

Describe the bug
nzbToMedia.py fails to extract any *.nzb.gz file. I think it's because there's no command listed for *.gz like there is for *.tar.gz:

'.tar.gz': ['tar', '-xzf'], '.tgz': ['tar', '-xzf'],

if os.path.splitext(ext[0])[1] == '.tar':

Technical Specs

  1. Running on: Linux, inside a Docker container.
  2. Python version: 2.7
  3. Download Client: SABnbzd
  4. Intended Media Management: Mesuda

Expected behavior
The extraction succeeds for *.nzb.gz files.

Log

/nzbtomedia/eol.py:147: LifetimeWarning: Python 2.7 is no longer supported.
warnings.warn(msg, LifetimeWarning)
[03:51:35] [INFO]::MAIN: Loading config from [/nzbtomedia/autoProcessMedia.cfg]
[03:51:35] [INFO]::MAIN: Python v2.7 reached end of life 27 days ago.
[03:51:35] [WARNING]::MAIN: Please upgrade to a more recent Python version.
[03:51:35] [INFO]::MAIN: Checking database structure...
[03:51:35] [INFO]::MAIN: Checking if git needs an update
[03:51:35] [ERROR]::MAIN: Unable to determine installed version via git, please check your logs!
[03:51:35] [INFO]::MAIN: No update needed
[03:51:35] [INFO]::MAIN: nzbToMedia Version:12.1.04 Branch:master (Linux 4.4.0-165-generic)
[03:51:35] [WARNING]::MAIN: Failed to locate ffmpeg. Transcoding disabled!
[03:51:35] [WARNING]::MAIN: Install ffmpeg with x264 support to enable this feature  ...
[03:51:35] [WARNING]::MAIN: Failed to locate ffprobe. Video corruption detection disabled!
[03:51:35] [WARNING]::MAIN: Install ffmpeg with x264 support to enable this feature  ...
[03:51:35] [INFO]::MAIN: #########################################################
[03:51:35] [INFO]::MAIN: ## ..::[nzbToMedia.pyc]::.. ##
[03:51:35] [INFO]::MAIN: #########################################################
[03:51:35] [INFO]::MAIN: Script triggered from SABnzbd 0.7.17+
[03:51:35] [INFO]::MAIN: Auto-detected SECTION:SickBeard
[03:51:35] [INFO]::MAIN: Extracting /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz to /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__
[03:51:35] [ERROR]::MAIN: EXTRACTOR: Extraction failed for /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz. Result was 1
[03:51:35] [INFO]::MAIN: Calling SickBeard:tv to post-process:<REDACTED>.nzb
[03:51:35] [INFO]::MAIN: Attempting to auto-detect tv fork
[03:51:35] [INFO]::MAIN: SickBeard:tv fork auto-detection successful ...
[03:51:35] [INFO]::MAIN: SickBeard:tv fork set to Medusa-api
[03:51:35] [INFO]::MAIN: Extracting /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz to /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__
[03:51:35] [ERROR]::MAIN: EXTRACTOR: Extraction failed for /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz. Result was 1
[03:51:35] [WARNING]::SICKBEARD: No media files found in directory /downloads/sabnzbd/incomplete/<REDACTED>. Processing this as a failed download
[03:51:35] [POSTPROCESS]::SICKBEARD: FAILED: The download failed. Sending 'failed' process request to Medusa-api branch
[03:51:35] [INFO]::CLEANDIR: Directory /downloads/sabnzbd/incomplete/<REDACTED> has been processed and removed ...
[03:51:35] [INFO]::MAIN: The /nzbtomedia/nzbToSickBeard.py script completed successfully.
Changing to directory: /nzbtomedia

-- Cleaning bytecode --
WARNING: Automatic cleanup could not be executed.
If errors occur, manual cleanup may be required.
REASON : Error: [Errno 2] No such file or directory

-- Cleaning folders: [u'libs', u'core'] --
WARNING: Automatic cleanup could not be executed.
If errors occur, manual cleanup may be required.
REASON : Error: [Errno 2] No such file or directory
Returning to directory:  /usr/bin

-- Cleanup finished --

SickBeard: Successfully post-processed <REDACTED>.nzb!
@rnd256
Copy link
Author

rnd256 commented Feb 4, 2020

Follow-up question: Is sabnzbd+ itself supposed to be handling extracting *.nzb.gz files? Or is it correct behavior that that extraction work is being left to nzbToMedia scripts?

clinton-hall added a commit that referenced this issue Feb 4, 2020
@clinton-hall
Copy link
Owner

SABnzbd should extract.... nzbToMedia can also try to catch anything missed (or do extraction for Torrents etc).

I have added gunzip support in gz-patch-1 if you want to switch to that branch to test...

@rnd256
Copy link
Author

rnd256 commented Feb 5, 2020

Thanks for responding so quickly!

I tried your patch, but gunzip complains about the -p- option, so I think password functionality should be disabled/skipped when using it (error message: gzip: invalid option -- 'p').

Even after removing the -p- option, the extraction was still failing:

[22:43:55] [INFO]::MAIN: Extracting [u'gunzip'] /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__
[22:43:55] [ERROR]::MAIN: EXTRACTOR: Extraction failed for /downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz. Could not call command [u'ionice', u'-c0', u'-n0', u'gunzip', u'/downloads/sabnzbd/incomplete/<REDACTED>/__ADMIN__/<REDACTED>.nzb.gz']

I'm feeling like the root cause of my issue might be that SABnzbd is supposed to be doing the extraction of the *.nzb.gz file before processing it, then use the extracted *.nzb file to perform the rest of the download. nzbToMedia isn't designed to process actual *.nzb files, is it?

@rnd256
Copy link
Author

rnd256 commented Feb 5, 2020

I think the extraction issue with sabnzbd was the fact that there were pieces of the file missing, but sabnzbd wasn't handling it properly. I've switched to nzbget, and it's working correctly now. However, I'll leave this issue open, because I think nzbToMedia could still benefit from supporting .gz files.

clinton-hall added a commit that referenced this issue Feb 6, 2020
@clinton-hall clinton-hall mentioned this issue Sep 23, 2020
4 tasks
@clinton-hall
Copy link
Owner

Trying to merge this in as it shouldn't hurt anything, and want to cleanup the stale branch...

clinton-hall added a commit that referenced this issue Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants