Skip to content

Commit

Permalink
fix bilibili begin, bangumi-data/bangumi-data#88
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhenye committed Nov 16, 2019
1 parent 1a989a4 commit c77d6b7
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 7 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"node": true
},
"rules": {
"function-paren-newline": ["error", "consistent"],
"guard-for-in": 0,
"no-bitwise": 0,
"no-console": 0,
Expand Down
3 changes: 3 additions & 0 deletions exclusions/iqiyi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ a_19rrgigs5d
a_19rrjzoswl
a_19rrjzp30t
a_19rrjzp3rx
a_19rrhw1ty9
a_19rrh2h7sx
a_19rrhzf1yl
10 changes: 10 additions & 0 deletions exclusions/mgtv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@
329077
330253
330252
332272
332271
157875
328667
328664
328665
328666
328668
45528
328223
14 changes: 14 additions & 0 deletions exclusions/qq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,17 @@ d/d5b0w5rr63j1ns7
3/3o8w0e2mddsn2il
v/vtvrs070tlu8ass
t/t6jtg4yl4jvlzm3
m/mzc00200sj0ngs3
m/mzc002004q2k8fq
i/imhxhwvegjr0mul
m/myz5dwkmpbkduv1
m/mzc00200pbbbbib
m/mzc002005kxibbw
q/qf0vozcumog730b
e/esotkgeubw8ozt2
7/7h5uumfo2g44t39
p/pmy2slpoid6emwj
s/shjsjw95it4o21u
2/2k7h9msgvoebdne
5/5xhh41qsudvuhql
g/geabvtinp3himox
22 changes: 22 additions & 0 deletions exclusions/youku.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,25 @@ f25b1a9c61ad11e0bea1
f25b8e2861ad11e0bea1
aa156d3a03b111e29498
28efbfbdefbfbd2b2def
cedfcdb6aa0047e98507
324feb44b8fe11e0a046
298cf0f20c3b11e1a046
e22327d4b8f911e0a046
c0d6abbab8f811e0a046
45f2dce0b8f611e0a046
f5c1992ab8f311e0a046
cb6fee44b8f111e0a046
0c2dabe0b8ef11e0a046
f92a7f36b83611e0a046
3dd582c6b82c11e0a046
43f5fd688ae711e2b16f
87b1f566c22f11e0a046
387dcd90b83311e0a046
fd93e9c0b8e211e0a046
8c269018b8e111e0a046
3a055e98b8de11e0a046
34f8b402b8db11e0a046
4b155458b8da11e0a046
17993b92b8be11e0a046
e09f1b8ab01511e0a046
f30141ba61ad11e0bea1
1 change: 1 addition & 0 deletions lib/crawlers/bilibili.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports.getBegin = async function getBegin(mediaId) {
const api = `https://bangumi.bilibili.com/view/web_api/media?media_id=${mediaId}`;
const { result } = await fetch(api).then((res) => res.json());
const time = result.episodes
.filter((ep) => !Number.isNaN(Number(ep.index)))
.map((ep) => new Date(`${ep.pub_real_time} +08:00`))
.sort((a, b) => a - b)
.shift();
Expand Down
11 changes: 11 additions & 0 deletions lib/crawlers/dicts/nicovideo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"ID_MAP": {
"ch2642735": "sao-alicization-wou",
"ch2642740": "tokunana",
"ch2642737": "kjganime",
"ch2642732": "ore_ski",
"ch2642731": "hataage-kemonomichi",
"ch2642834": "anitsuke3",
"ch2642734": "pipecat-kabukicho",
"ch2642741": "chubyou",
"ch2642733": "shincho-yusha",
"ch2642739": "afusara",
"ch2642833": "7-taizai-kamigaminogekirin",
"ch2642599": "yugioh_movie",
"ch2642412": "urashimasakatasen",
"ch2642624": "choujin",
Expand Down
2 changes: 1 addition & 1 deletion lib/crawlers/mgtv.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.getAll = async function getAll() {
const href = $(el).find('.u-title').attr('href');
const [, id] = href.match(/\/b\/(\d+)\//);
const img = $(el).find('.u-pic').attr('src');
return { id, title, img };
return { id, title, img, href: `https://www.mgtv.com/h/${id}.html` };
})
.get(),
});
Expand Down
2 changes: 1 addition & 1 deletion lib/crawlers/qq.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.getAll = async function getAll() {
const title = $(el).find('.figure_title a').text();
const href = $(el).find('.figure_title a').attr('href');
const [, id] = href.match(/\/cover\/(\w+)\.html/);
return { id: `${id[0]}/${id}`, title };
return { id: `${id[0]}/${id}`, title, href: `https://v.qq.com/detail/x/${id}.html` };
})
.get()
// fuck you tencent video
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"dependencies": {
"cheerio": "^1.0.0-rc.3",
"fs-extra": "^8.1.0",
"https-proxy-agent": "^2.2.2",
"https-proxy-agent": "^3.0.1",
"klaw": "^3.0.0",
"node-fetch": "^2.6.0",
"ora": "^4.0.2",
"ora": "^4.0.3",
"update-notifier": "^3.0.1",
"yargs": "^14.0.0"
"yargs": "^14.2.0"
},
"devDependencies": {
"eslint": "^6.5.1",
"eslint": "^6.6.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2"
}
Expand Down

0 comments on commit c77d6b7

Please sign in to comment.