1
0
Fork 0
forked from encrypt/random
random/moodle-epub-downloader/opf-downloader.py
2020-04-06 13:29:25 +02:00

10 lines
282 B
Python

from xml.etree import ElementTree as ET
tree = ET.parse('package.opf')
root = tree.getroot()
ns = {'opf': 'http://www.idpf.org/2007/opf'}
manifest = root.find('opf:manifest', ns)
base_url = ""
for item in manifest.findall('opf:item', ns):
print(base_url+item.attrib['href'])