microlinkhq / open

4 stars 2 forks source link

Images wrapped in video tags #47

Closed aogaili closed 9 months ago

aogaili commented 9 months ago

Prerequisites

Subject of the issue

API returns images wrapped in a video tag which causes rendering issue

Steps to reproduce

Pass any URL to API and when the

Screen Shot 2023-09-14 at 9 45 32 AM

Expected behaviour

Should return image, not video tag if the source is images.

Actual behaviour

Returning video tags instead of images.

Kikobeats commented 9 months ago

Hello, unfortunately, I can't help if you tell me more details:

In case you want to detect the poster from the video tag, you should use the metascarper-video package.

aogaili commented 9 months ago

I'm using the API directly, I fixed it manually I think in my code, but I was running into issues with Meteor so went back to the API

export const getMetadata = async (url) => {
  const mql = require('@microlink/mql');
  const { status, data } = await mql(url)
  console.log(data)
  return mql.render(data);
};
Kikobeats commented 9 months ago

Glad you fixed 🙂

aogaili commented 9 months ago

@Kikobeats I fixed when I was using the packages myself but not through the API of microlink.

My question, is there an option to fix this when I make the API call? Say disable video for example.

Kikobeats commented 9 months ago

You can create a data rule that overrides the default value obtained or create a new one: https://microlink.io/docs/mql/data/attr

aogaili commented 9 months ago

Can you please share an example for the video tag? I still don't understand why the API is returning a video tag when the source is clearly an image.

On Fri, Sept 15, 2023, 6:11 a.m. Kiko Beats @.***> wrote:

You can create a data rule that overrides the default value obtained or create a new one: https://microlink.io/docs/mql/data/attr

— Reply to this email directly, view it on GitHub https://github.com/microlinkhq/open/issues/47#issuecomment-1721023409, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMZAK63C3AY5CU6I2Q3D4TX2QSWHANCNFSM6AAAAAA4ZNEJ3Y . You are receiving this because you authored the thread.Message ID: @.***>

Kikobeats commented 9 months ago

Sorry can help without knowing this first:

aogaili commented 9 months ago

@Kikobeats my apologize, the issue was with the rendering of the data rather than the data coming from the API. Issue closed.

Kikobeats commented 9 months ago

No worries, thanks for writing back 🙂