- 新增壁纸图库相关组件(WallpaperGalleryView/WallpaperSearchBar等) - 优化编辑器主题服务和系统UI管理 - 新增虚线边框和拖拽描边风格支持 - 完善今日诗词服务和阅读报告功能 - 修复多个UI问题和空指针异常 - 更新依赖库版本和SVG资源 - 优化交互动画和状态管理 - 补充文档和API测试脚本
38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
import requests, json
|
|
|
|
sources = [
|
|
('api_unsplash.php', 'Unsplash'),
|
|
('api_pexels.php', 'Pexels'),
|
|
('api_360_bing.php?source=bing', 'Bing'),
|
|
('api_nasa.php', 'NASA'),
|
|
('api_anime_pictures.php', 'Anime'),
|
|
]
|
|
|
|
for path, name in sources:
|
|
url = f'http://bz.wktyl.com/{path}&limit=2&page=1' if '?' in path else f'http://bz.wktyl.com/{path}?limit=2&page=1'
|
|
try:
|
|
r = requests.get(url, timeout=15)
|
|
d = r.json()
|
|
items = d.get('data', [])
|
|
print(f'\n=== {name} (success={d.get("success")}, items={len(items)}) ===')
|
|
if items:
|
|
media = items[0].get('media', {})
|
|
print(f' thumbnail_url: {media.get("thumbnail_url","")[:80]}')
|
|
print(f' preview_url: {media.get("preview_url","")[:80]}')
|
|
print(f' image_url: {media.get("image_url","")[:80]}')
|
|
except Exception as e:
|
|
print(f'\n=== {name} ERROR: {e} ===')
|
|
|
|
# Test "all" category
|
|
print('\n\n=== Test category=all ===')
|
|
url = 'http://bz.wktyl.com/api_unsplash.php?limit=2&page=1&category=all'
|
|
r = requests.get(url, timeout=15)
|
|
d = r.json()
|
|
print(f'success={d.get("success")}, items={len(d.get("data",[]))}')
|
|
|
|
# Test no category (should be same as all)
|
|
url2 = 'http://bz.wktyl.com/api_unsplash.php?limit=2&page=1'
|
|
r2 = requests.get(url2, timeout=15)
|
|
d2 = r2.json()
|
|
print(f'no-category: success={d2.get("success")}, items={len(d2.get("data",[]))}')
|