From 717fb8300a45d9ae4e2c5999aa79a6925bd4a589 Mon Sep 17 00:00:00 2001 From: curly60e <55191248+curly60e@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:49:45 -0300 Subject: [PATCH] Update ppi.py --- pybitblock/ppi.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pybitblock/ppi.py b/pybitblock/ppi.py index 7ce6536..ad46713 100644 --- a/pybitblock/ppi.py +++ b/pybitblock/ppi.py @@ -938,11 +938,11 @@ def lnbitCreateNewInvoice(): a = loadFileConnLNBits(['invoice_read_key']) b = str(a['invoice_read_key']) curl = ( - 'curl -X POST https://legend.lnbits.com/api/v1/payments -d ' - + "'{" - + f""""out": false, "amount": {amt}, "memo": "{memo} -PyBLOCK" """""" + 'curl -X POST https://legend.lnbits.com/api/v1/payments -d ', + + "'{", + + f""""out": false, "amount": {amt}, "memo": "{memo} -PyBLOCK" """""", + "}'" - + f""" -H "X-Api-Key: {b} " -H "Content-type: application/json" """ + + f""" -H "X-Api-Key: {b} " -H "Content-type: application/json" """, ) sh = os.popen(curl).read() @@ -1051,11 +1051,11 @@ def lnbitCreatePayWall(): remember = "false" b = str(a['admin_key']) curl = ( - 'curl -X POST https://legend.lnbits.com/paywall/api/v1/paywalls -d ' - + "'{" - + f""""url": "{url}", "memo": "{memo}", "description": "{desc}", "amount": {amt}, "remembers": {remember} """""" - + "}'" - + f""" -H "Content-type: application/json" -H "X-Api-Key: {b}" """ + 'curl -X POST https://legend.lnbits.com/paywall/api/v1/paywalls -d ', + + "'{", + + f""""url": "{url}", "memo": "{memo}", "description": "{desc}", "amount": {amt}, "remembers": {remember} """""", + + "}'", + + f""" -H "Content-type: application/json" -H "X-Api-Key: {b}" """, ) sh = os.popen(curl).read() @@ -1168,8 +1168,8 @@ def lnbitDeletePayWall(): a = loadFileConnLNBits(['invoice_read_key']) b = str(a['invoice_read_key']) checkcurl = ( - 'curl -X GET https://legend.lnbits.com/paywall/api/v1/paywalls -H' - + f""" "X-Api-Key: {b}" """ + 'curl -X GET https://legend.lnbits.com/paywall/api/v1/paywalls -H', + + f""" "X-Api-Key: {b}" """, ) sh = os.popen(checkcurl).read() @@ -1211,8 +1211,8 @@ def lnbitDeletePayWall(): b = str(a['admin_key']) id = input("Insert PayWall ID: ") curl = ( - f"curl -X DELETE https://legend.lnbits.com/paywall/api/v1/paywalls/{id}" - + f""" -H "X-Api-Key: {b}" """ + f"curl -X DELETE https://legend.lnbits.com/paywall/api/v1/paywalls/{id}", + + f""" -H "X-Api-Key: {b}" """, ) sh = os.popen(curl).read() @@ -1242,11 +1242,11 @@ def lnbitsLNURLw(): a = loadFileConnLNBits(['admin_key']) b = str(a['admin_key']) curl = ( - 'curl -X POST https://legend.lnbits.com/withdraw/api/v1/links -d ' - + """'{"title":""" - + f'"{title}", "min_withdrawable": {minwith}, "max_withdrawable": {maxwith}, "uses": {usesw}, "wait_time": {waittime}, "is_unique": {isunique}' - + "}'" - + f' -H "Content-type: application/json" -H "X-Api-Key: {b}"' + 'curl -X POST https://legend.lnbits.com/withdraw/api/v1/links -d ', + + """'{"title":""", + + f'"{title}", "min_withdrawable": {minwith}, "max_withdrawable": {maxwith}, "uses": {usesw}, "wait_time": {waittime}, "is_unique": {isunique}', + + "}'", + + f' -H "Content-type: application/json" -H "X-Api-Key: {b}"', ) sh = os.popen(curl).read()