我正在使用archive.org获取有声读物,现在我想加载下50个结果,我该怎么做呢?我当前的连接URL在这里,它只检索前50个结果
val LIBRIVOX_URL = "https://archive.org/advancedsearch.php?q=subject%3A%22librivox%22+AND+mediatype%3Aaudio&fl[]=avg_rating&fl[]=publisher&fl[]=description&fl[]=downloads&fl[]=identifier&fl[]=mediatype&fl[]=num_reviews&fl[]=title&sort[]=&sort[]=&sort[]=&rows=50&page=1&output=json&callback=callback&save=yes"发布于 2018-03-03 06:18:08
希望这能帮到你,你可以用你的网址来选择你想要返回结果的行数,例如:http://localhost:9000/100‘将返回100个结果’
代码如下:
app.get('/:id', (req, res) => {
let rows = req.params.id;
let mediatype = 'audio';
let archiveUrl = `https://archive.org/advancedsearch.php?q=subject%3A%22librivox%22+AND+mediatype%3A${mediatype}&fl[]=avg_rating&fl[]=publisher&fl[]=description&fl[]=downloads&fl[]=identifier&fl[]=mediatype&fl[]=num_reviews&fl[]=title&sort[]=&sort[]=&sort[]=&rows=${rows}&page=1&output=json`
axios.get(archiveUrl)
.then(elem => {
res.json(elem.data.response.docs);
})
})https://stackoverflow.com/questions/49077255
复制相似问题