Created
May 20, 2022 18:34
-
-
Save okiwan/ad24116c1a9033eaa0c81b44631b71d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import re | |
| import os | |
| handler = open("index.html", "r") | |
| data = handler.readlines() | |
| expression = re.compile(r'".*/(pc-engine-fan-.*)/.*"') | |
| final_links = [] | |
| for line in data: | |
| if not 'pc-engine-fan' in line: | |
| continue | |
| links = line.split("<li>") | |
| for link in links: | |
| matches = expression.findall(link) | |
| if matches: | |
| final_links.append(matches[0]) | |
| print("#!/usr/bin/env bash") | |
| for idx, link in enumerate(final_links): | |
| parts = link.split("-") | |
| command = f"wget https://archive.org/download/{link}/{parts[0].upper()}%20{parts[1].capitalize()}%20{parts[2].capitalize()}%20-%20{parts[3].capitalize()}%20{parts[4]}.pdf" | |
| print(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment