Table of Contents
This project provides a tool to automate downloading documents from StudyDrive. It is divided into two main components: a backend connecting to the StudyDrive-API and a graphical user interface (GUI). The backend handles authentication, fetching course documents, and downloading files, while the GUI allows users to interact with the tool in an intuitive way.
-
Backend API:
- Authenticate users on StudyDrive.
- Fetch course document metadata.
- Download course documents to a local directory.
- Handle rate-limiting and retry logic for smooth operation.
-
GUI:
- Simple, user-friendly interface built using
Tkinter. - Allows users to input credentials, course URL, and other preferences.
- Displays real-time logs and status updates.
- Simple, user-friendly interface built using
-
Reusability:
- The backend API can be used independently in other Python projects to interact with StudyDrive programmatically.
- Python 3.8 or later
- Required Python packages (install via
pip):pip install -r requirements.txt
- Install
pyinstaller(viapip)pip install pyinstaller
- Build executable
pyinstaller "StudyDrive Scraper.spec" - The executable is in the
distfolder
The GUI is designed for non-technical users who want to interact with the tool visually.
- Launch the GUI:
python studydrive_scraper.py
- Enter:
- Username and Password: Your StudyDrive login credentials.
- Course URL: The URL of the StudyDrive course from which you want to download documents.
- Convert to PDF: Check this option if you want files to be converted to PDF format (if supported).
- Click Download. The application will:
- Authenticate your credentials.
- Fetch the list of documents available in the course.
- Download the files into a folder named after the course.
- Monitor progress and logs in the on-screen message area.
The backend can be integrated into other Python scripts for programmatic use.
from scraper_backend import run
username = "your-email@example.com"
password = "yourpassword"
course_url = "https://www.studydrive.net/de/course/sample-course/12345"
converted_to_pdf = False
run(username, password, course_url, converted_to_pdf)-
Authentication:
- The user logs in with their credentials.
- A session is initialized, including client secret generation and authentication headers.
-
Course Parsing:
- The course URL is parsed to extract the course name and ID.
-
Document Retrieval:
- The backend fetches metadata about all documents in the course.
-
File Download:
- Each document's download link is fetched.
- The file is saved to a local folder named after the course.
-
Rate-Limit Handling:
- If the API returns a 429 (rate-limit exceeded), the backend automatically retries after the specified wait time.
- Display a progress bar, based on the rate limit (30 requests before waiting 57 sec) and the number of pages (~50 documents per page)
- Add support for parallel downloads in a single session.
- Improve error handling and display user-friendly error messages in the GUI.
- Add a stop button for ongoing downloads
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Based on Romern/studydrive_download_new.py
