mirror of
https://github.com/evilhero/mylar
synced 2024-12-26 01:26:50 +00:00
FIX:(#898) When attempting to parse torrent name to generate filename to send to client, would error out if the title of the torrent contained any special characters.
This commit is contained in:
parent
7acf1d8b84
commit
f19783ed56
1 changed files with 6 additions and 4 deletions
|
@ -1616,11 +1616,13 @@ def nzbname_create(provider, title=None, info=None):
|
||||||
logger.fdebug("nzb name to be used for post-processing is : " + str(nzbname))
|
logger.fdebug("nzb name to be used for post-processing is : " + str(nzbname))
|
||||||
|
|
||||||
elif provider == 'CBT' or provider == 'KAT':
|
elif provider == 'CBT' or provider == 'KAT':
|
||||||
|
#filesafe the name cause people are idiots when they post sometimes.
|
||||||
|
nzbname = re.sub('\s{2,}',' ', helpers.filesafe(title)).strip()
|
||||||
#let's change all space to decimals for simplicity
|
#let's change all space to decimals for simplicity
|
||||||
nzbname = re.sub(" ", ".", title)
|
nzbname = re.sub(" ", ".", nzbname)
|
||||||
#gotta replace & or escape it
|
#gotta replace & or escape it
|
||||||
nzbname = re.sub("\&", 'and', str(nzbname))
|
nzbname = re.sub("\&", 'and', nzbname)
|
||||||
nzbname = re.sub('[\,\:\?]', '', str(nzbname))
|
nzbname = re.sub('[\,\:\?]', '', nzbname)
|
||||||
if nzbname.lower().endswith('.torrent'):
|
if nzbname.lower().endswith('.torrent'):
|
||||||
nzbname = re.sub('.torrent', '', nzbname)
|
nzbname = re.sub('.torrent', '', nzbname)
|
||||||
|
|
||||||
|
@ -1641,7 +1643,7 @@ def nzbname_create(provider, title=None, info=None):
|
||||||
nzbname = re.sub('.cbr', '', nzbname).strip()
|
nzbname = re.sub('.cbr', '', nzbname).strip()
|
||||||
nzbname = re.sub('.cbz', '', nzbname).strip()
|
nzbname = re.sub('.cbz', '', nzbname).strip()
|
||||||
|
|
||||||
logger.fdebug("nzbname used for post-processing:" + str(nzbname))
|
logger.fdebug("nzbname used for post-processing:" + nzbname)
|
||||||
return nzbname
|
return nzbname
|
||||||
|
|
||||||
def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, directsend=None):
|
def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, directsend=None):
|
||||||
|
|
Loading…
Reference in a new issue