用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| 第125行: | 第125行: | ||
function loadSongColors(song) { | function loadSongColors(song) { | ||
const encodedUrl = `https://rizwiki.cn/api.php?action=query%26titles=${encodeURIComponent(song.title)}%26prop=revisions%26rvprop=content%26format=json` | const encodedUrl = `https://rizwiki.cn/api.php?action=query%26titles=${encodeURIComponent(song.title)}%26prop=revisions%7Cpageimages%26rvprop=content%26pithumbsize=300%26format=json` | ||
const decodedUrl = decodeURIComponent(encodedUrl) | const decodedUrl = decodeURIComponent(encodedUrl) | ||
| 第134行: | 第134行: | ||
const pages = data.query.pages | const pages = data.query.pages | ||
const pageId = Object.keys(pages)[0] | const pageId = Object.keys(pages)[0] | ||
const pageData = pages[pageId] | |||
if (!pageData.revisions) { | |||
throw new Error('页面不存在') | throw new Error('页面不存在') | ||
} | } | ||
const wikitext = pageData.revisions[0]['*'] | |||
const styles = parseStylesFromWikitext(wikitext) | const styles = parseStylesFromWikitext(wikitext) | ||
let imageUrl = null | |||
if (pageData.thumbnail) { | |||
if (pageData.thumbnail.source) { | |||
imageUrl = pageData.thumbnail.source; | |||
console.log('获取到的缩略图URL:', imageUrl); | |||
} | |||
} | |||
updateSongInfo(song, { | updateSongInfo(song, { | ||
| 第168行: | 第174行: | ||
}) | }) | ||
} | } | ||
const encodedUrl = `https://rizwiki.cn/api.php?action=query%26titles=${encodeURIComponent(song.title)}%26prop=revisions%7Cpageimages%26rvprop=content%26pithumbsize=300%26format=json` | |||
const decodedUrl = decodeURIComponent(encodedUrl) | |||
fetch(decodedUrl) | |||
.then(r => r.json()) | |||
.then(data => { | |||
try { | |||
const pages = data.query.pages | |||
const pageId = Object.keys(pages)[0] | |||
const pageData = pages[pageId] | |||
if (!pageData.revisions) { | |||
throw new Error('页面不存在') | |||
} | |||
const wikitext = pageData.revisions[0]['*'] | |||
const styles = parseStylesFromWikitext(wikitext) | |||
let imageUrl = null | |||
if (pageData.thumbnail) { | |||
if (pageData.thumbnail.source) { | |||
imageUrl = pageData.thumbnail.source; | |||
console.log('获取到的缩略图URL:', imageUrl); | |||
} | |||
} | |||
function parseImageFromWikitext(wikitext) { | function parseImageFromWikitext(wikitext) { | ||
2025年10月20日 (一) 00:21的版本
| 曲目 | |
|---|---|
|
|
|
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
神秘的随机挑战!
| 曲目 | |
|---|---|
|
| |
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2