mirror of https://github.com/evilhero/mylar
FIX:(#599) 'Newer version available, you're 0 commits behind' error, FIX:(#572) On Windows systems, when metatagging enabled would not delete temporary files (Thanks uspider7), IMP: Removed redudant looping code from cmtagmylar module, FIX: Annuals now will display correctly without destroying table layout after changing any issue status on screen, IMP: Added .NOW to issue scanner checks, FIX: When selecting one-off from Weekly Pull-list and not on watchlist, would error out as no year provided
This commit is contained in:
parent
c93386586a
commit
b27584af81
|
@ -419,7 +419,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<table id="annual_table" class="display">
|
<table class="display_no_select" id="annual_table">
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="ui-widget">
|
<!-- <div class="ui-widget">
|
||||||
|
|
|
@ -94,26 +94,38 @@ def run (dirName, nzbName=None, issueid=None, manual=None, filename=None):
|
||||||
shutil.rmtree( comicpath )
|
shutil.rmtree( comicpath )
|
||||||
os.makedirs( comicpath )
|
os.makedirs( comicpath )
|
||||||
|
|
||||||
# make a list of all CBR and CBZ files in downloadpath
|
|
||||||
if filename is None:
|
if filename is None:
|
||||||
filename_list = glob.glob( os.path.join( downloadpath, "*.cbz" ) )
|
filename_list = glob.glob( os.path.join( downloadpath, "*.cbz" ) )
|
||||||
filename_list.extend( glob.glob( os.path.join( downloadpath, "*.cbr" ) ) )
|
filename_list.extend( glob.glob( os.path.join( downloadpath, "*.cbr" ) ) )
|
||||||
|
fcount = 1
|
||||||
## Takes all .cbr and .cbz files and dumps them to processing directory ##
|
|
||||||
for f in filename_list:
|
for f in filename_list:
|
||||||
shutil.move( f, comicpath)
|
if fcount > 1:
|
||||||
|
logger.fdebug('More than one cbr/cbz within path, performing Post-Process on first file detected: ' + f)
|
||||||
|
break
|
||||||
|
shutil.move( f, comicpath )
|
||||||
|
filename = f #just the filename itself
|
||||||
|
fcount+=1
|
||||||
|
else:
|
||||||
|
shutil.move( filename, comicpath )
|
||||||
|
|
||||||
## Changes filetype extensions when needed ##
|
filename = os.path.split(filename)[1] # just the filename itself
|
||||||
cbr_list = glob.glob( os.path.join( comicpath, "*.cbr" ) )
|
#print comicpath
|
||||||
for f in cbr_list:
|
#print os.path.join( comicpath, filename )
|
||||||
if zipfile.is_zipfile( f ):
|
if filename.endswith('.cbr'):
|
||||||
base = os.path.splitext( f )[0]
|
f = os.path.join( comicpath, filename )
|
||||||
shutil.move( f, base + ".cbz" )
|
if zipfile.is_zipfile( f ):
|
||||||
logger.fdebug('{0}: renaming {1} to be a cbz'.format( scriptname, os.path.basename( f ) ))
|
#print "zipfile detected"
|
||||||
|
base = os.path.splitext( f )[0]
|
||||||
|
#print base
|
||||||
|
#print f
|
||||||
|
shutil.move( f, base + ".cbz" )
|
||||||
|
logger.fdebug('{0}: renaming {1} to be a cbz'.format( scriptname, os.path.basename( f ) ))
|
||||||
|
|
||||||
if file_extension_fixing:
|
if file_extension_fixing:
|
||||||
cbz_list = glob.glob( os.path.join( comicpath, "*.cbz" ) )
|
if filename.endswith('.cbz'):
|
||||||
for f in cbz_list:
|
f = os.path.join( comicpath, filename )
|
||||||
|
|
||||||
|
if os.path.isfile( f ):
|
||||||
try:
|
try:
|
||||||
rar_test_cmd_output = "is not RAR archive" #default, in case of error
|
rar_test_cmd_output = "is not RAR archive" #default, in case of error
|
||||||
rar_test_cmd_output = subprocess.check_output( [ unrar_cmd, "t", f ] )
|
rar_test_cmd_output = subprocess.check_output( [ unrar_cmd, "t", f ] )
|
||||||
|
@ -123,190 +135,102 @@ def run (dirName, nzbName=None, issueid=None, manual=None, filename=None):
|
||||||
base = os.path.splitext( f )[0]
|
base = os.path.splitext( f )[0]
|
||||||
shutil.move( f, base + ".cbr" )
|
shutil.move( f, base + ".cbr" )
|
||||||
logger.fdebug('{0}: renaming {1} to be a cbr'.format( scriptname, os.path.basename( f ) ))
|
logger.fdebug('{0}: renaming {1} to be a cbr'.format( scriptname, os.path.basename( f ) ))
|
||||||
|
|
||||||
# Now rename all CBR files to RAR
|
# Now rename all CBR files to RAR
|
||||||
cbr_list = glob.glob( os.path.join( comicpath, "*.cbr" ) )
|
if filename.endswith('.cbr'):
|
||||||
for f in cbr_list:
|
f = os.path.join( comicpath, filename)
|
||||||
base = os.path.splitext( f )[0]
|
base = os.path.splitext( f )[0]
|
||||||
shutil.move( f, base + ".rar" )
|
baserar = base + ".rar"
|
||||||
|
shutil.move( f, baserar )
|
||||||
|
|
||||||
## Changes any cbr files to cbz files for insertion of metadata ##
|
## Changes any cbr files to cbz files for insertion of metadata ##
|
||||||
if file_conversion:
|
if file_conversion:
|
||||||
rar_list = glob.glob( os.path.join( comicpath, "*.rar" ) )
|
|
||||||
for f in rar_list:
|
|
||||||
logger.fdebug('{0}: converting {1} to be zip format'.format( scriptname, os.path.basename( f ) ))
|
|
||||||
basename = os.path.splitext( f )[0]
|
|
||||||
zipname = basename + ".cbz"
|
|
||||||
|
|
||||||
# Move into the folder where we will be unrar-ing things
|
|
||||||
os.makedirs( unrar_folder )
|
|
||||||
os.chdir( unrar_folder )
|
|
||||||
|
|
||||||
# Extract and zip up
|
|
||||||
try:
|
|
||||||
output = check_output( [ unrar_cmd, "x", f ] )
|
|
||||||
#subprocess.Popen( [ unrar_cmd, "x", f ] ).communicate()
|
|
||||||
except CalledProcessError as e:
|
|
||||||
if e.returncode == 3:
|
|
||||||
logger.fdebug('[Unrar Error 3] - Broken Archive.')
|
|
||||||
elif e.returncode == 1:
|
|
||||||
logger.fdebug('[Unrar Error 1] - No files to extract.')
|
|
||||||
logger.fdebug('Marking this as an incomplete download.')
|
|
||||||
return "unrar error"
|
|
||||||
|
|
||||||
shutil.make_archive( basename, "zip", unrar_folder )
|
|
||||||
|
|
||||||
# get out of unrar folder and clean up
|
|
||||||
os.chdir( comicpath )
|
|
||||||
shutil.rmtree( unrar_folder )
|
|
||||||
|
|
||||||
## Changes zip to cbz
|
|
||||||
zip_list = glob.glob( os.path.join( comicpath, "*.zip" ) )
|
|
||||||
for f in zip_list:
|
|
||||||
base = os.path.splitext( f )[0]
|
|
||||||
shutil.move( f, base + ".cbz" )
|
|
||||||
|
|
||||||
## Tag each CBZ, and move it back to original directory ##
|
|
||||||
cbz_list = glob.glob( os.path.join( comicpath, "*.cbz" ) )
|
|
||||||
for f in cbz_list:
|
|
||||||
if issueid is None:
|
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cr", "-f", "-o", "--verbose", "--nooverwrite", f ] ).communicate()
|
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cbl", "-f", "-o", "--verbose", "--nooverwrite", f ] ).communicate()
|
|
||||||
else:
|
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cr", "-o", "--id", issueid, "--verbose", "--nooverwrite", f ] ).communicate()
|
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cbl", "-o", "--id", issueid, "--verbose", "--nooverwrite", f ] ).communicate()
|
|
||||||
shutil.move( f, downloadpath )
|
|
||||||
return
|
|
||||||
|
|
||||||
else:
|
|
||||||
shutil.move( filename, comicpath)
|
|
||||||
|
|
||||||
filename = os.path.split(filename)[1] # just the filename itself
|
|
||||||
print comicpath
|
|
||||||
print os.path.join( comicpath, filename )
|
|
||||||
if filename.endswith('.cbr'):
|
|
||||||
f = os.path.join( comicpath, filename )
|
f = os.path.join( comicpath, filename )
|
||||||
if zipfile.is_zipfile( f ):
|
logger.fdebug('{0}: converting {1} to be zip format'.format( scriptname, os.path.basename( f ) ))
|
||||||
print "zipfile detected"
|
basename = os.path.splitext( f )[0]
|
||||||
base = os.path.splitext( f )[0]
|
zipname = basename + ".cbz"
|
||||||
print base
|
|
||||||
print f
|
|
||||||
shutil.move( f, base + ".cbz" )
|
|
||||||
logger.fdebug('{0}: renaming {1} to be a cbz'.format( scriptname, os.path.basename( f ) ))
|
|
||||||
|
|
||||||
if file_extension_fixing:
|
# Move into the folder where we will be unrar-ing things
|
||||||
if filename.endswith('.cbz'):
|
os.makedirs( unrar_folder )
|
||||||
f = os.path.join( comicpath, filename )
|
os.chdir( unrar_folder )
|
||||||
|
|
||||||
if os.path.isfile( f ):
|
# Extract and zip up
|
||||||
try:
|
logger.fdebug('{0}: Comicpath is ' + baserar) #os.path.join(comicpath,basename))
|
||||||
rar_test_cmd_output = "is not RAR archive" #default, in case of error
|
logger.fdebug('{0}: Unrar is ' + unrar_folder )
|
||||||
rar_test_cmd_output = subprocess.check_output( [ unrar_cmd, "t", f ] )
|
try:
|
||||||
except:
|
#subprocess.Popen( [ unrar_cmd, "x", os.path.join(comicpath,basename) ] ).communicate()
|
||||||
pass
|
output = check_output( [ unrar_cmd, "x", baserar ] ) #os.path.join(comicpath,basename) ] )
|
||||||
if not "is not RAR archive" in rar_test_cmd_output:
|
except CalledProcessError as e:
|
||||||
base = os.path.splitext( f )[0]
|
if e.returncode == 3:
|
||||||
shutil.move( f, base + ".cbr" )
|
logger.fdebug('[Unrar Error 3] - Broken Archive.')
|
||||||
logger.fdebug('{0}: renaming {1} to be a cbr'.format( scriptname, os.path.basename( f ) ))
|
elif e.returncode == 1:
|
||||||
|
logger.fdebug('[Unrar Error 1] - No files to extract.')
|
||||||
|
logger.fdebug('Marking this as an incomplete download.')
|
||||||
|
return "unrar error"
|
||||||
|
|
||||||
# Now rename all CBR files to RAR
|
shutil.make_archive( basename, "zip", unrar_folder )
|
||||||
if filename.endswith('.cbr'):
|
|
||||||
f = os.path.join( comicpath, filename)
|
|
||||||
base = os.path.splitext( f )[0]
|
|
||||||
baserar = base + ".rar"
|
|
||||||
shutil.move( f, baserar )
|
|
||||||
|
|
||||||
## Changes any cbr files to cbz files for insertion of metadata ##
|
# get out of unrar folder and clean up
|
||||||
if file_conversion:
|
os.chdir( comicpath )
|
||||||
f = os.path.join( comicpath, filename )
|
shutil.rmtree( unrar_folder )
|
||||||
logger.fdebug('{0}: converting {1} to be zip format'.format( scriptname, os.path.basename( f ) ))
|
|
||||||
basename = os.path.splitext( f )[0]
|
|
||||||
zipname = basename + ".cbz"
|
|
||||||
|
|
||||||
# Move into the folder where we will be unrar-ing things
|
## Changes zip to cbz
|
||||||
os.makedirs( unrar_folder )
|
|
||||||
os.chdir( unrar_folder )
|
|
||||||
|
|
||||||
# Extract and zip up
|
|
||||||
logger.fdebug('{0}: Comicpath is ' + baserar) #os.path.join(comicpath,basename))
|
|
||||||
logger.fdebug('{0}: Unrar is ' + unrar_folder )
|
|
||||||
try:
|
|
||||||
#subprocess.Popen( [ unrar_cmd, "x", os.path.join(comicpath,basename) ] ).communicate()
|
|
||||||
output = check_output( [ unrar_cmd, "x", baserar ] ) #os.path.join(comicpath,basename) ] )
|
|
||||||
except CalledProcessError as e:
|
|
||||||
if e.returncode == 3:
|
|
||||||
logger.fdebug('[Unrar Error 3] - Broken Archive.')
|
|
||||||
elif e.returncode == 1:
|
|
||||||
logger.fdebug('[Unrar Error 1] - No files to extract.')
|
|
||||||
logger.fdebug('Marking this as an incomplete download.')
|
|
||||||
return "unrar error"
|
|
||||||
|
|
||||||
shutil.make_archive( basename, "zip", unrar_folder )
|
|
||||||
|
|
||||||
# get out of unrar folder and clean up
|
|
||||||
os.chdir( comicpath )
|
|
||||||
shutil.rmtree( unrar_folder )
|
|
||||||
|
|
||||||
## Changes zip to cbz
|
|
||||||
|
|
||||||
f = os.path.join( comicpath, os.path.splitext(filename)[0] + ".zip" )
|
f = os.path.join( comicpath, os.path.splitext(filename)[0] + ".zip" )
|
||||||
print "zipfile" + f
|
#print "zipfile" + f
|
||||||
try:
|
try:
|
||||||
with open(f): pass
|
with open(f): pass
|
||||||
except:
|
except:
|
||||||
logger.fdebug('No zip file present')
|
logger.fdebug('No zip file present')
|
||||||
return "fail"
|
return "fail"
|
||||||
base = os.path.splitext( f )[0]
|
base = os.path.splitext( f )[0]
|
||||||
shutil.move( f, base + ".cbz" )
|
shutil.move( f, base + ".cbz" )
|
||||||
nfilename = base + ".cbz"
|
nfilename = base + ".cbz"
|
||||||
else:
|
else:
|
||||||
logger.fdebug('filename:' + filename)
|
logger.fdebug('filename:' + filename)
|
||||||
nfilename = filename
|
nfilename = filename
|
||||||
|
|
||||||
if os.path.isfile( nfilename ):
|
if os.path.isfile( nfilename ):
|
||||||
logger.fdebug('file exists in given location already.')
|
logger.fdebug('file exists in given location already.')
|
||||||
file_dir, file_n = os.path.split(nfilename)
|
file_dir, file_n = os.path.split(nfilename)
|
||||||
else:
|
else:
|
||||||
#remove the IssueID from the path
|
#remove the IssueID from the path
|
||||||
file_dir = re.sub(issueid, '', comicpath)
|
file_dir = re.sub(issueid, '', comicpath)
|
||||||
file_n = os.path.split(nfilename)[1]
|
file_n = os.path.split(nfilename)[1]
|
||||||
logger.fdebug('converted directory: ' + str(file_dir))
|
logger.fdebug('converted directory: ' + str(file_dir))
|
||||||
logger.fdebug('converted filename: ' + str(file_n))
|
logger.fdebug('converted filename: ' + str(file_n))
|
||||||
logger.fdebug('destination path: ' + os.path.join(dirName,file_n))
|
logger.fdebug('destination path: ' + os.path.join(dirName,file_n))
|
||||||
logger.fdebug('dirName: ' + dirName)
|
logger.fdebug('dirName: ' + dirName)
|
||||||
logger.fdebug('absDirName: ' + os.path.abspath(dirName))
|
logger.fdebug('absDirName: ' + os.path.abspath(dirName))
|
||||||
## Tag each CBZ, and move it back to original directory ##
|
## Tag each CBZ, and move it back to original directory ##
|
||||||
if issueid is None:
|
if issueid is None:
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cr", "-f", "-o", "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cr", "-f", "-o", "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cbl", "-f", "-o", "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cbl", "-f", "-o", "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
||||||
else:
|
else:
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cr", "-o", "--id", issueid, "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cr", "-o", "--id", issueid, "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
||||||
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cbl", "-o", "--id", issueid, "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
subprocess.Popen( [ comictagger_cmd, "-s", "-t", "cbl", "-o", "--id", issueid, "--verbose", "--nooverwrite", nfilename ] ).communicate()
|
||||||
|
|
||||||
if os.path.exists(os.path.join(os.path.abspath(dirName),file_n)):
|
if os.path.exists(os.path.join(os.path.abspath(dirName),file_n)):
|
||||||
logger.fdebug('Unable to move - file already exists.')
|
logger.fdebug('Unable to move - file already exists.')
|
||||||
else:
|
else:
|
||||||
shutil.move( os.path.join(comicpath, nfilename), os.path.join(os.path.abspath(dirName),file_n))
|
shutil.move( os.path.join(comicpath, nfilename), os.path.join(os.path.abspath(dirName),file_n))
|
||||||
#shutil.move( nfilename, os.path.join(os.path.abspath(dirName),file_n))
|
#shutil.move( nfilename, os.path.join(os.path.abspath(dirName),file_n))
|
||||||
logger.fdebug('Sucessfully moved file from temporary path.')
|
logger.fdebug('Sucessfully moved file from temporary path.')
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
while i < 10:
|
os.chdir( mylar.PROG_DIR )
|
||||||
try:
|
|
||||||
shutil.rmtree( comicpath )
|
|
||||||
except:
|
|
||||||
time.sleep(.1)
|
|
||||||
else:
|
|
||||||
return os.path.join(os.path.abspath(dirName), file_n)
|
|
||||||
i+=1
|
|
||||||
|
|
||||||
logger.fdebug('Failed to remove temporary path : ' + str(comicpath))
|
while i < 10:
|
||||||
|
try:
|
||||||
|
logger.fdebug('Attempting to remove: ' + comicpath)
|
||||||
|
shutil.rmtree( comicpath )
|
||||||
|
except:
|
||||||
|
time.sleep(.1)
|
||||||
|
else:
|
||||||
|
return os.path.join(os.path.abspath(dirName), file_n)
|
||||||
|
i+=1
|
||||||
|
|
||||||
return os.path.join(os.path.abspath(dirName),file_n)
|
logger.fdebug('Failed to remove temporary path : ' + str(comicpath))
|
||||||
|
|
||||||
## Clean up temp directory ##
|
return os.path.join(os.path.abspath(dirName),file_n)
|
||||||
|
|
||||||
#os.chdir( sabnzbdscriptpath )
|
|
||||||
#shutil.rmtree( comicpath )
|
|
||||||
|
|
||||||
## Will Run Mylar Post=processing In Future ##
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ def listFiles(dir,watchcomic,AlternateSearch=None,manual=None,sarc=None):
|
||||||
'\@']
|
'\@']
|
||||||
|
|
||||||
issue_exceptions = ['AU',
|
issue_exceptions = ['AU',
|
||||||
|
'.INH',
|
||||||
|
'.NOW',
|
||||||
'AI',
|
'AI',
|
||||||
'A',
|
'A',
|
||||||
'B',
|
'B',
|
||||||
|
@ -320,7 +322,7 @@ def listFiles(dir,watchcomic,AlternateSearch=None,manual=None,sarc=None):
|
||||||
# logger.fdebug("removed title from name - is now : " + str(justthedigits))
|
# logger.fdebug("removed title from name - is now : " + str(justthedigits))
|
||||||
|
|
||||||
justthedigits = justthedigits_1.split(' ', 1)[0]
|
justthedigits = justthedigits_1.split(' ', 1)[0]
|
||||||
|
|
||||||
digitsvalid = "false"
|
digitsvalid = "false"
|
||||||
|
|
||||||
for jdc in list(justthedigits):
|
for jdc in list(justthedigits):
|
||||||
|
@ -354,8 +356,14 @@ def listFiles(dir,watchcomic,AlternateSearch=None,manual=None,sarc=None):
|
||||||
logger.fdebug('DECIMAL ISSUE DETECTED [' + justthedigits + ']')
|
logger.fdebug('DECIMAL ISSUE DETECTED [' + justthedigits + ']')
|
||||||
else:
|
else:
|
||||||
for issexcept in issue_exceptions:
|
for issexcept in issue_exceptions:
|
||||||
|
decimalexcept = False
|
||||||
|
if '.' in issexcept:
|
||||||
|
decimalexcept = True
|
||||||
|
issexcept = issexcept[1:] #remove the '.' from comparison...
|
||||||
if issexcept.lower() in poss_alpha.lower() and len(poss_alpha) <= len(issexcept):
|
if issexcept.lower() in poss_alpha.lower() and len(poss_alpha) <= len(issexcept):
|
||||||
justthedigits += poss_alpha
|
if decimalexcept:
|
||||||
|
issexcept = '.' + issexcept
|
||||||
|
justthedigits += issexcept #poss_alpha
|
||||||
logger.fdebug('ALPHANUMERIC EXCEPTION. COMBINING : [' + justthedigits + ']')
|
logger.fdebug('ALPHANUMERIC EXCEPTION. COMBINING : [' + justthedigits + ']')
|
||||||
digitsvalid = "true"
|
digitsvalid = "true"
|
||||||
break
|
break
|
||||||
|
|
|
@ -638,6 +638,8 @@ def issuedigits(issnum):
|
||||||
int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i')
|
int_issnum = (int(issnum[:-2]) * 1000) + ord('a') + ord('i')
|
||||||
elif 'inh' in issnum.lower():
|
elif 'inh' in issnum.lower():
|
||||||
int_issnum = (int(issnum[:-4]) * 1000) + ord('i') + ord('n') + ord('h')
|
int_issnum = (int(issnum[:-4]) * 1000) + ord('i') + ord('n') + ord('h')
|
||||||
|
elif 'now' in issnum.lower():
|
||||||
|
int_issnum = (int(issnum[:-4]) * 1000) + ord('n') + ord('o') + ord('w')
|
||||||
elif u'\xbd' in issnum:
|
elif u'\xbd' in issnum:
|
||||||
issnum = .5
|
issnum = .5
|
||||||
int_issnum = int(issnum) * 1000
|
int_issnum = int(issnum) * 1000
|
||||||
|
@ -659,7 +661,7 @@ def issuedigits(issnum):
|
||||||
if len(decis) == 1:
|
if len(decis) == 1:
|
||||||
decisval = int(decis) * 10
|
decisval = int(decis) * 10
|
||||||
issaftdec = str(decisval)
|
issaftdec = str(decisval)
|
||||||
if len(decis) == 2:
|
if len(decis) >= 2:
|
||||||
decisval = int(decis)
|
decisval = int(decis)
|
||||||
issaftdec = str(decisval)
|
issaftdec = str(decisval)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -624,6 +624,8 @@ def addComictoDB(comicid,mismatch=None,pullupd=None,imported=None,ogcname=None,c
|
||||||
# print "ai:" + str(int_issnum)
|
# print "ai:" + str(int_issnum)
|
||||||
elif 'inh' in issnum.lower():
|
elif 'inh' in issnum.lower():
|
||||||
int_issnum = (int(issnum[:-4]) * 1000) + ord('i') + ord('n') + ord('h')
|
int_issnum = (int(issnum[:-4]) * 1000) + ord('i') + ord('n') + ord('h')
|
||||||
|
elif 'now' in issnum.lower():
|
||||||
|
int_issnum = (int(issnum[:-4]) * 1000) + ord('n') + ord('o') + ord('w')
|
||||||
elif u'\xbd' in issnum:
|
elif u'\xbd' in issnum:
|
||||||
issnum = .5
|
issnum = .5
|
||||||
int_issnum = int(issnum) * 1000
|
int_issnum = int(issnum) * 1000
|
||||||
|
@ -1209,9 +1211,7 @@ def GCDimport(gcomicid, pullupd=None,imported=None,ogcname=None):
|
||||||
def issue_collection(issuedata,nostatus):
|
def issue_collection(issuedata,nostatus):
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
|
|
||||||
logger.info('issue collection...')
|
|
||||||
if issuedata:
|
if issuedata:
|
||||||
#logger.info('issuedata exists')
|
|
||||||
for issue in issuedata:
|
for issue in issuedata:
|
||||||
|
|
||||||
|
|
||||||
|
@ -1226,7 +1226,6 @@ def issue_collection(issuedata,nostatus):
|
||||||
|
|
||||||
|
|
||||||
if nostatus == 'False':
|
if nostatus == 'False':
|
||||||
#logger.info('issue')
|
|
||||||
# check if the issue already exists
|
# check if the issue already exists
|
||||||
iss_exists = myDB.action('SELECT * from issues WHERE IssueID=?', [issue['IssueID']]).fetchone()
|
iss_exists = myDB.action('SELECT * from issues WHERE IssueID=?', [issue['IssueID']]).fetchone()
|
||||||
|
|
||||||
|
|
|
@ -1013,7 +1013,11 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
||||||
D_ComicVersion = ComVersChk
|
D_ComicVersion = ComVersChk
|
||||||
|
|
||||||
F_ComicVersion = re.sub("[^0-9]", "", fndcomicversion)
|
F_ComicVersion = re.sub("[^0-9]", "", fndcomicversion)
|
||||||
S_ComicVersion = str(SeriesYear)
|
#if this is a one-off, SeriesYear will be None and cause errors.
|
||||||
|
if SeriesYear is None:
|
||||||
|
S_ComicVersion = 0
|
||||||
|
else:
|
||||||
|
S_ComicVersion = str(SeriesYear)
|
||||||
logger.fdebug("FCVersion: " + str(F_ComicVersion))
|
logger.fdebug("FCVersion: " + str(F_ComicVersion))
|
||||||
logger.fdebug("DCVersion: " + str(D_ComicVersion))
|
logger.fdebug("DCVersion: " + str(D_ComicVersion))
|
||||||
logger.fdebug("SCVersion: " + str(S_ComicVersion))
|
logger.fdebug("SCVersion: " + str(S_ComicVersion))
|
||||||
|
@ -1068,8 +1072,8 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
|
||||||
logger.fdebug("integer value of issue we are looking for : " + str(intIss))
|
logger.fdebug("integer value of issue we are looking for : " + str(intIss))
|
||||||
|
|
||||||
fnd_iss_except = None
|
fnd_iss_except = None
|
||||||
comintIss = helpers.issuedigits(comic_iss)
|
|
||||||
logger.fdebug("issue we found for is : " + str(comic_iss))
|
logger.fdebug("issue we found for is : " + str(comic_iss))
|
||||||
|
comintIss = helpers.issuedigits(comic_iss)
|
||||||
logger.fdebug("integer value of issue we are found : " + str(comintIss))
|
logger.fdebug("integer value of issue we are found : " + str(comintIss))
|
||||||
|
|
||||||
#issue comparison now as well
|
#issue comparison now as well
|
||||||
|
|
|
@ -41,6 +41,8 @@ def solicit(month, year):
|
||||||
else:
|
else:
|
||||||
datestring = str(month) + str(year)
|
datestring = str(month) + str(year)
|
||||||
pagelinks = "http://www.comicbookresources.com/tag/solicits" + str(datestring)
|
pagelinks = "http://www.comicbookresources.com/tag/solicits" + str(datestring)
|
||||||
|
logger.info('datestring:' + datestring)
|
||||||
|
logger.info('checking:' + pagelinks)
|
||||||
pageresponse = urllib2.urlopen ( pagelinks )
|
pageresponse = urllib2.urlopen ( pagelinks )
|
||||||
soup = BeautifulSoup (pageresponse)
|
soup = BeautifulSoup (pageresponse)
|
||||||
cntlinks = soup.findAll('h3')
|
cntlinks = soup.findAll('h3')
|
||||||
|
@ -155,11 +157,26 @@ def populate(link,publisher,shipdate):
|
||||||
resultURL = []
|
resultURL = []
|
||||||
matched = "no"
|
matched = "no"
|
||||||
upcome = []
|
upcome = []
|
||||||
|
get_next = False
|
||||||
|
prev_chk = False
|
||||||
|
|
||||||
while (i < lenabc):
|
while (i < lenabc):
|
||||||
titlet = abc[i] #iterate through the p pulling out only results.
|
titlet = abc[i] #iterate through the p pulling out only results.
|
||||||
#print ("titlet: " + str(titlet))
|
#print ("titlet: " + str(titlet))
|
||||||
if "/news/preview2.php" in str(titlet):
|
if "/prev_img.php?pid" in str(titlet):
|
||||||
|
#solicits in 03-2014 have seperated <p> tags, so we need to take the subsequent <p>, not the initial.
|
||||||
|
get_next = True
|
||||||
|
i+=1
|
||||||
|
continue
|
||||||
|
elif "/news/preview2.php" in str(titlet):
|
||||||
|
prev_chk = True
|
||||||
|
get_next = False
|
||||||
|
elif get_next == True:
|
||||||
|
prev_chk = True
|
||||||
|
else:
|
||||||
|
prev_chk = False
|
||||||
|
get_next = False
|
||||||
|
if prev_chk == True:
|
||||||
tempName = titlet.findNext(text=True)
|
tempName = titlet.findNext(text=True)
|
||||||
if ' TPB' not in tempName and ' HC' not in tempName and 'GN-TPB' not in tempName and 'for $1' not in tempName.lower() and 'subscription variant' not in tempName.lower():
|
if ' TPB' not in tempName and ' HC' not in tempName and 'GN-TPB' not in tempName and 'for $1' not in tempName.lower() and 'subscription variant' not in tempName.lower():
|
||||||
#print publisher + ' found upcoming'
|
#print publisher + ' found upcoming'
|
||||||
|
@ -234,7 +251,8 @@ def populate(link,publisher,shipdate):
|
||||||
#print ('issue#: ' + re.sub('#', '', issue))
|
#print ('issue#: ' + re.sub('#', '', issue))
|
||||||
#print ('extra info: ' + exinfo)
|
#print ('extra info: ' + exinfo)
|
||||||
else:
|
else:
|
||||||
print ('no issue # to retrieve.')
|
pass
|
||||||
|
#print ('no issue # to retrieve.')
|
||||||
i+=1
|
i+=1
|
||||||
return upcome
|
return upcome
|
||||||
#end.
|
#end.
|
||||||
|
|
Loading…
Reference in New Issue