Git Product home page Git Product logo

Comments (11)

SuperKali avatar SuperKali commented on June 15, 2024

The project is discontinued? @jagrosh

from jlyrics.

jagrosh avatar jagrosh commented on June 15, 2024

A-Z Lyrics at some point enabled some measures to prevent scraping. You can test this for yourself by visiting the site, doing a search, and noting the token in the URL. Removing this token and visiting the same page will always return an empty search result.

If you want to seek out a fix for A-Z Lyrics, then be my guest. There may be a way to get a temporary token, since the site doesn't require login.

from jlyrics.

jagrosh avatar jagrosh commented on June 15, 2024

As for the other tests, there isn't enough information to determine why they are failing. Something I plan to change in this project is adding new methods on the client that throw relevant exceptions instead of just returning null.

from jlyrics.

SuperKali avatar SuperKali commented on June 15, 2024

@jagrosh I knew that, unfortunately the token automatically generates itself after a certain amount of time, would you be able to fix this issue or does it take you so much time?

from jlyrics.

jagrosh avatar jagrosh commented on June 15, 2024

It's something I can look into but I don't have a solid timetable for when I'll be able to get to it.

from jlyrics.

SuperKali avatar SuperKali commented on June 15, 2024

I appreciate your help.

from jlyrics.

cantelope avatar cantelope commented on June 15, 2024

I don't know how to compile this, so I can't test this out, but I think I know what A-Z Lyrics is doing. When queried without the token, the response includes a hidden input field named x. The query needs to be resubmitted with this field x.

So the idea is something like this:

The configuration file would need a line something like this to select the value attribute.

tokenselect = "input[name=x][value]"

And the lyricsclient would have something like this?

/* get token selector from configuration file */
String tokenSelector = config.getString("lyrics." + source + ".search.tokenselect");
/* if token selector matches the query result, then extract the token value, and retry the request */
Element token = doc.selectFirst(tokenSelector);
if (token != null) {
  String tokenvalue = token.attr("value");
  connection = Jsoup.connect(searchUrl + "&x=" + tokenValue).userAgent(userAgent).timeout(timeout);
  doc=connection.get();
}

I can think of all sorts of reasons why this isn't going to work, but I hope it helps simplify things a little when you have time to look into this.

from jlyrics.

SuperKali avatar SuperKali commented on June 15, 2024

@cantelope I will test for you

from jlyrics.

SuperKali avatar SuperKali commented on June 15, 2024

@cantelope it cannot be work

from jlyrics.

SuperKali avatar SuperKali commented on June 15, 2024

#12 I tested myself this PR, A-Z Lyrics work correctly, soon I check if genius work too.

from jlyrics.

fmunim avatar fmunim commented on June 15, 2024

@jagrosh Can you please check this? None of the lyrics provider seems to work. Not even currently playing songs.

from jlyrics.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.