mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-04 08:38:41 +08:00
- Switch AllPageSearchPageFetcher from m.douban.com/rexxar/api/v2/search (returns 403 need_login) to www.douban.com/j/search (works with cookies) - Update AllFirstPageSearchResultPageParser and OtherAllPageSearchResultPageParser to use SearchParserHandler.parseSearchJson() matching the j/search response format, replacing the old Rexxar-specific SearchParserHandlerV2 parsing logic - Add await this.userComponent.login() in onload() so login state is initialized on startup, fixing false isLogin()=false causing "need login for next page" errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
759 B
TypeScript
20 lines
759 B
TypeScript
import {SupportType} from "../../../../constant/Constsant";
|
|
import {SearchResultPageParserInterface} from "./SearchResultPageParserInterface";
|
|
import {log} from "../../../../utils/Logutil";
|
|
import {SearchPage} from "../../model/SearchPage";
|
|
import SearchParserHandler from "../SearchParser";
|
|
|
|
export class OtherAllPageSearchResultPageParser implements SearchResultPageParserInterface {
|
|
support(type:SupportType, pageNum:number):boolean {
|
|
return pageNum > 1 && type == SupportType.all;
|
|
}
|
|
parse(source:string, type:SupportType, pageNum:number, pageSize:number):SearchPage {
|
|
log.debug("解析给多页面结果");
|
|
if (!source) {
|
|
return new SearchPage(0, 0, 0, type, []);
|
|
}
|
|
return SearchParserHandler.parseSearchJson(source, type, pageNum);
|
|
}
|
|
|
|
}
|