Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup Sciebo link finding #121

Open
D-VR opened this issue Jul 9, 2024 · 0 comments
Open

Speedup Sciebo link finding #121

D-VR opened this issue Jul 9, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@D-VR
Copy link
Collaborator

D-VR commented Jul 9, 2024

Currently the following code (around line 1130), may check a lot of duplicate links (up to 6x or higher! in one of my courses), leading to significant slowdowns due to unnecessary get requests. Adding some simple caching can improve this.

# https://rwth-aachen.sciebo.de/s/XXX
        if self.config.get("used_modules", {}).get("url", {}).get("sciebo", {}):
            sciebo_links = re.findall(
                "https://rwth-aachen.sciebo.de/s/[a-zA-Z0-9-]+", text
            )

            for vid in sciebo_links:
                response = self.session.get(vid)
                soup = bs(response.text, features="html.parser")
                url = soup.find("input", {"name": "downloadURL"})
                filename = soup.find("input", {"name": "filename"})
                if url and filename:
                    parent_node.add_child(
                        filename["value"], url["value"], "Sciebo file", url=url["value"]
                    )

I will create something when I have time

@D-VR D-VR added the enhancement New feature or request label Jul 9, 2024
@D-VR D-VR self-assigned this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant