loki-afro / metalarchives Goto Github PK
View Code? Open in Web Editor NEWUnofficial Encyclopedia Metallum API
License: Other
Unofficial Encyclopedia Metallum API
License: Other
Daily Travis builds, why? because our tests depend on http://www.metal-archives.com/ e.g. they are all integration tests
there seems to be a change on metallums side where the members details are categorizes now in trivia and biography, where biography represents the old world essentially
there is currently no way to access the triva of an artist
another example is this one https://www.metal-archives.com/artists/Sami_Albert_Hynninen/1417
where there is only trivia, and data can not be retrieved, however way retrieved before since there is a test for that which is currently failing
@Test
public void byIdTest() throws MetallumException {
Member member = API.getMemberById(1417L);
assertThat(member.getRealName()).isEqualTo("Sami Albert Hynninen");
assertThat(member.getCountry()).isEqualTo(Country.FI);
assertThat(member.getGender()).isEqualTo("Male");
assertThat(member.getProvince()).isEqualTo("Lohja, Uusimaa");
assertThat(member.getAge()).isGreaterThanOrEqualTo(44);
assertThat(member.hasPhoto()).isTrue();
assertThat(member.getAlternativeName()).isNull();
assertThat(member.getDetails()).isNotEmpty(); <---
assertThat(member.getLinks()).isNotEmpty();
assertThat(member.getUncategorizedBands()).isEmpty();
assertThat(member.getActiveInBands()).isNotEmpty();
assertThat(member.getPastBands()).isNotEmpty();
assertThat(member.getMiscBands()).isNotEmpty();
assertThat(member.getGuestSessionBands()).isNotEmpty();
}
remove system.err calls and replace them by loggers
publish on maven central
rename groupId and artifactId
Hi, I'm trying out the example code and I faced a SLF4J issue(Failed to load class org.slf4j.impl.StaticLoggerBinder
) which I resolved with their FAQs.
Now that I fixed that error, the console is flooded by [INFO] output([pool-1-thread-1] INFO com.github.loki.afro.metallum.core.util.net.downloader.AbstractDownloader - downloaded Content from [LINK]
).
Is there any method for disabling logging? Thank you
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.
Sorry, it's me again ^^
When I try to query the lyrics e.g. of Metallica, I see the following in my stack trace:
Exception in thread "main" java.lang.IllegalStateException: could not find split band from previously parsed disc with id 379007
at com.github.loki.afro.metallum.entity.Track.createSplitTrack(Track.java:58)
at com.github.loki.afro.metallum.core.parser.site.helper.disc.DiscSiteTrackParser.parse(DiscSiteTrackParser.java:61)
at com.github.loki.afro.metallum.core.parser.site.DiscSiteParser.parseTracks(DiscSiteParser.java:70)
at com.github.loki.afro.metallum.core.parser.site.DiscSiteParser.parse(DiscSiteParser.java:42)
at com.github.loki.afro.metallum.search.service.advanced.DiscSearchService.lambda$getById$0(DiscSearchService.java:24)
at com.github.loki.afro.metallum.search.AbstractSearchService.getById(AbstractSearchService.java:49)
at com.github.loki.afro.metallum.search.API.getDiscById(API.java:50)
at com.github.loki.afro.metallum.entity.partials.PartialDisc.load(PartialDisc.java:13)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1239)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at com.github.loki.afro.metallum.entity.Band.getDiscs(Band.java:50)
It seems to me that the band did a split at least once which breaks the logic of the getLyrics
method in some place.
Hi, I am trying to test out this library, but when I put it in dependencies tree with Maven, I get this error: Dependency 'com.github.loki-afro:metalarchives-api:1.0.1' not found.
I randomly discovered this framework, awesome work so far!
As I tried to make a track query, the retrieved track data seemed to be wrong.
I don't know whether this is a bug or I'm making a mistake.
There is a jUnit test attached to this issue to show you the problem.
Greetings,
Jonas
Original issue reported on code.google.com by [email protected]
on 10 Apr 2012 at 9:35
Attachments:
When performing a new search it throws a NoSuchFieldError.
I tried adding the next line to my gradle build file but then it gives me Program type already present errors
implementation group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'
02-27 18:02:48.929 20122 20122 D AndroidRuntime: Shutting down VM 02-27 18:02:36.948 19801 19801 E AndroidRuntime: FATAL EXCEPTION: main 02-27 18:02:36.948 19801 19801 E AndroidRuntime: Process: com.example.musiclibrary, PID: 19801 02-27 18:02:36.948 19801 19801 E AndroidRuntime: java.lang.IllegalStateException: Could not execute method for android:onClick 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.view.View.performClick(View.java:6669) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.view.View.performClickInternal(View.java:6638) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.view.View.access$3100(View.java:789) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:26145) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6863) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: ... 11 more 02-27 18:02:36.948 19801 19801 E AndroidRuntime: Caused by: java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/framework.jar!classes3.dex) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at org.apache.http.conn.ssl.SSLConnectionSocketFactory.getSocketFactory(SSLConnectionSocketFactory.java:172) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.getDefaultRegistry(PoolingHttpClientConnectionManager.java:109) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:116) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.github.loki.afro.metallum.core.util.net.downloader.AbstractDownloader.<clinit>(AbstractDownloader.java:31) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.github.loki.afro.metallum.core.util.net.downloader.Downloader.getHTML(Downloader.java:28) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.github.loki.afro.metallum.search.AbstractSearchService.parseSearchResults(AbstractSearchService.java:78) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.github.loki.afro.metallum.search.AbstractSearchService.performSearch(AbstractSearchService.java:61) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.example.musiclibrary.activity_add.getBand(activity_add.java:52) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: at com.example.musiclibrary.activity_add.doSearchAndUpdateResults(activity_add.java:36) 02-27 18:02:36.948 19801 19801 E AndroidRuntime: ... 13 more 02-27 18:02:48.931 20122 20122 E AndroidRuntime: FATAL EXCEPTION: main 02-27 18:02:48.931 20122 20122 E AndroidRuntime: Process: com.example.musiclibrary, PID: 20122 02-27 18:02:48.931 20122 20122 E AndroidRuntime: java.lang.IllegalStateException: Could not execute method for android:onClick 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.view.View.performClick(View.java:6669) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.view.View.performClickInternal(View.java:6638) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.view.View.access$3100(View.java:789) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:26145) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6863) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: ... 11 more 02-27 18:02:48.931 20122 20122 E AndroidRuntime: Caused by: java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/framework.jar!classes3.dex) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at org.apache.http.conn.ssl.SSLConnectionSocketFactory.getSocketFactory(SSLConnectionSocketFactory.java:172) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.getDefaultRegistry(PoolingHttpClientConnectionManager.java:109) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:116) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.github.loki.afro.metallum.core.util.net.downloader.AbstractDownloader.<clinit>(AbstractDownloader.java:31) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.github.loki.afro.metallum.core.util.net.downloader.Downloader.getHTML(Downloader.java:28) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.github.loki.afro.metallum.search.AbstractSearchService.parseSearchResults(AbstractSearchService.java:78) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.github.loki.afro.metallum.search.AbstractSearchService.performSearch(AbstractSearchService.java:61) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.example.musiclibrary.activity_add.getBand(activity_add.java:52) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: at com.example.musiclibrary.activity_add.doSearchAndUpdateResults(activity_add.java:36) 02-27 18:02:48.931 20122 20122 E AndroidRuntime: ... 13 more 02-27 18:02:48.943 20122 20161 D OSTracker: OS Event: crash
Hello there,
When I try to fetch the line-up for a band (Current line-up, Last known line-up, Past line-up or Live line-up) I don't get any results (Size is 0). I tried even well known bands such as Metallica or Iron Maiden. At the same time I get the line-up for albums perfectly fine. Is there something wrong with my get method (I'm using band.getPastLineup(), band.getCurrentLineup(), band.getLiveLineup(), band.getLastKnownLineup() methods) or is generally not available?
Thank you for your time!
Hi, I'm trying out your library and I'm facing the above error with the example code. In particular, here is the line:
Track track = new TrackSearchService(true).getFully(query).get(0);
When calling getLyrics()
on a given track, the result is always null
.
Example:
import com.github.loki.afro.metallum.entity.Band;
import com.github.loki.afro.metallum.entity.Disc;
import com.github.loki.afro.metallum.entity.Track;
import com.github.loki.afro.metallum.search.API;
import com.github.loki.afro.metallum.search.query.entity.BandQuery;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
public class Main {
public static void main(String[] args) {
for (final Band band : API.getBandsFully(BandQuery.byName("Mastodon", true))) {
List<Track> tracks = band.getDiscs().stream().map(Disc::getTrackList).flatMap(Collection::stream).collect(Collectors.toList());
List<String> lyrics = tracks.stream().map(Track::getLyrics).collect(Collectors.toList());
System.out.println(lyrics);
}
}
}
// result:
// [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
I've tried this with several bands in Java as well as in Scala.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.