md-y/mangadex-full-api

`getFeed()` on a manga item that is rated pornographic returns an empty feed

Closed this issue · 1 comments

i had to go through several mental dilemma to create this issue.

future employers, i am so sorry
i feel awful writing this

using the first result on MD as the example, the call returns Array (0); however when obtaining the first chapter via chapter id
i get a full result:

const MFA = require("mangadex-full-api");

MFA.Manga.get("239a69f9-a43f-4401-82f1-eb5527877f7d").then(async (res) => {
  console.log(await res.getFeed({}, true));
  MFA.Chapter.get("09cb7c28-c52e-4b7b-9c6a-b043ca4e2aab").then(async (res) => {
    console.log(res);
  });
});
 node test2
[] // getFeed call
Chapter { // getChapter call
  id: '09cb7c28-c52e-4b7b-9c6a-b043ca4e2aab',
  volume: '1',
  chapter: '1',
  title: '',
  translatedLanguage: 'en',
  createdAt: 2019-01-03T20:12:50.000Z,
  updatedAt: 2019-01-03T20:12:50.000Z,
  publishAt: 2019-01-03T20:12:50.000Z,
  readableAt: 2019-01-03T20:12:50.000Z,
  pages: 38,
  isExternal: false,
  externalUrl: null,
  groups: [
    Relationship {
      id: '3d738db7-492f-4dee-933f-eb283b8e7d51',
      type: 'scanlation_group',
      cached: false
    }
  ],
  manga: Relationship {
    id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
    type: 'manga',
    cached: false
  },
  uploader: Relationship {
    id: 'b0bcf030-c00d-4bd4-89a3-8e01dcd350ad',
    type: 'user',
    cached: false
  }
}

is there some kind of anti-booba mechanism at play here in mangadex api that makes the feed disappear on pornographic manga?
the following are the in-app vs. in-mangadex images:

in-app

image

in-md

image

i will now proceed to beat myself up over having to make this issue.

i hate everything.
thank you for this library (once again) :]
md-y commented

This is quite the interesting issue lol

I looked at the way MD's website requests the feed and it adds:
&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic

So I tested using:

MFA.Manga.get("239a69f9-a43f-4401-82f1-eb5527877f7d").then(async (res) => {
   console.log(await res.getFeed({ contentRating: [ 'pornographic'] }, true));
});

And it worked:

Console Log
[
  Chapter {
    id: 'b8488a3d-7305-4ecf-a179-850490f36750',
    volume: '2',
    chapter: '1',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2019-05-02T07:35:50.000Z,
    updatedAt: 2019-05-02T07:35:50.000Z,
    publishAt: 2019-05-02T07:35:50.000Z,
    readableAt: 2019-05-02T07:35:50.000Z,
    pages: 34,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: 'b0bcf030-c00d-4bd4-89a3-8e01dcd350ad',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: '15632b39-bba1-4478-9175-4eba8806c4a4',
    volume: '1',
    chapter: '2',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2019-01-31T12:25:21.000Z,
    updatedAt: 2019-01-31T12:25:21.000Z,
    publishAt: 2019-01-31T12:25:21.000Z,
    readableAt: 2019-01-31T12:25:21.000Z,
    pages: 40,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: 'b0bcf030-c00d-4bd4-89a3-8e01dcd350ad',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: '952df4d6-0ed8-4414-97c7-cd2f93a554af',
    volume: '2',
    chapter: '3',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2019-11-02T10:32:11.000Z,
    updatedAt: 2019-11-02T10:32:11.000Z,
    publishAt: 2019-11-02T10:32:11.000Z,
    readableAt: 2019-11-02T10:32:11.000Z,
    pages: 37,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: '4c8f47b1-0420-4881-b3f3-3be894fd24f8',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: 'da9d5cf2-7d3c-4b4c-ace4-484be617c828',
    volume: '1',
    chapter: '3',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2019-03-23T09:16:39.000Z,
    updatedAt: 2019-03-23T09:16:39.000Z,
    publishAt: 2019-03-23T09:16:39.000Z,
    readableAt: 2019-03-23T09:16:39.000Z,
    pages: 34,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: 'b0bcf030-c00d-4bd4-89a3-8e01dcd350ad',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: '09cb7c28-c52e-4b7b-9c6a-b043ca4e2aab',
    volume: '1',
    chapter: '1',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2019-01-03T20:12:50.000Z,
    updatedAt: 2019-01-03T20:12:50.000Z,
    publishAt: 2019-01-03T20:12:50.000Z,
    readableAt: 2019-01-03T20:12:50.000Z,
    pages: 38,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: 'b0bcf030-c00d-4bd4-89a3-8e01dcd350ad',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: '09d902e1-2ed1-42b0-b267-bfb3b6a88099',
    volume: '1',
    chapter: '4',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2021-02-28T22:59:24.000Z,
    updatedAt: 2021-02-28T22:59:24.000Z,
    publishAt: 2021-02-28T22:59:24.000Z,
    readableAt: 2021-02-28T22:59:24.000Z,
    pages: 16,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: '8cd28921-fa41-4eb3-a1cf-777088e4def7',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: 'a74bd656-2d14-4795-8543-c67d2de680e4',
    volume: '2',
    chapter: '4',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2021-02-28T23:00:29.000Z,
    updatedAt: 2021-02-28T23:00:29.000Z,
    publishAt: 2021-02-28T23:00:29.000Z,
    readableAt: 2021-02-28T23:00:29.000Z,
    pages: 22,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: '8cd28921-fa41-4eb3-a1cf-777088e4def7',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  },
  Chapter {
    id: 'f3fb7f19-480d-424e-a3fb-a0e9832f14f0',
    volume: '2',
    chapter: '2',
    title: '',
    translatedLanguage: 'en',
    createdAt: 2019-09-02T07:00:45.000Z,
    updatedAt: 2019-09-02T07:00:45.000Z,
    publishAt: 2019-09-02T07:00:45.000Z,
    readableAt: 2019-09-02T07:00:45.000Z,
    pages: 37,
    isExternal: false,
    externalUrl: null,
    groups: [ [Relationship] ],
    manga: Relationship {
      id: '239a69f9-a43f-4401-82f1-eb5527877f7d',
      type: 'manga',
      cached: true,
      resolve: [Function (anonymous)]
    },
    uploader: Relationship {
      id: 'b0bcf030-c00d-4bd4-89a3-8e01dcd350ad',
      type: 'user',
      cached: true,
      resolve: [Function (anonymous)]
    }
  }
]

Apparently I missed that they updated the feed parameters so contentRating doesn't appear with Intellisense, but you can still manually add it. I'll update the types for the next version so it appears.