diff --git a/README.md b/README.md index 65c04ae..6b70b5d 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,8 @@ python echo360.py [--before-date BEFORE_DATE(YYYY-MM-DD] [--unikey UNIKEY] [--password PASSWORD] [--setup-credentials] [--download-phantomjs-binary] [--chrome] [--firefox] - [--interactive] [--manual] [--debug] + [--echo360cloud] [--interactive] [--alternative_feeds] + [--debug] [--auto | --manual] ECHO360_URL Download lectures from portal. @@ -121,18 +122,21 @@ optional arguments: must have geckodriver installed in your PATH. --interactive, -i Interactively pick the lectures you want, instead of download all (default) or based on dates . - --manual, -m Only effective for 'echo360.org' host. When set, you - will need to manually continue the script after - logging into your institution's SSO; i.e. it will - disable the automatic redirection which is the default - behavior. --alternative_feeds, -a - Download first two video feeds. Since some university - have multiple video feeds, with this option on the - downloader will also try to download the second video, - which could be the alternative feed. Might only work - on some 'echo360.org' hosts. + Download first two video feeds. Since some university + have multiple video feeds, with this option on the + downloader will also try to download the second + video, which could be the alternative feed. Might + only work on some 'echo360.org' hosts. --debug Enable extensive logging. + --auto Only effective for 'echo360.org' host. When set, this + script will attempts to automatically redirects after + you had logged into your institution's SSO. + --manual, -m [Deprecated] Only effective for 'echo360.org' host. + When set, the script requires user to manually + continue the script within the terminal. This is the + default behaviour and exists only for backward + compatibility reason. ``` # Examples diff --git a/echo360/main.py b/echo360/main.py index 2dd2e89..c95698c 100644 --- a/echo360/main.py +++ b/echo360/main.py @@ -131,16 +131,6 @@ def handle_args(): help="Interactively pick the lectures you want, instead of download all \ (default) or based on dates .", ) - parser.add_argument( - "--manual", - "-m", - action="store_true", - default=False, - help="Only effective for 'echo360.org' host. When set, you will need to \ - manually continue the script after logging into your \ - institution's SSO; i.e. it will disable the automatic \ - redirection which is the default behavior.", - ) parser.add_argument( "--alternative_feeds", "-a", @@ -160,6 +150,23 @@ def handle_args(): help="Enable extensive logging.", ) + redirection_option = parser.add_mutually_exclusive_group(required=False) + redirection_option.add_argument( + "--auto", + action="store_true", + help="Only effective for 'echo360.org' host. When set, this script will attempts to \ + automatically redirects after you had logged into your \ + institution's SSO.", + ) + redirection_option.add_argument( + "--manual", + "-m", + action="store_true", + help="[Deprecated] Only effective for 'echo360.org' host. When set, the script requires user to \ + manually continue the script within the terminal. This is the \ + default behaviour and exists only for backward compatibility reason.", + ) + args = vars(parser.parse_args()) course_url = args["url"] @@ -220,7 +227,7 @@ def handle_args(): webdriver_to_use, args["interactive"], args["enable_degbug"], - args["manual"], + not args["auto"], args["alternative_feeds"], args["echo360cloud"] )