mirror of
https://github.com/ciromattia/kcc
synced 2025-12-16 03:06:33 +00:00
Tweaked CBZ detection
This commit is contained in:
@@ -360,9 +360,8 @@ class RarCannotExec(RarExecError):
|
|||||||
|
|
||||||
def is_rarfile(xfile):
|
def is_rarfile(xfile):
|
||||||
'''Check quickly whether file is rar archive.'''
|
'''Check quickly whether file is rar archive.'''
|
||||||
fd = XFile(xfile)
|
with open(xfile, 'rb') as fh:
|
||||||
buf = fd.read(len(RAR_ID))
|
buf = fh.read(len(RAR_ID))
|
||||||
fd.close()
|
|
||||||
if buf == RAR_ID or buf == RAR5_ID:
|
if buf == RAR_ID or buf == RAR5_ID:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user