superadmin / scripts /check_aus_lib.py
suhailshafi007's picture
feat: integrate Cloudflare R2 Quran translations, add translation endpoints and edge caching
3c6e2f1
Raw History Blame Contribute Delete
716 Bytes
import urllib.request
import json
import sys
sys.stdout.reconfigure(encoding='utf-8')
coll = "DrIsrarAhmedTafseerOfQuranEnglishFullQuranAustralianIslamicLibrary"
url = f"https://archive.org/metadata/{coll}/files"
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
try:
with urllib.request.urlopen(req) as r:
data = json.loads(r.read())
mp3s = [f['name'] for f in data.get('result', []) if f['name'].endswith('.mp3')]
print(f"=== {coll} ===")
print(f"Total MP3s: {len(mp3s)}")
for f in mp3s[:10]:
print(" ", f)
if len(mp3s) > 10:
print(" ...")
for f in mp3s[-5:]:
print(" ", f)
except Exception as e:
print("Error:", e)