rizxyu / applemusic-core

Downloading Music from Apple musuc
MIT License
2 stars 0 forks source link

Suggestion: Search Links #2

Closed MaitreGEEK closed 7 months ago

MaitreGEEK commented 7 months ago

Hey, could it be possible to search for link without downloading it ?

I mean doing a download method on a URL that only return the title and artist informations and not the buffer.

Thanks !

rizxyu commented 7 months ago

Hello MaitreGEEK

You can see the docs listed in readme.md You can use the search function to get information on several tracks and albums

Here

Sorry if my english bad i used google translate

MaitreGEEK commented 7 months ago

I know, the problem is that if you search from URL as a query you don't get informations on the title. And if I use the download functions with the URL I have the informations I need but I get the buffer with it and it makes my request bigger for only getting the title or the songs of a playlist or track.

MaitreGEEK commented 7 months ago

I suggest that :

async function searchUrl(url) {
  const {
    data: _data
  } = await axios.get(`https://api.fabdl.com/apple-music/get?url=${encodeURIComponent(url)}`)
  if(_data.error) throw _data.error

  const {
    result: {
      gid,
      artists,
      image,
      name: title,
    }
  } = _data
  return _data
rizxyu commented 7 months ago

OK, thanks for the suggestion. We will add it as soon as possible or you can do a pull request

MaitreGEEK commented 7 months ago

No problem you can add it. Thanks for your research on the api of apple music. May I ask you something, is the fabdl API working with others sources and how did you find the processus for apple music ?

rizxyu commented 7 months ago

I don't know if the fabdl API can be used for other sources. And We did an inspect on several Apple Music song downloaders

rizxyu commented 7 months ago

Thank you for your suggestion, we have updated the module, you can install it using

$ npm i github:rizxyu/applemusic-core

Example use:

const { getInfo } = require("applemusic-core") /* To get only metadata "getInfo"*/

async function metadata(url) {
const result = await getInfo(url)
return result
}
metadata("https://example.com/)