extract cover from cbr,cbz

This commit is contained in:
j 2019-01-29 15:50:43 +05:30
commit 8fdda01d4d
3 changed files with 49 additions and 3 deletions

View file

@ -2,11 +2,23 @@
import os
import ox
def cover(path):
data = None
#open rar file and extract first page here
try:
from unrar import rarfile
rar = rarfile.RarFile(path)
for cover in ox.sorted_strings(rar.namelist()):
try:
data = rar.read(cover)
except:
data = None
finally:
return data
except:
data = None
return data
def info(path):