mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-04 16:48:44 +08:00
fix game/book/movie import error
This commit is contained in:
parent
01276030ca
commit
58ced6cd1f
@ -73,7 +73,7 @@ export default class DoubanBookLoadHandler extends DoubanAbstractLoadHandler<Dou
|
|||||||
const image = html(html("head > meta[property= 'og:image']").get(0)).attr("content");
|
const image = html(html("head > meta[property= 'og:image']").get(0)).attr("content");
|
||||||
let item = html(html("head > script[type='application/ld+json']").get(0)).text();
|
let item = html(html("head > script[type='application/ld+json']").get(0)).text();
|
||||||
item = super.html_decode(item);
|
item = super.html_decode(item);
|
||||||
const obj = JSON.parse(item.replace(/[\r\n\s+]/g, ''));
|
const obj = JSON.parse(item.replace(/[\r\n\t\s+]/g, ''));
|
||||||
const title = obj.name;
|
const title = obj.name;
|
||||||
const url = obj.url;
|
const url = obj.url;
|
||||||
const author = obj.author.map((a: any) => a.name);
|
const author = obj.author.map((a: any) => a.name);
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler<Dou
|
|||||||
let idP = idPattern.exec(idContent);
|
let idP = idPattern.exec(idContent);
|
||||||
let id = idP ? idP[0] : "";
|
let id = idP ? idP[0] : "";
|
||||||
let score = html(html("#interest_sectl > div > div.rating_self.clearfix > strong[property= 'v:average']").get(0)).text();
|
let score = html(html("#interest_sectl > div > div.rating_self.clearfix > strong[property= 'v:average']").get(0)).text();
|
||||||
let detailDom = html(html("dl.game-attr").get(0));
|
let detailDom = html(html("dl.thing-attr").get(0));
|
||||||
let dt = detailDom.find("dt");
|
let dt = detailDom.find("dt");
|
||||||
let image = html(html("#content > div > div.article > div.mod.item-subject > div.item-subject-info > div > a > img").get(0)).attr("src");
|
let image = html(html("#content > div > div.article > div.mod.item-subject > div.item-subject-info > div > a > img").get(0)).attr("src");
|
||||||
let desc = html(html("#link-report > p").get(0)).text();
|
let desc = html(html("#link-report > p").get(0)).text();
|
||||||
|
|||||||
@ -100,7 +100,7 @@ export default class DoubanMovieLoadHandler extends DoubanAbstractLoadHandler<Do
|
|||||||
.map(i => {
|
.map(i => {
|
||||||
let item = html(i).text();
|
let item = html(i).text();
|
||||||
item = super.html_decode(item);
|
item = super.html_decode(item);
|
||||||
const obj = JSON.parse(item.replace(/[\r\n]+/g, ''));
|
const obj = JSON.parse(item.replace(/[\r\n\t]+/g, ''));
|
||||||
const idPattern = /(\d){5,10}/g;
|
const idPattern = /(\d){5,10}/g;
|
||||||
const id = idPattern.exec(obj.url);
|
const id = idPattern.exec(obj.url);
|
||||||
const name = obj.name;
|
const name = obj.name;
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export class DoubanTeleplayLoadHandler extends DoubanAbstractLoadHandler<DoubanT
|
|||||||
.map(i => {
|
.map(i => {
|
||||||
let item = html(i).text();
|
let item = html(i).text();
|
||||||
item = super.html_decode(item);
|
item = super.html_decode(item);
|
||||||
const obj = JSON.parse(item.replace(/[\r\n]+/g, ''));
|
const obj = JSON.parse(item.replace(/[\r\n\t]+/g, ''));
|
||||||
const idPattern = /(\d){5,10}/g;
|
const idPattern = /(\d){5,10}/g;
|
||||||
const id = idPattern.exec(obj.url);
|
const id = idPattern.exec(obj.url);
|
||||||
const name = obj.name;
|
const name = obj.name;
|
||||||
|
|||||||
@ -281,7 +281,7 @@ PS: This file could be delete if you want to.
|
|||||||
'140203': `[OB-Douban]: request '{0}'`,
|
'140203': `[OB-Douban]: request '{0}'`,
|
||||||
'140204': `[OB-Douban]: replace '{0}'`,
|
'140204': `[OB-Douban]: replace '{0}'`,
|
||||||
'140205': `[OB-Douban]: complete '{0}'`,
|
'140205': `[OB-Douban]: complete '{0}'`,
|
||||||
'140206': `[OB-Douban]: occur error '{0}'`,
|
'140206': `[OB-Douban]: occur error, please try login'{0}'`,
|
||||||
'140207': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140207': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
|
|
||||||
|
|||||||
@ -279,7 +279,7 @@ export default {
|
|||||||
'140203': `[OB-Douban]: 请求豆瓣'{0}'...`,
|
'140203': `[OB-Douban]: 请求豆瓣'{0}'...`,
|
||||||
'140204': `[OB-Douban]: 替换文本'{0}'...`,
|
'140204': `[OB-Douban]: 替换文本'{0}'...`,
|
||||||
'140205': `[OB-Douban]: 处理完成'{0}'`,
|
'140205': `[OB-Douban]: 处理完成'{0}'`,
|
||||||
'140206': `[OB-Douban]: 出现错误'{0}'`,
|
'140206': `[OB-Douban]: 出现错误,请尝试重新登录.错误原因:'{0}'`,
|
||||||
'140207': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140207': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user