From fbb9a1d67b5dbfc83c37a8cfbf460365c77f8c26 Mon Sep 17 00:00:00 2001 From: bytedream Date: Sat, 23 Oct 2021 23:03:30 +0200 Subject: [PATCH] Added website support completion for README.md --- README.md | 30 +++++++++++++++++++++++++++--- build.py | 16 ++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8c36329..11e9072 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,33 @@ This addon replaces the video player from this sides with the native player buil This has the advantage, that no advertising or popups are shown when trying to interact with the video (playing, skipping, ...) or some sites are showing them even if you do nothing. Additionally this enables you to download the video by right-clicking it and just choose the download option. -Supported streaming providers (for a complete list of all supported websites, see [here](SUPPORTED)): -- [streamtape.com](https://streamtape.com/) -- [vidoza.net](https://vidoza.net/) +Supported streaming providers (for a complete list of all supported websites, see [here](SUPPORTED) or in [show all](#all-supported-websites) below): +- [streamtape.com](https://streamtape.com) +- [vivo.sx](https://vivo.sx) +- [voe.sx](https://voe.sx) + +
+ Show all + +
+ +---
How it's working diff --git a/build.py b/build.py index 528526b..4deff10 100644 --- a/build.py +++ b/build.py @@ -65,9 +65,21 @@ def write_readme(): # it this the right syntax if i want to read and write to a file? * dreams in python3.10 * with open('README.md', 'r') as read_file: - new_readme = re.sub(r'(?<=The addon was tested on\n)(.+?)(?=\n*## Installing)', '\n'.join(f'- {name} ({version})' for name, version in tested.items()), read_file.read(), flags=re.DOTALL) + readme = read_file.read() + + # adds all available websites + all_providers_regex = r'(?<=)' + all_providers = '\n'.join(f'\t\t
  • {provider}
  • ' for provider in open('SUPPORTED', 'r').read().split('\n')) + '\n\t' + readme = re.sub(all_providers_regex, all_providers, readme, flags=re.DOTALL) + + # adds all installed browsers to the tested browser section. i'm just to lazy to seek out all browser versions manually + tested_browsers_regex = r'(?<=The addon was tested on\n)(.+?)(?=\n*## Installing)' + tested_browsers = '\n'.join(f'- {name} ({version})' for name, version in tested.items()) + readme = re.sub(tested_browsers_regex, tested_browsers, readme, flags=re.DOTALL) + + # rewrite the readme with open('README.md', 'w') as write_file: - write_file.write(new_readme) + write_file.write(readme) write_file.close() read_file.close()