https://github.com/f33rni/lmsdownloader
Download presentations and lectures from LMS using Chrome in headless mode
https://github.com/f33rni/lmsdownloader
browser-automation chrome headless lms mospolytech selenium
Last synced: about 1 month ago
JSON representation
Download presentations and lectures from LMS using Chrome in headless mode
- Host: GitHub
- URL: https://github.com/f33rni/lmsdownloader
- Owner: F33RNI
- License: apache-2.0
- Created: 2023-11-01T18:23:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-03T18:40:43.000Z (over 1 year ago)
- Last Synced: 2025-02-15T12:52:10.160Z (3 months ago)
- Topics: browser-automation, chrome, headless, lms, mospolytech, selenium
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🏠 LMSDownloader
### Download presentations and lectures from LMS
![]()
----------
## 📙 Dependencies
- Google Chrome
- Python 3.9 or 3.10
- Pillow
- pypdf2
- beautifulsoup4
- selenium----------
## ❓ Get started
### Installing using pip
```
pip install git+https://github.com/F33RNI/LMSDownloader.git
```### Usage in terminal
```
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
```### Usage as python package
```python
from LMSDownloader import LMSDownloaderdef main():
lms_downloader = LMSDownloader.LMSDownloader("[email protected]",
"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()
```### LMSDownloader()
#### Initializes LMSDownloader class (just copies fields)
Params:
- `lms_login` – LMS account login
- `lms_password` – LMS account password
- `link_to_download` – LMS link to download
- `login_link` – Link to LMS login page
- `wait_between_pages` – How long to wait after going to next page
- `link_check_regex` – Regex expression to check link_to_download (replace to "^" to bypass link check)
- `user_agent` - Browser's user agent to prevent mobile version
- `window_size` - Default browser's window size
- `headless` – Set True to open Chrome in headless mode### LMSDownloader.download()
#### Downloads pages into PDF (and TXT for SCORM book)
Params:
- `save_to_directory` – Path to the dir where to save downloaded PDF and TXTReturns:
- Paths to downloaded files----------
## ✨ Contribution
- Anyone can contribute! Just create a pull request
----------
### 🚧 P.S. This project is under development!