fix LibraryScraper

This commit is contained in:
jxxghp
2023-08-03 19:10:27 +08:00
parent 1125cfa6ee
commit 10a240e581
2 changed files with 209 additions and 9 deletions

13
app/helper/nfo.py Normal file
View File

@ -0,0 +1,13 @@
import xml.etree.ElementTree as ET
from pathlib import Path
class NfoReader:
def __init__(self, xml_file_path: Path):
self.xml_file_path = xml_file_path
self.tree = ET.parse(xml_file_path)
self.root = self.tree.getroot()
def get_element_value(self, element_path):
element = self.root.find(element_path)
return element.text if element is not None else None