Spaces:
Running on Zero
Running on Zero
feat: integrate Cloudflare R2 Quran translations, add translation endpoints and edge caching
3c6e2f1 Download scripts/check_aus_lib.py from sahihislam/superadmin: direct link, hf CLI and curl.
- Browser
- Download file 716 Bytes
-
https://huggingface.co/spaces/sahihislam/superadmin/resolve/main/scripts/check_aus_lib.py
- Command line
-
hf download hf://spaces/sahihislam/superadmin/scripts/check_aus_lib.py
-
curl -L -o check_aus_lib.py https://huggingface.co/spaces/sahihislam/superadmin/resolve/main/scripts/check_aus_lib.py
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) | |