Skip to content

Commit 3b5da6a

Browse files
committed
fix: Ensure content is converted to string in print method and update User-Agent header
1 parent 3799fcb commit 3b5da6a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ def __init__(self, interface: str, debug: bool = False):
416416
self.debug = debug
417417

418418
def print(self, content: str, color: str="red", **kargs):
419+
content = str(content)
419420
colours_dict = {
420421
"yellow": fy,
421422
"red": fr,
@@ -971,7 +972,7 @@ def discounted_checkout(self, coupon, course_id) -> dict:
971972
},
972973
}
973974
headers = {
974-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0",
975+
"User-Agent": "okhttp/4.9.2 UdemyAndroid 8.9.2(499) (phone)",
975976
"Accept": "application/json, text/plain, */*",
976977
"Accept-Language": "en-US",
977978
"Referer": f"https://www.udemy.com/payment/checkout/express/course/{course_id}/?discountCode={coupon}",
@@ -986,8 +987,6 @@ def discounted_checkout(self, coupon, course_id) -> dict:
986987
"Sec-Fetch-Mode": "cors",
987988
"Sec-Fetch-Site": "same-origin",
988989
"Priority": "u=0",
989-
"Pragma": "no-cache",
990-
"Cache-Control": "no-cache",
991990
}
992991
csrftoken = None
993992
for cookie in self.client.cookies:

0 commit comments

Comments
 (0)