mirror of
https://github.com/evilhero/mylar
synced 2025-02-02 12:31:44 +00:00
FIX: Blackhole post-processing fixed to allow for variations in SAB spaces/dots - was failing (#163)
This commit is contained in:
parent
36840d3612
commit
ba1b3c9021
1 changed files with 19 additions and 13 deletions
|
@ -601,11 +601,10 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
if os.path.exists(mylar.BLACKHOLE_DIR):
|
||||
#pretty this biatch up.
|
||||
Bl_ComicName = re.sub('[/:/,\/]', '', str(ComicName))
|
||||
filenamenzb = str(Bl_ComicName) + " " + str(IssueNumber) + " (" + str(comyear) + ").nzb"
|
||||
filenamenzb = str(re.sub(" ", ".", str(Bl_ComicName))) + "." + str(IssueNumber) + ".(" + str(comyear) + ").nzb"
|
||||
urllib.urlretrieve(linkapi, str(mylar.BLACKHOLE_DIR) + str(filenamenzb))
|
||||
logger.fdebug("filename saved to your blackhole as : " + str(filenamenzb))
|
||||
logger.info(u"Successfully sent .nzb to your Blackhole directory : " + str(mylar.BLACKHOLE_DIR) + str(filenamenzb) )
|
||||
nzbname = str(Bl_ComicName) + " " + str(IssueNumber) + " (" + str(comyear) + ")"
|
||||
#end blackhole
|
||||
|
||||
else:
|
||||
|
@ -626,17 +625,6 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
|
||||
logger.fdebug("link to retrieve via api:" + str(linkapi))
|
||||
|
||||
#let's change all space to decimals for simplicity
|
||||
nzbname = re.sub(" ", ".", str(entry['title']))
|
||||
nzbname = re.sub('[\,\:]', '', str(nzbname))
|
||||
extensions = ('.cbr', '.cbz')
|
||||
|
||||
if nzbname.lower().endswith(extensions):
|
||||
fd, ext = os.path.splitext(nzbname)
|
||||
logger.fdebug("Removed extension from nzb: " + ext)
|
||||
nzbname = re.sub(str(ext), '', str(nzbname))
|
||||
|
||||
logger.fdebug("nzbname used for post-processing:" + str(nzbname))
|
||||
|
||||
#we need to change the nzbx string now to allow for the nzbname rename.
|
||||
if nzbprov == 'nzbx':
|
||||
|
@ -682,6 +670,24 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
|||
# os.remove(savefile)
|
||||
# logger.info(u"Removed temporary save file")
|
||||
#raise an exception to break out of loop
|
||||
|
||||
#let's change all space to decimals for simplicity
|
||||
if mylar.BLACKHOLE:
|
||||
bhole_cname = re.sub('[/:/,\/]', '', str(ComicName))
|
||||
nzbname = str(re.sub(" ", ".", str(bhole_cname))) + "." + str(IssueNumber) + ".(" + str(comyear) + ")"
|
||||
else:
|
||||
nzbname = re.sub(" ", ".", str(entry['title']))
|
||||
nzbname = re.sub('[\,\:]', '', str(nzbname))
|
||||
extensions = ('.cbr', '.cbz')
|
||||
|
||||
if nzbname.lower().endswith(extensions):
|
||||
fd, ext = os.path.splitext(nzbname)
|
||||
logger.fdebug("Removed extension from nzb: " + ext)
|
||||
nzbname = re.sub(str(ext), '', str(nzbname))
|
||||
|
||||
|
||||
logger.fdebug("nzbname used for post-processing:" + str(nzbname))
|
||||
|
||||
foundc = "yes"
|
||||
done = True
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue