File size: 716 Bytes
3c6e2f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)