This commit is contained in:
parent
d637c74628
commit
a69acf171c
@ -1,5 +1,6 @@
|
|||||||
import bs4
|
import bs4
|
||||||
import executor
|
import executor
|
||||||
|
import logging
|
||||||
import pypub
|
import pypub
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -26,7 +27,7 @@ def process(metadata, output_dir):
|
|||||||
|
|
||||||
for paragraph in entry_content.children:
|
for paragraph in entry_content.children:
|
||||||
if paragraph.name == "h1":
|
if paragraph.name == "h1":
|
||||||
print(f"Gravesong - {chapter_title}")
|
logging.log(logging.INFO, f"Gravesong - {chapter_title}")
|
||||||
book.add_chapter(
|
book.add_chapter(
|
||||||
pypub.create_chapter_from_string(chapter_content, chapter_title)
|
pypub.create_chapter_from_string(chapter_content, chapter_title)
|
||||||
)
|
)
|
||||||
@ -34,8 +35,8 @@ def process(metadata, output_dir):
|
|||||||
elif paragraph.name == "p":
|
elif paragraph.name == "p":
|
||||||
chapter_content += paragraph.prettify()
|
chapter_content += paragraph.prettify()
|
||||||
|
|
||||||
print(f"Gravesong - {chapter_title}")
|
logging.log(logging.INFO, f"Gravesong - {chapter_title}")
|
||||||
book.add_chapter(pypub.create_chapter_from_string(chapter_content, chapter_title))
|
book.add_chapter(pypub.create_chapter_from_string(chapter_content, chapter_title))
|
||||||
|
|
||||||
print("Gravesong - Book")
|
logging.log(logging.INFO, "Gravesong - Book")
|
||||||
book.create_epub(output_dir)
|
book.create_epub(output_dir)
|
||||||
|
7
twi.py
7
twi.py
@ -1,6 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import executor
|
|
||||||
import bs4
|
import bs4
|
||||||
|
import executor
|
||||||
|
import logging
|
||||||
import pypub
|
import pypub
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -25,12 +26,12 @@ def fetchVolume(title, metadata, volume_title, output_dir, links):
|
|||||||
for removed in div_remove:
|
for removed in div_remove:
|
||||||
removed.decompose()
|
removed.decompose()
|
||||||
|
|
||||||
print(f"{title} - {chapter_title}")
|
logging.log(logging.INFO, f"{title} - {chapter_title}")
|
||||||
book.add_chapter(
|
book.add_chapter(
|
||||||
pypub.create_chapter_from_string(chapter_content.prettify(), chapter_title)
|
pypub.create_chapter_from_string(chapter_content.prettify(), chapter_title)
|
||||||
)
|
)
|
||||||
|
|
||||||
print(f"{title} - {volume_title}")
|
logging.log(logging.INFO, f"{title} - {volume_title}")
|
||||||
book.create_epub(output_dir)
|
book.create_epub(output_dir)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user