Skip to content

Commit

Permalink
Merge pull request #34 from soraxas/make-manual-mode-default
Browse files Browse the repository at this point in the history
set manual mode to be the default behaviour
  • Loading branch information
soraxas authored Feb 4, 2021
2 parents abed9de + 7e9fa55 commit 0ef9d75
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
29 changes: 18 additions & 11 deletions echo360/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"]

Expand Down Expand Up @@ -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"]
)
Expand Down

0 comments on commit 0ef9d75

Please sign in to comment.