bangumi / server

The next-generation api backend server for bgm.tv
https://bangumi.github.io/api/
GNU Affero General Public License v3.0
590 stars 61 forks source link

MAL Sync integration #6

Open liurui39660 opened 2 years ago

liurui39660 commented 2 years ago

I'm requesting MAL Sync to add support for Bangumi but they need the following APIs to be implemented. Detailed discussions can be found at MALSync/MALSync#792.

lolamtisch commented on Jul 9

This should prety much be all informations needed per api call.

Single Entry
    internalId: any
    malId: number
    type: 'anime' | 'manga'
    url: string
    userStatus: 'watching' | 'pantowatch' | 'completed' ....
    userScore: any
    userWatchedEpisode / chapter: number
    userWatchedVolumens: number
    totalEpisodes: number
    totalVolumes: number
    image: string
    globalScore: any

// possible to filter by userState 
list[]
    internalId: any
    malId: number
    type: 'anime' | 'manga'
    title: string
    url: string
    totalEp: number
    userWatchedEpisode / chapter: number
    userStatus: 'watching' | 'pantowatch' | 'completed' ....
    userScore: any
    image: string

Search[]
    id: number;
    name: string;
    altNames: string[];
    url: string;
    image: string;

Overview metadata:
   Just metadata not important
trim21 commented 2 years ago

能不能重新描述一下需要那些数据

比如这个 malIduserState

liurui39660 commented 2 years ago

malId是作品在MAL上的ID,如无职转生S02,https://myanimelist.net/anime/45576/Mushoku_Tensei__Isekai_Ittara_Honki_Dasu_Part_2,网址中的45576即是作品的MAL ID。

userState是用户的观看状态,对应即Bangumi的“想看”,“在看”,“看过”,“搁置“,“抛弃”。

trim21 commented 2 years ago

malId是作品在MAL上的ID,如无职转生S02,https://myanimelist.net/anime/45576/Mushoku_Tensei__Isekai_Ittara_Honki_Dasu_Part_2,网址中的`45576`即是作品的MAL ID。

userState是用户的观看状态,对应即Bangumi的“想看”,“在看”,“看过”,“搁置“,“抛弃”。

就是subject_id? 还是说值是subject_id, key是malId

liurui39660 commented 2 years ago

依然用无职转生S02为例,API可以是这样。

{
    "internalId": 325585,
    "malId": 45576,
    ...
}

因为 https://bgm.tv/subject/325585https://myanimelist.net/anime/45576/Mushoku_Tensei__Isekai_Ittara_Honki_Dasu_Part_2

具体的需要找MAL Sync开发组确认,我并不是开发组成员。

trim21 commented 2 years ago

目前看来未必能实现,需要有维基人填写对应的mal id。

trim21 commented 2 years ago

比如你举例的无职转生就没有维基人填这个,在服务端也没法实现这样的功能。

liurui39660 commented 2 years ago

利用MAL或AniList的搜索API配合作品日文名可以部分解决,在我之前的小规模测试中可以达到95%的准确度。