mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-30 00:00:48 +02:00
fix codec error for py2
This commit is contained in:
parent
2d327359aa
commit
710cc86eaf
@ -119,14 +119,14 @@ def generate_main_html(output_dir='.'):
|
|||||||
image = files[0] # 001.jpg or 001.png
|
image = files[0] # 001.jpg or 001.png
|
||||||
if folder is not None:
|
if folder is not None:
|
||||||
title = folder.replace('_', ' ')
|
title = folder.replace('_', ' ')
|
||||||
if sys.version_info > (3, 0):
|
# if sys.version_info > (3, 0):
|
||||||
title = title.encode('utf-8')
|
# title = title.encode('utf-8')
|
||||||
else:
|
else:
|
||||||
title = 'nHentai HTML Viewer'
|
title = 'nHentai HTML Viewer'
|
||||||
image_html += element.format(FOLDER=folder, IMAGE=image, TITLE=title)
|
image_html += element.format(FOLDER=folder, IMAGE=image, TITLE=title)
|
||||||
|
|
||||||
data = main.format(STYLES=css, COUNT=count, PICTURE=image_html)
|
|
||||||
try:
|
try:
|
||||||
|
data = main.format(STYLES=css, COUNT=count, PICTURE=image_html)
|
||||||
if sys.version_info < (3, 0):
|
if sys.version_info < (3, 0):
|
||||||
with open('./main.html', 'w') as f:
|
with open('./main.html', 'w') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user