笨蛋ovo

笨蛋ovo

About the self-built Meting API of this site

image.png

API Address#

https://api.obdo.cc/meting

Parameter Description
server: Data source
     netease Netease Cloud Music (default)
     tencent QQ Music

Note: Due to the server being located outside of mainland China, the availability of QQ Music parsing is not guaranteed.
Supports parsing Netease Cloud Music VIP songs.

type: Type
     name Song name
     artist Artist
     url Link
     pic Cover
     lrc Lyrics
     song Single
     playlist Playlist

id: Type ID (Cover ID/Single ID/Playlist ID)

For users of the Handsome theme, please use the following interface: https://api.obdo.cc/meting/handsome.php
You can fill in the following items in the advanced settings for the Handsome theme developer to use this interface.

{
    "music_api":"https://api.obdo.cc/meting/handsome.php?server=:server&type=:type&id=:id"
}

Pitfall#

Took some time to adapt the Meting API to the Typecho-Handsome theme, it wasn't difficult, but there are some differences compared to the regular Meting API.
Response Comparison

From the comparison in the above image, it can be seen that the cover image used in the Handsome theme interface response is cover instead of the pic parameter.
Of course, this is easy to solve, but after solving it, there is a high probability of encountering a bunch of errors that cannot parse JSON in the console.
(Forgot to take a screenshot, pretend there is an error screenshot here)
So how did this happen? Let's take a look at the source code of the Handsome theme's Meting API.
/usr/plugins/Handsome/action/MetingAction.php
Wait, Content-Type: application/javascript?
Isn't the output of this thing JSON?
Response Comparison
So the reason for the error is that the returned request header is application/json instead of application/javascript.
It's very frustrating, but I'm too lazy to figure out why changing the header makes it unable to parse.
Anyway, changing the API response header to application/javascript makes it work normally.
After Modification

This article is synchronized and updated to xLog by Mix Space.
The original link is https://blog.baka.plus/posts/tech/about-our-self-built-meting-api


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.