Kylart / MalScraper

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

error #1

Closed jm134 closed 6 years ago

jm134 commented 6 years ago

const malScraper = require('mal-scraper') /home/pi/node_modules/mal-scraper/src/info.js:152 .then(async (items) => { ^

SyntaxError: Unexpected token (

Kylart commented 6 years ago

What is your node version?

jm134 commented 6 years ago

node v6.12.0 npm v5.5.1

Kylart commented 6 years ago

Is there no way you can upgrade to node 8 as it is the recommended version for most users?

jm134 commented 6 years ago

so the recommedation for this script is node v8 right?

Kylart commented 6 years ago

It's true I should make it clear in the README and the package.json. I actually didn't expect people with lower versions to use this package 😄

I can make it compatible with lower node version if you need though.

jm134 commented 6 years ago

yeah you shoud add that thanks i will try now

jm134 commented 6 years ago

all is working now but is there any way to get title only from myanimelist or livechart? i want save season title in text file example fall 2017 Mahou Tsukai no Yome Black Clover

Kylart commented 6 years ago

You get livechart info only from getSeason

The rest is from MyAnimeList

jm134 commented 6 years ago

so there is no way to get title only?

Kylart commented 6 years ago

Not from the package.

Though it is really easy to get an array with titles only. For example with getSeason

const malScraper = require('mal-scraper')

malScraper.getSeason(2017, 'fall')
  .then((data) => {
    const titles = data.map((elem) => elem.title)

    console.log(titles)
  })
  .catch((err) => console.log(err.message))
jm134 commented 6 years ago

i have search few hour only to get title from new season got this error data.map is not a function can you create script to get title only?

jm134 commented 6 years ago

new error Request failed with status code 503 cloudflare issue

Kylart commented 6 years ago

Yea sorry, my previous script was a bit off

const malScraper = require('mal-scraper')

malScraper.getSeason(2017, 'fall')
  .then((data) => {
    // Example for TV anime for this season
    const titles = data.TV.map((elem) => elem.title)

    console.log(titles)
  })
  .catch((err) => console.log(err.message))

As for the cloudflare issue, I can't really do anything, livechart seems offline. You should try again later

EDIT: It seems it's on now

jm134 commented 6 years ago

still same due cloudflare btw how to use this https://www.npmjs.com/package/cfget https://github.com/codemanki/cloudscraper Request failed with status code 503

Kylart commented 6 years ago

Weird, I just tried and didn't get any cloudflare issue. Can you even access livechart.me from your browser? If no just wait a bit and try again when you'll be able to access this website.

As for your package, you can't use it with mal-scraper

jm134 commented 6 years ago

from my browser it said wait 5 second due cloudflare hmmm something wrong before this it ok it said checking browser im using your package.json (git clone)

jm134 commented 6 years ago

[Symbol(outHeadersKey)]: [Object] }, data: '<!DOCTYPE HTML>\n\n\n \n \n \n \n \n Just a moment...\n \n\n \n\n\n\n\n

\n \n \n \n \n
\n
\n \n \n \n
\n \n \n \n
\n
\n\n \n
\n DDoS protection by Cloudflare\n
\n Ray ID: 3be9354a5c427086\n
\n
\n\n\n' } }

Kylart commented 6 years ago

So it seems livechart added some security to their website, I'll be solving this as from tonight as I can't do it right now. Hang tight

jm134 commented 6 years ago

ok tqvm sir