Coder Social home page Coder Social logo

hbtalha / genius_lyrics Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 5.0 113 KB

Download song lyrics and metadata from Genius.com

License: MIT License

Dart 100.00%
dart dart-package flutter hacktoberfest hacktoberfest2023 lyrics lyrics-fetcher lyrics-search lyricsgenius music

genius_lyrics's Introduction

const bool tiredOfLearning = false;

๐Ÿ“š Iโ€™m currently learning

  • Web-Development(front/back-end)
  • Android Development (Android Studio - Java)

hbtalha

๐Ÿ“Š Stats

Keiko Activity Graph


Rafa-Ts Rafa-Ts Rafa-Ts Rafa-Ts Rafa-Ts Rafa-Ts Rafa-Ts Rafa-Js Rafa-HTML Rafa-CSS Rafa-CSS

Contact me:

genius_lyrics's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

genius_lyrics's Issues

There are weird words after lyrics

Hi, thanks for the library.

I found out an issue: There are weird words after lyrics such as Embed, 11Embed, 99Embed,...
Is it caused by the HTML parsing process?

Screen Shot 2022-09-29 at 11 36 58
Screen Shot 2022-09-29 at 11 37 29
Screen Shot 2022-09-29 at 11 38 04

test: passing token as environment variable

Since the Genius token is being set in the code, it's easy to unintentionally commit it when contribute to this project, for instance:

  1. I fork this repo
  2. Create a token on Genius
  3. Put the token on example/main.dart and test/genius_lyrics_test.dart
  4. Add my code
  5. Do git add ., git commit -m "message" and git push without thinking ๐Ÿ˜ณ

Instead, we could use:

Genius genius = Genius(
    accessToken: const String.fromEnvironment('GENIUS_TOKEN'),
);

and, for instance, run tests with dart --define=GENIUS_TOKEN=<token> test -c vm:source or flutter test --dart-define=GENIUS_TOKEN=<token>

Error: Connection closed while receiving data

When getting the info for a song, I sometimes get the error Error: Connection closed while receiving data.

I have no idea why it happens, as it looks random to me. Sometimes it happends, sometimes it works well.

I am simply using the following line (with the genius variable correctely initialized) :

final song = await genius.searchSong(artist: artist, title: title);

_TypeError (type '_Map<String, dynamic>' is not a subtype of type 'String')

Artist? artist = await genius.searchArtist(
        artistName: "Nobuo Uematsu", maxSongs: 1);

The only verbose output is: flutter: Searching for songs by Nobuo Uematsu

Causes the following error: _TypeError (type '_Map<String, dynamic>' is not a subtype of type 'String'). So it seems if no data is returned, that raises this error. Searching for"Nobuo Uematsu" on genius.com finds the artist as the top result: https://genius.com/artists/Nobuo-uematsu

Incidentally, I only intend to use the library to get the artists image url artist?.imageUrl - I'm not interested in the songs or any other non-artist related data.

Parsing issues

I noticed two issues in the lyrics:

  • X Contributors or X ContributorsTranslationsEspanolEtcEtc at the very beginning. Try with this song.
  • You might also like in the middle of the lyrics. I saw that you already have some code to remove it, but mine doesn't seem to have the [0-9]+Embed at the end. Try with this song and look right before the outro.

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.