Skip to content

Commit

Permalink
fix: lack of config error url (DIYgod#9490)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Apr 7, 2022
1 parent a79cc20 commit f97cdb2
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/routes/disqus/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/fanfou/favorites.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/fanfou/home_timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/fanfou/public_timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/fanfou/user_timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/instagram/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/lastfm/loved.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/lastfm/recent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/lastfm/top.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/nhentai/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/pixiv/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/pixiv/illustfollow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/pixiv/ranking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/pixiv/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/pixiv/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/twitter/likes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/twitter/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/twitter/trends.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/youtube/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/youtube/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/youtube/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/telegram/stickerpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f97cdb2

Please sign in to comment.