From f273994ee4dc48d2f8bb34256806a8684d4b1bab Mon Sep 17 00:00:00 2001 From: FoxRefire <155989196+FoxRefire@users.noreply.github.com> Date: Sat, 20 Jul 2024 18:46:22 +0900 Subject: [PATCH] Update CanalPlus2.py (Closes #38) --- python/schemes/CanalPlus2.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/python/schemes/CanalPlus2.py b/python/schemes/CanalPlus2.py index 34b55a1..d8e4322 100644 --- a/python/schemes/CanalPlus2.py +++ b/python/schemes/CanalPlus2.py @@ -1,9 +1,5 @@ -import re +import xml.etree.ElementTree as ET b64challenge = base64.b64encode(challenge).decode() -res = await (await pyfetch(licUrl, -method="POST", -headers=licHeaders, -body=b64challenge -)).text() +res = await corsFetch(licUrl, "POST", licHeaders, b64challenge, "str") -licence = base64.b64decode(re.search(".*(.*)<\/license>", str(res))[2].encode()) +licence = ET.XML(res)[0][0].text