mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix: lack of config error url (#9490)
This commit is contained in:
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.disqus || !config.disqus.api_key) {
|
||||
throw 'Disqus RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'Disqus RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const forum = ctx.params.forum;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const utils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) {
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const uid = ctx.params.uid;
|
||||
|
||||
@@ -3,7 +3,7 @@ const utils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) {
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const fanfou = await utils.getFanfou();
|
||||
|
||||
@@ -3,7 +3,7 @@ const utils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) {
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const keyword = ctx.params.keyword;
|
||||
|
||||
@@ -3,7 +3,7 @@ const utils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) {
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const uid = ctx.params.uid;
|
||||
|
||||
@@ -21,7 +21,7 @@ async function login(ig) {
|
||||
logger.error('Instagram login fail: ' + error);
|
||||
}
|
||||
} else {
|
||||
throw Error('Instagram username and password are required to be set in the environment.');
|
||||
throw Error('Instagram RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.lastfm || !config.lastfm.api_key) {
|
||||
throw 'Last.fm RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Last.fm RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const user = ctx.params.user;
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.lastfm || !config.lastfm.api_key) {
|
||||
throw 'Last.fm RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Last.fm RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const user = ctx.params.user;
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.lastfm || !config.lastfm.api_key) {
|
||||
throw 'Last.fm RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'Last.fm RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const country = ctx.params.country;
|
||||
|
||||
@@ -77,7 +77,7 @@ exports.getDetails = (cache, simples) => Promise.all(simples.slice(0, MAX_DETAIL
|
||||
const MAX_TORRENT = 5;
|
||||
exports.getTorrents = async (cache, simples) => {
|
||||
if (!config.nhentai || !config.nhentai.username || !config.nhentai.password) {
|
||||
throw 'nhentai RSS with torrents is disabled due to the lack of <a href="https://docs.rsshub.app/install/#bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
throw 'nhentai RSS with torrents is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const cookie = await getCookie(config.nhentai.username, config.nhentai.password, cache);
|
||||
if (!cookie) {
|
||||
|
||||
@@ -6,7 +6,7 @@ const pixivUtils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.pixiv || !config.pixiv.refreshToken) {
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const id = ctx.params.id;
|
||||
|
||||
@@ -5,7 +5,7 @@ const pixivUtils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.pixiv || !config.pixiv.refreshToken) {
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const token = await getToken();
|
||||
|
||||
@@ -50,7 +50,7 @@ const alias = {
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.pixiv || !config.pixiv.refreshToken) {
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const mode = alias[ctx.params.mode] ? alias[ctx.params.mode] : ctx.params.mode;
|
||||
|
||||
@@ -6,7 +6,7 @@ const pixivUtils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.pixiv || !config.pixiv.refreshToken) {
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const keyword = ctx.params.keyword;
|
||||
|
||||
@@ -5,7 +5,7 @@ const pixivUtils = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.pixiv || !config.pixiv.refreshToken) {
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
|
||||
const id = ctx.params.id;
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) {
|
||||
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const id = ctx.params.id;
|
||||
const result = await utils.getTwit().get('favorites/list', {
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) {
|
||||
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const { id, name } = ctx.params;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) {
|
||||
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const woeid = ctx.params.woeid || 1; // Global information is available by using 1 as the WOEID
|
||||
const result = await utils.getTwit().get('trends/place', { id: woeid });
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.youtube || !config.youtube.key) {
|
||||
throw 'YouTube RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'YouTube RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const id = ctx.params.id;
|
||||
const embed = !ctx.params.embed;
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.youtube || !config.youtube.key) {
|
||||
throw 'YouTube RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'YouTube RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const id = ctx.params.id;
|
||||
const embed = !ctx.params.embed;
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.youtube || !config.youtube.key) {
|
||||
throw 'YouTube RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'YouTube RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const username = ctx.params.username;
|
||||
const embed = !ctx.params.embed;
|
||||
|
||||
@@ -3,7 +3,7 @@ const config = require('@/config').value;
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
if (!config.telegram || !config.telegram.token) {
|
||||
throw 'Telegram Sticker Pack RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
|
||||
throw 'Telegram Sticker Pack RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
||||
}
|
||||
const name = ctx.params.name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user