|
|
@ -470,6 +470,7 @@ async def handle_pad(args, padid, data, info, session): |
|
|
|
downloaded_html = True |
|
|
|
|
|
|
|
if html["_code"] == 200: |
|
|
|
try: |
|
|
|
html_body = html["data"]["html"] |
|
|
|
ver["path"] = p + ".raw.html" |
|
|
|
ver["url"] = quote(ver["path"]) |
|
|
@ -486,6 +487,8 @@ async def handle_pad(args, padid, data, info, session): |
|
|
|
async with await trio.open_file(ver["path"], "w") as f: |
|
|
|
output = ET.tostring(doc, method="html", encoding="unicode") |
|
|
|
await f.write(output) |
|
|
|
except TypeError: |
|
|
|
ver["message"] = html["message"] |
|
|
|
|
|
|
|
if args.all or args.magicwords: |
|
|
|
if not downloaded_html: |
|
|
@ -495,6 +498,7 @@ async def handle_pad(args, padid, data, info, session): |
|
|
|
ver["code"] = html["_code"] |
|
|
|
|
|
|
|
if html["_code"] == 200: |
|
|
|
try: |
|
|
|
html_body = html["data"]["html"] |
|
|
|
ver["path"] = p + ".magicwords.html" |
|
|
|
ver["url"] = quote(ver["path"]) |
|
|
@ -517,6 +521,8 @@ async def handle_pad(args, padid, data, info, session): |
|
|
|
async with await trio.open_file(ver["path"], "w") as f: |
|
|
|
output = ET.tostring(doc, method="html", encoding="unicode") |
|
|
|
await f.write(output) |
|
|
|
except TypeError: |
|
|
|
ver["message"] = html["message"] |
|
|
|
|
|
|
|
# output meta |
|
|
|
if args.all or args.meta: |
|
|
|