Kylart / MalScraper

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

Error search anime with type #28

Closed kaiserdj closed 4 years ago

kaiserdj commented 4 years ago

If I add in the search parameters the key "type", it returns an incorrect result, example:

✔️Correct Code:

var malScraper = require("mal-scraper")
malScraper.search.search("anime", {
                "term": "BanG Dream! 3rd Season"
            }).then((data) => console.log(data[0])).
                catch((err) => err);

Result:

{
  thumbnail: 'https://cdn.myanimelist.net/r/100x140/images/anime/1985/104767.jpg?s=a0e163e0c3ee85136e20d9ed15490b99',
  url: 'https://myanimelist.net/anime/37870/BanG_Dream_3rd_Season',
  video: 'https://myanimelist.net/anime/37870/BanG_Dream_3rd_Season/video',
  shortDescription: 'As the all-girl band Poppin’Party continues to rise in fame, they find a poster for an event at the legendary Nippon Budoukan. Now determined to participate in the "BanG 
Dream," Kasumi Toyama and the...read more.',
  title: 'BanG Dream! 3rd Season',
  type: 'TV',
  nbEps: '13',
  score: '8.09',
  startDate: '01-23-20',
  endDate: '04-23-20',
  members: '13,238',
  rating: 'PG-13'
}

❌ Error Code:

var malScraper = require("mal-scraper")
malScraper.search.search("anime", {
                "term": "BanG Dream! 3rd Season",
                "type": 1
            }).then((data) => console.log(data[0])).
                catch((err) => err);

Result:

{
  thumbnail: 'https://cdn.myanimelist.net/r/100x140/images/anime/4/84177.jpg?s=a7c4462cf6f5458a8b28496a75863876',
  url: 'https://myanimelist.net/anime/25777/Shingeki_no_Kyojin_Season_2',
  video: 'https://myanimelist.net/anime/25777/Shingeki_no_Kyojin_Season_2/video',
  shortDescription: 'For centuries, humanity has been hunted by giant, mysterious predators known as the Titans. Three mighty walls—Wall Maria, Rose, and Sheena—provided peace and protection 
for humanity for over a hundre...read more.',
  title: 'Shingeki no Kyojin Season 2',
  type: 'TV',
  nbEps: '12',
  score: '8.40',
  startDate: '04-01-17',
  endDate: '06-17-17',
  members: '1,082,750',
  rating: 'R'
}
kaiserdj commented 4 years ago

It is not a failure of MalScraper, it is a failure directly from MAL. I have created a post in the support section: https://myanimelist.net/forum/?topicid=1838604

Kylart commented 4 years ago

Closing since this is a MAL failure.