Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from diygod:master #826

Merged
merged 4 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/en/social-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,13 @@ Though, every Story expires after 24 hours, so it may be not so serious.

<RouteEn author="EYHN" path="/pixiv/ranking/:mode/:date?" example="/pixiv/ranking/week" :paramsDesc="['rank type', 'format: `2018-4-25`']" radar="1" rssbud="1">

| pixiv daily rank | pixiv weekly rank | pixiv monthly rank | pixiv male rank | pixiv female rank | AI-generated work Rankings | pixiv original rank | pixiv rookie user rank |
| ---------------- | ----------------- | ------------------ | --------------- | ----------------- | ------------------- | ---------------------- | ---------------------- |
| day | week | month | day_male | day_female | day_ai | week_original | week_rookie |
| daily rank | weekly rank | monthly rank | male rank | female rank | AI-generated work Rankings | original rank | rookie user rank |
| ---------- | ----------- | ------------ | --------- | ----------- | -------------------------- | ------------- | ---------------- |
| day | week | month | day_male | day_female | day_ai | week_original | week_rookie |

| pixiv R-18 daily rank | pixiv R-18 male rank | pixiv R-18 female rank | pixiv R-18 weekly rank | pixiv R-18G rank |
| --------------------- | -------------------- | ---------------------- | ---------------------- | ---------------- |
| day_r18 | day_male_r18 | day_female_r18 | week_r18 | week_r18g |
| R-18 daily rank | R-18 AI-generated work | R-18 male rank | R-18 female rank | R-18 weekly rank | R-18G rank |
| --------------- | ---------------------- | -------------- | ---------------- | ---------------- | ---------- |
| day_r18 | day_r18_ai | day_male_r18 | day_female_r18 | week_r18 | week_r18g |

</RouteEn>

Expand Down
6 changes: 5 additions & 1 deletion docs/multimedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,11 @@ JavDB 有多个备用域名,本路由默认使用永久域名 <https://javdb.c

### 歌手专辑

<Route author="metowolf" example="/163/music/artist/2116" path="/163/music/artist/:id" :paramsDesc="[' 歌手 id, 可在歌手详情页 URL 中找到']" radar="1" />
<Route author="metowolf" example="/163/music/artist/2116" path="/163/music/artist/:id" :paramsDesc="['歌手 id, 可在歌手详情页 URL 中找到']" radar="1" />

### 歌手歌曲

<Route author="ZhongMingKun" example="/163/music/artist/songs/2116" path="/163/music/artist/songs/:id" :paramsDesc="['歌手 id, 可在歌手详情页 URL 中找到']" radar="1" />

### 电台节目

Expand Down
12 changes: 6 additions & 6 deletions docs/social-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,13 @@ Instagram Stories 没有可靠的 guid,你的 RSS 阅读器可能将同一条

<Route author="EYHN" example="/pixiv/ranking/week" path="/pixiv/ranking/:mode/:date?" :paramsDesc="['排行榜类型' ,'日期, 取值形如 `2018-4-25`']" radar="1" rssbud="1">

| pixiv 日排行 | pixiv 周排行 | pixiv 月排行 | pixiv 受男性欢迎排行 | pixiv 受女性欢迎排行 | AI 生成作品排行榜 | pixiv 原创作品排行 | pixiv 新人排行 |
| --------- | --------- | --------- | ------------- | ------------- | ---------- | ------------- | ----------- |
| day | week | month | day_male | day_female | day_ai | week_original | week_rookie |
| 日排行 | 周排行 | 月排行 | 受男性欢迎排行 | 受女性欢迎排行 | AI 生成作品排行榜 | 原创作品排行 | 新人排行 |
| --- | ---- | ----- | -------- | ---------- | ---------- | ------------- | ----------- |
| day | week | month | day_male | day_female | day_ai | week_original | week_rookie |

| pixiv R-18 日排行 | pixiv R-18 受男性欢迎排行 | pixiv R-18 受女性欢迎排行 | pixiv R-18 周排行 | pixiv R-18G 排行 |
| -------------- | ------------------ | ------------------ | -------------- | -------------- |
| day_r18 | day_male_r18 | day_female_r18 | week_r18 | week_r18g |
| pixiv R-18 日排行 | R-18 AI 生成作品排行 | R-18 受男性欢迎排行 | R-18 受女性欢迎排行 | R-18 周排行 | R-18G 排行 |
| -------------- | -------------- | ------------ | -------------- | -------- | --------- |
| day_r18 | day_r18_ai | day_male_r18 | day_female_r18 | week_r18 | week_r18g |

</Route>

Expand Down
1 change: 1 addition & 0 deletions lib/v2/163/maintainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
'/dy2/:id': ['mjysci'],

'/music/artist/:id': ['metowolf'],
'/music/artist/songs/:id': ['ZhongMingKun'],
'/music/djradio/:id': ['magic-akari'],
'/music/playlist/:id': ['DIYgod'],
'/music/user/events/:id': ['Master-Hash'],
Expand Down
39 changes: 39 additions & 0 deletions lib/v2/163/music/artist-songs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const got = require('@/utils/got');
const { art } = require('@/utils/render');
const path = require('path');

module.exports = async (ctx) => {
const { id } = ctx.params;

const { data } = await got(`https://music.163.com/api/v1/artist/songs`, {
headers: {
Referer: 'https://music.163.com/',
},
searchParams: {
id,
private_cloud: 'true',
work_type: 1,
order: 'time',
offset: 0,
limit: 100,
},
});

const artist = data.songs.find(({ ar }) => ar[0].id === parseInt(id)).ar[0];
const items = data.songs.map((song) => ({
title: `${song.name} - ${song.ar.map(({ name }) => name).join(' / ')}`,
description: art(path.join(__dirname, '../templates/music/playlist.art'), {
singer: song.ar.map(({ name }) => name).join(' / '),
album: song.al.name,
picUrl: song.al.picUrl,
}),
link: `https://music.163.com/#/song?id=${song.id}`,
}));

ctx.state.data = {
title: `${artist.name} - 歌手歌曲`,
link: `https://music.163.com/#/artist?id=${id}`,
description: `网易云音乐 - 歌手歌曲 - ${artist.name}`,
item: items,
};
};
17 changes: 13 additions & 4 deletions lib/v2/163/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ module.exports = {
return id ? `/163/music/artist/${id}` : '';
},
},
{
title: '云音乐 - 歌手歌曲',
docs: 'https://docs.rsshub.app/multimedia.html#wang-yi-yun-yin-yue',
source: '/',
target: (_params, url) => {
const id = new URL(url).hash.match(/artist\?id=(.*)/)[1];
return id ? `/163/music/artist/songs/${id}` : '';
},
},
{
title: '云音乐 - 电台节目',
docs: 'https://docs.rsshub.app/multimedia.html#wang-yi-yun-yin-yue',
Expand Down Expand Up @@ -117,7 +126,7 @@ module.exports = {
title: '云音乐 - 用户歌单',
docs: 'https://docs.rsshub.app/multimedia.html#wang-yi-yun-yin-yue',
source: '/m/user',
target: (params, url) => `/163/music/playlist/${new URL(url).searchParams.get('id')}`,
target: (params, url) => `/163/music/user/playlist/${new URL(url).searchParams.get('id')}`,
},
{
title: '云音乐 - 歌单歌曲',
Expand All @@ -129,13 +138,13 @@ module.exports = {
title: '云音乐 - 歌手专辑',
docs: 'https://docs.rsshub.app/multimedia.html#wang-yi-yun-yin-yue',
source: '/m/album',
target: (params, url) => `/163/music/playlist/${new URL(url).searchParams.get('id')}`,
target: (params, url) => `/163/music/artist/${new URL(url).searchParams.get('id')}`,
},
{
title: '云音乐 - 播单声音',
title: '云音乐 - 电台节目',
docs: 'https://docs.rsshub.app/multimedia.html#wang-yi-yun-yin-yue',
source: ['/m/radio', '/m/djradio'],
target: (params, url) => `/163/music/playlist/${new URL(url).searchParams.get('id')}`,
target: (params, url) => `/163/music/djradio/${new URL(url).searchParams.get('id')}`,
},
{
title: '用户动态',
Expand Down
1 change: 1 addition & 0 deletions lib/v2/163/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = function (router) {
router.get('/dy2/:id', require('./dy2'));

router.get('/music/artist/:id', require('./music/artist'));
router.get('/music/artist/songs/:id', require('./music/artist-songs'));
router.get('/music/djradio/:id', require('./music/djradio'));
router.get('/music/playlist/:id', require('./music/playlist'));
router.get('/music/user/events/:id', require('./music/userevents'));
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/163/templates/music/playlist.art
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
歌手:{{ singer }}<br>
专辑:{{ album }}<br>
发行日期:{{ date }}<br>
{{ if date }}发行日期:{{ date }}<br>{{ /if }}
<img src="{{ picUrl }}">
4 changes: 2 additions & 2 deletions lib/v2/crossbell/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
title: 'Notes',
docs: 'https://docs.rsshub.app/social-media.html#crossbell',
source: '/*',
target: '/notes',
target: '/crossbell/notes',
},
],
},
Expand All @@ -17,7 +17,7 @@ module.exports = {
title: 'Notes',
docs: 'https://docs.rsshub.app/social-media.html#crossbell',
source: '/*',
target: '/notes/source/xlog',
target: '/crossbell/notes/source/xlog',
},
],
},
Expand Down
8 changes: 4 additions & 4 deletions lib/v2/dcfever/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
title: '新聞中心',
docs: 'https://docs.rsshub.app/new-media.html#dcfever',
source: ['/news/index.php', '/'],
params: (_, url) => {
target: (_, url) => {
const searchParams = new URL(url).searchParams;
return `/dcfever/news${searchParams.has('type') ? `/${new URL(url).searchParams.get('type')}` : ''}`;
},
Expand All @@ -15,19 +15,19 @@ module.exports = {
title: '測試報告',
docs: 'https://docs.rsshub.app/new-media.html#dcfever',
source: ['/:type/reviews.php'],
params: '/dcfever/reviews/:type',
target: '/dcfever/reviews/:type',
},
{
title: '二手市集',
docs: 'https://docs.rsshub.app/new-media.html#dcfever',
source: ['/trading/listing.php'],
params: (_, url) => `/dcfever/trading/${new URL(url).searchParams.get('id')}`,
target: (_, url) => `/dcfever/trading/${new URL(url).searchParams.get('id')}`,
},
{
title: '二手市集 - 物品搜尋',
docs: 'https://docs.rsshub.app/new-media.html#dcfever',
source: ['/trading/search.php'],
params: (_, url) => {
target: (_, url) => {
const searchParams = new URL(url).searchParams;
return `/dcfever/trading/search/${searchParams.get('keyword')}${searchParams.has('main_cat') ? `/${searchParams.get('main_cat')}` : ''}`;
},
Expand Down
4 changes: 2 additions & 2 deletions lib/v2/fffdm/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fffdm = {
module.exports = {
'fffdm.com': {
_name: '风之动漫',
manhua: fffdm,
www: fffdm,
manhua: [fffdm],
www: [fffdm],
},
};
2 changes: 1 addition & 1 deletion lib/v2/pixiv/api/getRanking.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const maskHeader = require('../constants').maskHeader;
const assert = require('assert');
const queryString = require('query-string');

const allowMode = ['day', 'week', 'month', 'day_male', 'day_female', 'day_ai', 'week_original', 'week_rookie', 'day_r18', 'day_male_r18', 'day_female_r18', 'week_r18', 'week_r18g'];
const allowMode = ['day', 'week', 'month', 'day_male', 'day_female', 'day_ai', 'week_original', 'week_rookie', 'day_r18', 'day_r18_ai', 'day_male_r18', 'day_female_r18', 'week_r18', 'week_r18g'];

/**
* 获取某天的排行榜
Expand Down
3 changes: 3 additions & 0 deletions lib/v2/pixiv/ranking.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const titles = {
week_original: 'pixiv 原创作品排行',
week_rookie: 'pixiv 新人排行',
day_r18: 'pixiv R-18 日排行',
day_r18_ai: 'pixiv R-18 AI生成作品排行',
day_male_r18: 'pixiv R-18 受男性欢迎排行',
day_female_r18: 'pixiv R-18 受女性欢迎排行',
week_r18: 'pixiv R-18 周排行',
Expand All @@ -30,6 +31,7 @@ const links = {
week_original: 'https://www.pixiv.net/ranking.php?mode=original',
week_rookie: 'https://www.pixiv.net/ranking.php?mode=rookie',
day_r18: 'https://www.pixiv.net/ranking.php?mode=daily_r18',
day_r18_ai: 'https://www.pixiv.net/ranking.php?mode=daily_r18_ai',
day_male_r18: 'https://www.pixiv.net/ranking.php?mode=male_r18',
day_female_r18: 'https://www.pixiv.net/ranking.php?mode=female_r18',
week_r18: 'https://www.pixiv.net/ranking.php?mode=weekly_r18',
Expand All @@ -46,6 +48,7 @@ const alias = {
original: 'week_original',
rookie: 'week_rookie',
daily_r18: 'day_r18',
daily_r18_ai: 'day_r18_ai',
male_r18: 'day_male_r18',
female_r18: 'day_female_r18',
weekly_r18: 'week_r18',
Expand Down