From f3a16083b9f09c132dce6f262a1fb30f672b9441 Mon Sep 17 00:00:00 2001 From: garret1317 Date: Sun, 14 Sep 2025 15:04:02 +0100 Subject: rename "misc" -> "contrib" --- contrib/generate_html.py | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 contrib/generate_html.py (limited to 'contrib/generate_html.py') diff --git a/contrib/generate_html.py b/contrib/generate_html.py new file mode 100755 index 0000000..0e15d6a --- /dev/null +++ b/contrib/generate_html.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +import os +import hashlib +import re + +pip_index = open("index.html", "w") + +pip_index.write(""" + + + yt-dlp-rajiko pip index + + + + + + + +""") + +latest_tarball = tarballs[-1] +latest_wheel = wheels[-1] +print(latest_tarball, latest_wheel) + +os.remove("yt_dlp_rajiko-latest.tar.gz") +os.symlink(latest_tarball, "yt_dlp_rajiko-latest.tar.gz") + +os.remove("yt_dlp_rajiko-latest.whl") +os.symlink(latest_wheel, "yt_dlp_rajiko-latest.whl") + +site_sha256.reverse() + +latest_list = site_sha256[:2] +previous_list = site_sha256[2:] + +latest = "\n".join(["", "", "\n".join(latest_list), "", ""]) + +previous = "\n".join(["", "", "\n".join(previous_list), "", ""]) + +for i in ["../../index.html", "../../index.ja.html"]: + with open(i, "r+") as f: + page = f.read() + + page = re.sub(r".+", latest, page, flags=re.DOTALL) + page = re.sub(r".+", previous, page, flags=re.DOTALL) + + f.seek(0) + f.truncate(0) + f.write(page) -- cgit v1.2.3-70-g09d2 From bd3436ba0b71b2f87f83afd329a4ad202a59cedb Mon Sep 17 00:00:00 2001 From: garret1317 Date: Fri, 26 Sep 2025 14:15:08 +0100 Subject: update site update script to handle plugin bundle --- contrib/generate_html.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'contrib/generate_html.py') diff --git a/contrib/generate_html.py b/contrib/generate_html.py index 0e15d6a..a52c89d 100755 --- a/contrib/generate_html.py +++ b/contrib/generate_html.py @@ -20,6 +20,7 @@ site_sha256 = [] tarballs = [] wheels = [] +bundles = [] for item in sorted(os.listdir()):#, key=lambda x: x.name): if os.path.islink(item): @@ -29,6 +30,8 @@ for item in sorted(os.listdir()):#, key=lambda x: x.name): tarballs.append(item) elif item.endswith(".whl"): wheels.append(item) + elif item.endswith(".bundle.zip"): + bundles.append(item) else: continue @@ -45,7 +48,7 @@ for item in sorted(os.listdir()):#, key=lambda x: x.name): pip_index.write(item) pip_index.write("\n") - site_string = checksum + "  " + '' + item + "
" + site_string = checksum + " " + '' + item + "" site_sha256.append(site_string) pip_index.write(""" @@ -55,7 +58,8 @@ pip_index.write(""" latest_tarball = tarballs[-1] latest_wheel = wheels[-1] -print(latest_tarball, latest_wheel) +latest_bundle = bundles[-1] +print(latest_tarball, latest_wheel, latest_bundle) os.remove("yt_dlp_rajiko-latest.tar.gz") os.symlink(latest_tarball, "yt_dlp_rajiko-latest.tar.gz") @@ -63,12 +67,15 @@ os.symlink(latest_tarball, "yt_dlp_rajiko-latest.tar.gz") os.remove("yt_dlp_rajiko-latest.whl") os.symlink(latest_wheel, "yt_dlp_rajiko-latest.whl") +os.remove("yt_dlp_rajiko-latest.bundle.zip") +os.symlink(latest_bundle, "yt_dlp_rajiko-latest.bundle.zip") + site_sha256.reverse() -latest_list = site_sha256[:2] -previous_list = site_sha256[2:] +latest_list = site_sha256[:3] +previous_list = site_sha256[3:] -latest = "\n".join(["", "", "\n".join(latest_list), "", ""]) +latest = "\n".join(["", "
", "\n".join(latest_list), "
", ""]) previous = "\n".join(["", "", "\n".join(previous_list), "", ""]) -- cgit v1.2.3-70-g09d2