Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MetallumException when calling methods (403 Forbidden -- API not working?) #24

Open
ari-b-19 opened this issue Apr 27, 2024 · 2 comments

Comments

@ari-b-19
Copy link

ari-b-19 commented Apr 27, 2024

When making method calls to the API, I get an exception thrown:

Exception in thread "main" com.github.loki.afro.metallum.MetallumException: java.util.concurrent.ExecutionException: java.io.IOException: com.google.api.client.http.HttpResponseException: 403 Forbidden

GET https://www.metal-archives.com/search/ajax-advanced/searching/bands/?bandName=Dreamshade&exactBandMatch=1&genre&themes&location&bandLabelName&indieLabel=0&sEcho=1&iColumns=3&sColumns&iDisplayStart=0&iDisplayLength=200&sNames=,,

	at com.github.loki.afro.metallum.core.util.net.downloader.Downloader.get(Downloader.java:43)
	at com.github.loki.afro.metallum.core.util.net.downloader.Downloader.getHTML(Downloader.java:29)
	at com.github.loki.afro.metallum.search.AbstractSearchService.query(AbstractSearchService.java:86)
	at com.github.loki.afro.metallum.search.AbstractSearchService.access$000(AbstractSearchService.java:18)
	at com.github.loki.afro.metallum.search.AbstractSearchService$1.computeNext(AbstractSearchService.java:65)
	at com.github.loki.afro.metallum.search.AbstractSearchService$1.computeNext(AbstractSearchService.java:54)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
	at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1949)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:292)
	at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
	at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:298)
	at java.base/java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)

It seems like there were some changes to the website based on an update to the unofficial Android app (Metal Empire) but I don't know if that app uses this API or know HTML parsing well enough to understand what may have changed behind the scenes.

@ari-b-19 ari-b-19 changed the title API down? MetallumException when calling methods (403 Forbidden -- API not working?) Apr 27, 2024
@ari-b-19
Copy link
Author

ari-b-19 commented May 2, 2024

Update: seems to be fine now? maybe just something MA did on the backend

@Loki-Afro
Copy link
Owner

Loki-Afro commented May 10, 2024

@ari-b-19 last time i tried to run the tests cloudflare basically was blocking the 4. request or so, might be the same cause
if you know any mitigation let me know :/

yes you may get things like:

	at com.github.loki.afro.metallum.search.service.MemberSearchServiceTest.byIdTest(MemberSearchServiceTest.java:36)
Caused by: java.io.IOException: 
com.google.api.client.http.HttpResponseException: 429 Too Many Requests
GET https://www.metal-archives.com/artists/*/1417

:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants