darthbatman / billboard-top-100

:chart_with_upwards_trend: Node.js API to retrieve the top songs, albums, and artists from Billboard's charts
MIT License
97 stars 30 forks source link

Templating the current date into the date parameter gives chart not found #43

Closed KareemH closed 2 years ago

KareemH commented 4 years ago

Hey, this is a great web scraper to retrieve billboard music chart metadata. Thanks a lot for this service.

I'm getting an error involving the date parameter of getChart(). I have a for loop that loops through 2001 to 2011 and template the current date using a JavaScript object. I then concatenate that together to satisfy the date format YYYY-MM-DD image image

(you can ignore addSong)

However, I get this error, saying songs not found image

After running my server a few more times, I can get the chart data image

Is there a way to guarantee that getChart() will work all the time? Does getChart() work with await/async?

Thanks for any fixes! :)

VaculikR commented 4 years ago

Hi, I am awaiting getChart() in promise and having a similar problem.

My current workaround is just keep fetching it until I get the results, since I know they are there.

Shouldn't be too surprised with the inconsistency, since it isn't an official api, but yea, I would love a fix as well :-)

Other possibility is you're hitting DDOS protection, just like the issue #41, try logging the error and you will see. I am also getting "Songs not found."

darthbatman commented 2 years ago

Closing due to inactivity.