fix: slim tiktok_uploader __init__ to skip Browser/Video imports
Package __init__ was still loading undetected_chromedriver before tiktok.upload_video could be imported. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1515783760
commit
78a043b0de
@ -84,6 +84,19 @@ def _patch_vendor_upload() -> None:
|
|||||||
path.write_text(text, encoding="utf-8")
|
path.write_text(text, encoding="utf-8")
|
||||||
print("patched:", path)
|
print("patched:", path)
|
||||||
|
|
||||||
|
init_path = VENDOR / "tiktok_uploader" / "__init__.py"
|
||||||
|
if init_path.is_file():
|
||||||
|
slim = (
|
||||||
|
"# Cookie/API upload path must not import Browser (selenium) or Video (moviepy) at package load.\n"
|
||||||
|
"from .basics import *\n"
|
||||||
|
"from .Config import *\n"
|
||||||
|
"from .cookies import *\n"
|
||||||
|
)
|
||||||
|
cur = init_path.read_text(encoding="utf-8")
|
||||||
|
if cur.strip() != slim.strip():
|
||||||
|
init_path.write_text(slim, encoding="utf-8")
|
||||||
|
print("patched:", init_path)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user