- Google Chrome
- Python 3.9 or 3.10
- Pillow
- pypdf2
- beautifulsoup4
- selenium
pip install git+https://github.com/F33RNI/LMSDownloader.git
usage: lmsdownloader [-h] -l LOGIN -p PASSWORD -link LINK_TO_DOWNLOAD -path SAVE_TO [--login-link LOGIN_LINK]
[--wait-between-pages WAIT_BETWEEN_PAGES] [--link-check-regex LINK_CHECK_REGEX]
[--user-agent USER_AGENT] [--window-size WINDOW_SIZE] [--headless] [--no-logging-init]
options:
-h, --help show this help message and exit
-l LOGIN, --login LOGIN
LMS account login
-p PASSWORD, --password PASSWORD
LMS account password
-link LINK_TO_DOWNLOAD, --link-to-download LINK_TO_DOWNLOAD
LMS link to download
-path SAVE_TO, --save-to SAVE_TO
Path to the dir where to save downloaded PDF and TXT
--login-link LOGIN_LINK
link to LMS login page
--wait-between-pages WAIT_BETWEEN_PAGES
how long to wait after going to next page
--link-check-regex LINK_CHECK_REGEX
regex expression to check link_to_download (replace to "^" to bypass link check)
--user-agent USER_AGENT
browser's user agent to prevent mobile version
--window-size WINDOW_SIZE
browser's window size
--headless specify to open Chrome in headless mode
--no-logging-init specify to bypass logging initialization
from LMSDownloader import LMSDownloader
def main():
lms_downloader = LMSDownloader.LMSDownloader("your_login@gmail.com",
"your_strong_password",
"https://online.mospolytech.ru/mod/scorm/view.php?id=158345",
headless=False)
lms_downloader.download("path/to/download")
if __name__ == "__main__":
main()
Params:
lms_login
– LMS account loginlms_password
– LMS account passwordlink_to_download
– LMS link to downloadlogin_link
– Link to LMS login pagewait_between_pages
– How long to wait after going to next pagelink_check_regex
– Regex expression to check link_to_download (replace to "^" to bypass link check)user_agent
- Browser's user agent to prevent mobile versionwindow_size
- Default browser's window sizeheadless
– Set True to open Chrome in headless mode
Params:
save_to_directory
– Path to the dir where to save downloaded PDF and TXT
Returns:
- Paths to downloaded files
- Anyone can contribute! Just create a pull request