23 lines
415 B
Python
23 lines
415 B
Python
import requests
|
|
|
|
OWNER = "fanmingming"
|
|
REPO = "live"
|
|
PATH = "tv"
|
|
OUTPUT_FILE = "logolist.txt"
|
|
|
|
api_url = f"https://api.github.com/repos/{OWNER}/{REPO}/contents/{PATH}"
|
|
|
|
resp = requests.get(api_url)
|
|
resp.raise_for_status()
|
|
|
|
items = resp.json()
|
|
|
|
filenames = [
|
|
item["name"]
|
|
for item in items
|
|
if item["type"] == "file"
|
|
]
|
|
|
|
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
|
|
f.write(",".join(filenames))
|