INNER CODE UNIT · Python
save_cookies
wkaisertexas/tiktok-uploader · src/tiktok_uploader/auth.py:316
def save_cookies(path: str, cookies: list[Cookie]) -> None:
"""
Saves the cookies to a netscape file
"""
# saves the cookies to a file
cookie_jar = cookiejar.MozillaCookieJar(path)
# No need to load for new file or we can if we want to append
# cookie_jar.load()
for cookie in cookies:
cookie_jar.set_cookie(cookie_from_dict(cookie))
cookie_jar.save()
class InsufficientAuth(Exception):
"""
Insufficient authentication: