File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import logging
66
7- from linkedin .conf import ENV_FILE
7+ from linkedin .conf import COOKIES_DIR , ENV_FILE
88
99logger = logging .getLogger (__name__ )
1010
11+ LEGAL_ACCEPTANCE_MARKER = COOKIES_DIR / ".legal_notice_accepted"
12+
1113
1214def _read_multiline (prompt_msg : str ) -> str :
1315 """Read multi-line input via input() until Ctrl-D (EOF)."""
@@ -217,7 +219,10 @@ def _onboard_account(campaign):
217219
218220
219221def _require_legal_acceptance () -> None :
220- """Require the user to read and accept the legal notice before continuing."""
222+ """Require the user to read and accept the legal notice (once)."""
223+ if LEGAL_ACCEPTANCE_MARKER .exists ():
224+ return
225+
221226 url = "https://github.com/eracle/linkedin/blob/master/LEGAL_NOTICE.md"
222227 print ()
223228 print ("=" * 60 )
@@ -229,6 +234,8 @@ def _require_legal_acceptance() -> None:
229234 while True :
230235 answer = input ("Do you accept the Legal Notice? (y/n): " ).strip ().lower ()
231236 if answer == "y" :
237+ LEGAL_ACCEPTANCE_MARKER .parent .mkdir (parents = True , exist_ok = True )
238+ LEGAL_ACCEPTANCE_MARKER .touch ()
232239 return
233240 if answer == "n" :
234241 print ()
Original file line number Diff line number Diff line change 2020
2121logging .getLogger ().handlers .clear ()
2222logging .basicConfig (
23- level = logging .INFO ,
23+ level = logging .DEBUG ,
2424 format = "%(message)s" ,
2525)
2626
You can’t perform that action at this time.
0 commit comments