Kylart / MalScraper

Scrape everything you can from MyAnimeList.net
MIT License
177 stars 49 forks source link

Lack of information when searching for a manga #48

Closed ilxlodev closed 3 years ago

ilxlodev commented 3 years ago

Hello:

I really have no idea if there is a template for bug reporting. My apologies.


The problem in question is searching for information from a manga using the search.seach() method.

Example of my code:

const malScraper = require('mal-scraper')

malScraper.getInfoFromURL("https://myanimelist.net/manga/21479/Sword_Art_Online").catch(err => undefined).then((data) => {
  console.log(data)
})

The expected answer is the result with all the information of the manga in question.

The result I receive:

{
  title: '',
  synopsis: '',
  picture: undefined,
  characters: [
    {
      link: 'https://myanimelist.net/character/36765/Kazuto_Kirigaya',
      picture: 'https://cdn.myanimelist.net/images/characters/7/204821.jpg',
      name: 'Kirigaya, Kazuto',
      role: 'Main',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/36828/Asuna_Yuuki',
      picture: 'https://cdn.myanimelist.net/images/characters/15/262053.jpg',
      name: 'Yuuki, Asuna',
      role: 'Main',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/55147/Shino_Asada',
      picture: 'https://cdn.myanimelist.net/images/characters/10/235939.jpg',
      name: 'Asada, Shino',
      role: 'Main',
      seiyuu: [Object]
    },      role: 'Main',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/75450/Alice_Zuberg',
      picture: 'https://cdn.myanimelist.net/images/characters/7/348874.jpg',
      name: 'Zuberg, Alice',
      role: 'Main',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/36831/Suguha_Kirigaya',
      picture: 'https://cdn.myanimelist.net/images/characters/9/192515.jpg',
      name: 'Kirigaya, Suguha',
      role: 'Main',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/64523/Yuuki_Konno',
      picture: 'https://cdn.myanimelist.net/images/characters/4/278171.jpg',
      name: 'Konno, Yuuki',
      role: 'Supporting',
      seiyuu: [Object]
    },{
      link: 'https://myanimelist.net/character/43892/Yui',
      picture: 'https://cdn.myanimelist.net/images/characters/15/264165.jpg',
      name: 'Yui',
      role: 'Supporting',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/106217/Bercouli_Synthesis_One',
      picture: 'https://cdn.myanimelist.net/images/characters/6/245565.jpg',
      name: 'Bercouli Synthesis One',
      role: 'Supporting',
      seiyuu: [Object]
    },
    {
      link: 'https://myanimelist.net/character/103297/Tiese_Shtolienen',
      picture: 'https://cdn.myanimelist.net/images/characters/10/239851.jpg',
      name: 'Shtolienen, Tiese',
      role: 'Supporting',
      seiyuu: [Object]
    }
  ],
  staff: [
    {
      link: 'https://myanimelist.net/character/36765/Kazuto_Kirigaya',
      picture: 'https://cdn.myanimelist.net/images/characters/7/204821.jpg',
      name: 'Kirigaya, Kazuto',
      role: 'Main'
    },{
      link: 'https://myanimelist.net/character/36828/Asuna_Yuuki',
      picture: 'https://cdn.myanimelist.net/images/characters/15/262053.jpg',
      name: 'Yuuki, Asuna',
      role: 'Main'
    },
    {
      link: 'https://myanimelist.net/character/55147/Shino_Asada',
      picture: 'https://cdn.myanimelist.net/images/characters/10/235939.jpg',
      name: 'Asada, Shino',
      role: 'Main'
    },
    {
      link: 'https://myanimelist.net/character/70899/Eugeo',
      picture: 'https://cdn.myanimelist.net/images/characters/4/367313.jpg',
      name: 'Eugeo',
      role: 'Main'
    },
    {  link: 'https://myanimelist.net/character/75450/Alice_Zuberg',
      picture: 'https://cdn.myanimelist.net/images/characters/7/348874.jpg',
      name: 'Zuberg, Alice',
      role: 'Main'
    },
    {
      link: 'https://myanimelist.net/character/36831/Suguha_Kirigaya',
      picture: 'https://cdn.myanimelist.net/images/characters/9/192515.jpg',
      name: 'Kirigaya, Suguha',
      role: 'Main'
    },
    {
      link: 'https://myanimelist.net/character/64523/Yuuki_Konno',
      picture: 'https://cdn.myanimelist.net/images/characters/4/278171.jpg',
      name: 'Konno, Yuuki',
      role: 'Supporting'
    },
    {
      link: 'https://myanimelist.net/character/43892/Yui',
      picture: 'https://cdn.myanimelist.net/images/characters/15/264165.jpg',
      name: 'Yui',
      role: 'Supporting'
    },
    {
      link: 'https://myanimelist.net/character/106217/Bercouli_Synthesis_One',
      picture: 'https://cdn.myanimelist.net/images/characters/6/245565.jpg',
      name: 'Bercouli Synthesis One',
      role: 'Supporting'
    },{
      link: 'https://myanimelist.net/character/106217/Bercouli_Synthesis_One',
      picture: 'https://cdn.myanimelist.net/images/characters/6/245565.jpg',
      name: 'Bercouli Synthesis One',
      role: 'Supporting'
    },
    {
      link: 'https://myanimelist.net/character/103297/Tiese_Shtolienen',
      picture: 'https://cdn.myanimelist.net/images/characters/10/239851.jpg',
      name: 'Shtolienen, Tiese',
      role: 'Supporting'
    }
  ],
  trailer: undefined,
  englishTitle: 'Sword Art Online',
  japaneseTitle: 'ソードアート・オンライン',
  synonyms: 'S.A.O, SAO',
  type: 'Novel',
  episodes: '',
  status: 'Publishing',
  aired: '',
  premiered: '',
  broadcast: '',
  producers: [ '' ],
  studios: [ '' ],
  source: '#490Popularity #168Members 47,694NovelBUNBUN (Art), Kawahara, Reki (Story)',
  genres: [ 'Action', 'Adventure', 'Fantasy', 'Game', 'Romance', 'Sci-Fi' ],
  duration: '',
  rating: '',
  score: '8.11',
  scoreStats: 'scored by 18,566 users',
  ranked: "#4902  2 based on the top manga page. Please note that 'R18+' titles are excluded",
  popularity: '#168',
  members: '47,694',
  favorites: '3,353',
  id: 21479
}

You can also see an error in the data shown, for example, the staff in charge of the study are the characters in the story themselves. I have checked if it happens in other sleeves and indeed the error persists.

mal-scraper: v2.9.0 nodejs: v12.16.2 npm: v6.14.4

Kylart commented 3 years ago

Hello,

I think this might happen on every manga / LN links.

You might have a better chance with pre 2.8.0 versions. It might be better for manga type lins with version 2.7.2.

I'm sorry but I won't be able to work on this for the next couple of days since I'm on holidays rn and I don't have a really good internet connection.

I'll be back with more news when I get home!

JustalK commented 3 years ago

I added the fix and the exact case inside the tests.

Kylart commented 3 years ago

Annnd everything is deployed in v2.10.0!

Thanks again @JustalK!