IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
#!/usr/bin/python
# This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mylar. If not, see <http://www.gnu.org/licenses/>.
import urllib
import requests
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
import ntpath
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
import os
import sys
import re
import time
import logger
import mylar
class SABnzbd ( object ) :
def __init__ ( self , params ) :
#self.sab_url = sab_host + '/api'
#self.sab_apikey = 'e90f54f4f757447a20a4fa89089a83ed'
self . sab_url = mylar . CONFIG . SAB_HOST + ' /api '
self . params = params
def sender ( self ) :
try :
from requests . packages . urllib3 import disable_warnings
disable_warnings ( )
except :
logger . info ( ' Unable to disable https warnings. Expect some spam if using https nzb providers. ' )
try :
logger . info ( ' parameters set to %s ' % self . params )
logger . info ( ' sending now to %s ' % self . sab_url )
sendit = requests . post ( self . sab_url , data = self . params , verify = False )
except :
logger . info ( ' Failed to send to client. ' )
return { ' status ' : False }
else :
sendresponse = sendit . json ( )
logger . info ( sendresponse )
if sendresponse [ ' status ' ] is True :
queue_params = { ' status ' : True ,
' nzo_id ' : ' ' . join ( sendresponse [ ' nzo_ids ' ] ) ,
' queue ' : { ' mode ' : ' queue ' ,
' search ' : ' ' . join ( sendresponse [ ' nzo_ids ' ] ) ,
' output ' : ' json ' ,
' apikey ' : mylar . CONFIG . SAB_APIKEY } }
else :
queue_params = { ' status ' : False }
return queue_params
def processor ( self ) :
sendresponse = self . params [ ' nzo_id ' ]
try :
logger . info ( ' sending now to %s ' % self . sab_url )
logger . info ( ' parameters set to %s ' % self . params )
time . sleep ( 5 ) #pause 5 seconds before monitoring just so it hits the queue
h = requests . get ( self . sab_url , params = self . params [ ' queue ' ] , verify = False )
except Exception as e :
logger . info ( ' uh-oh: %s ' % e )
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
return self . historycheck ( self . params )
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
else :
queueresponse = h . json ( )
logger . info ( ' successfully queried the queue for status ' )
try :
queueinfo = queueresponse [ ' queue ' ]
FIX: (#2006)(#1986) Auto-Want series were not being auto-added, and even after manually added would result in count error after sucessful post-processing, FIX: When filechecking, if a 'special' was included as part of the annuals of a given series, it would not be detected, IMP: (#1982) When ComicRN & Completed Download Handling (CDH) are both enabled, will now check to see if ComicRN is active for the given category in the respective client. If it is, CDH will not post-process and issue a warning and let ComicRN handle the post-processing, FIX: Fixed a utf-8 encoding error when 'Run script AFTER snatch' was enabled, FIX: (#2004) Possible fix for 500 error on Wanted tab, when series had an annual/special attached but was located in the incorrect table, FIX: Removed some logging lines when CDH is monitoring downloads
2018-06-30 18:35:52 +00:00
#logger.fdebug('queue: %s' % queueinfo)
logger . fdebug ( ' Queue status : %s ' % queueinfo [ ' status ' ] )
logger . fdebug ( ' Queue mbleft : %s ' % queueinfo [ ' mbleft ' ] )
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
while any ( [ str ( queueinfo [ ' status ' ] ) == ' Downloading ' , str ( queueinfo [ ' status ' ] ) == ' Idle ' ] ) and float ( queueinfo [ ' mbleft ' ] ) > 0 :
FIX: (#2006)(#1986) Auto-Want series were not being auto-added, and even after manually added would result in count error after sucessful post-processing, FIX: When filechecking, if a 'special' was included as part of the annuals of a given series, it would not be detected, IMP: (#1982) When ComicRN & Completed Download Handling (CDH) are both enabled, will now check to see if ComicRN is active for the given category in the respective client. If it is, CDH will not post-process and issue a warning and let ComicRN handle the post-processing, FIX: Fixed a utf-8 encoding error when 'Run script AFTER snatch' was enabled, FIX: (#2004) Possible fix for 500 error on Wanted tab, when series had an annual/special attached but was located in the incorrect table, FIX: Removed some logging lines when CDH is monitoring downloads
2018-06-30 18:35:52 +00:00
#if 'comicrn' in queueinfo['script'].lower():
# logger.warn('ComicRN has been detected as being active for this category & download. Completed Download Handling will NOT be performed due to this.')
# logger.warn('Either disable Completed Download Handling for SABnzbd within Mylar, or remove ComicRN from your category script in SABnzbd.')
# return {'status': 'double-pp', 'failed': False}
#logger.fdebug('queue_params: %s' % self.params['queue'])
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
queue_resp = requests . get ( self . sab_url , params = self . params [ ' queue ' ] , verify = False )
queueresp = queue_resp . json ( )
queueinfo = queueresp [ ' queue ' ]
FIX: (#2006)(#1986) Auto-Want series were not being auto-added, and even after manually added would result in count error after sucessful post-processing, FIX: When filechecking, if a 'special' was included as part of the annuals of a given series, it would not be detected, IMP: (#1982) When ComicRN & Completed Download Handling (CDH) are both enabled, will now check to see if ComicRN is active for the given category in the respective client. If it is, CDH will not post-process and issue a warning and let ComicRN handle the post-processing, FIX: Fixed a utf-8 encoding error when 'Run script AFTER snatch' was enabled, FIX: (#2004) Possible fix for 500 error on Wanted tab, when series had an annual/special attached but was located in the incorrect table, FIX: Removed some logging lines when CDH is monitoring downloads
2018-06-30 18:35:52 +00:00
logger . fdebug ( ' status: %s ' % queueinfo [ ' status ' ] )
logger . fdebug ( ' mbleft: %s ' % queueinfo [ ' mbleft ' ] )
logger . fdebug ( ' timeleft: %s ' % queueinfo [ ' timeleft ' ] )
logger . fdebug ( ' eta: %s ' % queueinfo [ ' eta ' ] )
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
time . sleep ( 5 )
except Exception as e :
logger . warn ( ' error: %s ' % e )
logger . info ( ' File has now downloaded! ' )
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
return self . historycheck ( self . params )
2018-05-24 15:36:37 +00:00
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
def historycheck ( self , nzbinfo ) :
sendresponse = nzbinfo [ ' nzo_id ' ]
2018-05-24 16:23:32 +00:00
hist_params = { ' mode ' : ' history ' ,
' category ' : mylar . CONFIG . SAB_CATEGORY ,
' failed ' : 0 ,
' output ' : ' json ' ,
' apikey ' : mylar . CONFIG . SAB_APIKEY }
hist = requests . get ( self . sab_url , params = hist_params , verify = False )
historyresponse = hist . json ( )
#logger.info(historyresponse)
histqueue = historyresponse [ ' history ' ]
found = { ' status ' : False }
while found [ ' status ' ] is False :
try :
for hq in histqueue [ ' slots ' ] :
#logger.info('nzo_id: %s --- %s [%s]' % (hq['nzo_id'], sendresponse, hq['status']))
FIX: (#2006)(#1986) Auto-Want series were not being auto-added, and even after manually added would result in count error after sucessful post-processing, FIX: When filechecking, if a 'special' was included as part of the annuals of a given series, it would not be detected, IMP: (#1982) When ComicRN & Completed Download Handling (CDH) are both enabled, will now check to see if ComicRN is active for the given category in the respective client. If it is, CDH will not post-process and issue a warning and let ComicRN handle the post-processing, FIX: Fixed a utf-8 encoding error when 'Run script AFTER snatch' was enabled, FIX: (#2004) Possible fix for 500 error on Wanted tab, when series had an annual/special attached but was located in the incorrect table, FIX: Removed some logging lines when CDH is monitoring downloads
2018-06-30 18:35:52 +00:00
if hq [ ' nzo_id ' ] == sendresponse and any ( [ hq [ ' status ' ] == ' Completed ' , hq [ ' status ' ] == ' Running ' , ' comicrn ' in hq [ ' script ' ] . lower ( ) ] ) :
2018-05-24 16:23:32 +00:00
logger . info ( ' found matching completed item in history. Job has a status of %s ' % hq [ ' status ' ] )
FIX: (#2006)(#1986) Auto-Want series were not being auto-added, and even after manually added would result in count error after sucessful post-processing, FIX: When filechecking, if a 'special' was included as part of the annuals of a given series, it would not be detected, IMP: (#1982) When ComicRN & Completed Download Handling (CDH) are both enabled, will now check to see if ComicRN is active for the given category in the respective client. If it is, CDH will not post-process and issue a warning and let ComicRN handle the post-processing, FIX: Fixed a utf-8 encoding error when 'Run script AFTER snatch' was enabled, FIX: (#2004) Possible fix for 500 error on Wanted tab, when series had an annual/special attached but was located in the incorrect table, FIX: Removed some logging lines when CDH is monitoring downloads
2018-06-30 18:35:52 +00:00
if ' comicrn ' in hq [ ' script ' ] . lower ( ) :
logger . warn ( ' ComicRN has been detected as being active for this category & download. Completed Download Handling will NOT be performed due to this. ' )
logger . warn ( ' Either disable Completed Download Handling for SABnzbd within Mylar, or remove ComicRN from your category script in SABnzbd. ' )
return { ' status ' : ' double-pp ' , ' failed ' : False }
2018-05-24 16:23:32 +00:00
if os . path . isfile ( hq [ ' storage ' ] ) :
logger . info ( ' location found @ %s ' % hq [ ' storage ' ] )
found = { ' status ' : True ,
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
' name ' : ntpath . basename ( hq [ ' storage ' ] ) , #os.pathre.sub('.nzb', '', hq['nzb_name']).strip(),
2018-05-24 16:23:32 +00:00
' location ' : os . path . abspath ( os . path . join ( hq [ ' storage ' ] , os . pardir ) ) ,
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
' failed ' : False ,
' issueid ' : nzbinfo [ ' issueid ' ] ,
' comicid ' : nzbinfo [ ' comicid ' ] ,
2019-01-16 22:09:51 +00:00
' apicall ' : True ,
' ddl ' : False }
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
break
2018-05-24 16:23:32 +00:00
else :
logger . info ( ' no file found where it should be @ %s - is there another script that moves things after completion ? ' % hq [ ' storage ' ] )
2019-02-21 18:56:21 +00:00
return { ' status ' : ' file not found ' , ' failed ' : False }
2018-05-24 16:23:32 +00:00
elif hq [ ' nzo_id ' ] == sendresponse and hq [ ' status ' ] == ' Failed ' :
#get the stage / error message and see what we can do
stage = hq [ ' stage_log ' ]
for x in stage [ 0 ] :
if ' Failed ' in x [ ' actions ' ] and any ( [ x [ ' name ' ] == ' Unpack ' , x [ ' name ' ] == ' Repair ' ] ) :
if ' moving ' in x [ ' actions ' ] :
logger . warn ( ' There was a failure in SABnzbd during the unpack/repair phase that caused a failure: %s ' % x [ ' actions ' ] )
else :
logger . warn ( ' Failure occured during the Unpack/Repair phase of SABnzbd. This is probably a bad file: %s ' % x [ ' actions ' ] )
if mylar . FAILED_DOWNLOAD_HANDLING is True :
found = { ' status ' : True ,
' name ' : re . sub ( ' .nzb ' , ' ' , hq [ ' nzb_name ' ] ) . strip ( ) ,
' location ' : os . path . abspath ( os . path . join ( hq [ ' storage ' ] , os . pardir ) ) ,
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
' failed ' : True ,
' issueid ' : sendresponse [ ' issueid ' ] ,
' comicid ' : sendresponse [ ' comicid ' ] ,
2019-01-16 22:09:51 +00:00
' apicall ' : True ,
' ddl ' : False }
2018-05-24 16:23:32 +00:00
break
break
FIX: (#2006)(#1986) Auto-Want series were not being auto-added, and even after manually added would result in count error after sucessful post-processing, FIX: When filechecking, if a 'special' was included as part of the annuals of a given series, it would not be detected, IMP: (#1982) When ComicRN & Completed Download Handling (CDH) are both enabled, will now check to see if ComicRN is active for the given category in the respective client. If it is, CDH will not post-process and issue a warning and let ComicRN handle the post-processing, FIX: Fixed a utf-8 encoding error when 'Run script AFTER snatch' was enabled, FIX: (#2004) Possible fix for 500 error on Wanted tab, when series had an annual/special attached but was located in the incorrect table, FIX: Removed some logging lines when CDH is monitoring downloads
2018-06-30 18:35:52 +00:00
2018-05-24 16:23:32 +00:00
except Exception as e :
logger . warn ( ' error %s ' % e )
2019-02-21 18:56:21 +00:00
return { ' status ' : False , ' failed ' : False }
IMP: Changed configuration completely. New config processing, global/config variables changed over entire application. All changes in the configuration GUI take effect immediately after saving - no more need to restart Mylar, IMP: Added provider order sequence header to the top of the Providers tab for improved visibilty, IMP: Added completed download handling for both SABnzbd and NZBGet - will monitor active queue for downloads sent by Mylar and then post-process them accordingly (no more ComicRN), FIX: When recreating a pullist for a week that's not the current week, will now refresh series that are still missing data in case of late population, IMP: Removed loose/explict search options, and search results will now match more accurately to the terms entered, as well as being much quicker, IMP: Changed colour-codes on search results screen, green now indicates that the series is a print series, non-green indicates that it is either a HC/TPB/digital series and will also be indicated as such, IMP: Fixed weeklypull not refreshing some series due to legacy numbering on series deemed as Ended by Mylar, or the pull not refreshing propeprly and thereby were not elgible to be considered as a valid series for matching, IMP: Fixed problem with the scheduler of the weekly pull not running at the designated time, which causes problems when attempting to match series to the pullist for issues, IMP: Changed the autosnatch script so that the get.conf is no longer required to be maintained seperately. The get.conf config items are now located in the main config.ini and have to be repopulated initially, FIX: Fixed problem with the import count not resetting to 0 on subsequent runs of the Import A Directory option, IMP: Changed the sab api key from using the nzbkey to the full api key as is required for completed download handling, FIX: Fixed the retry option for newznab entries so that it should work across the board now for newznabs as opposed to only some providers, IMP: some minor code cleanup
2017-11-10 19:25:14 +00:00
return found