SwagLyrics-For-Spotify

授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发、 正则表达式工具
软件类型 开源软件
地区 不详
投 递 者 阙庆
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

SwagLyricsSwagLyrics-For-Spotify

Discord Server Build Status Build Status PyPI Arch User Repository Downloads

Fetches the currently playing song from Spotify on Windows, Linux and macOS and displays the lyrics in the command-line, browser tab or in a desktop application.Refreshes automatically when song changes. The lyrics are fetched from Genius.Turns out Deezer already has this feature in-built but with swaglyrics, you can have it in Spotify as well.

I'm mainly trying to build this project as far as I can,for practice and to learn and work with more technologies and platforms.

Initially developed this for personal use. Pretty much functionality oriented -- I usually develop something that Ican see helping me and other users in the same situation.Packaged so I can first hand handle production-ready code to an extent and to makedistribution and usage easier.

Why SwagLyrics?

SwagLyrics is the fastest and the most accurate package for getting lyrics.1

Provided optimal internet, SwagLyrics can fetch lyrics for a track in as less as 0.28s.2

It also does not require the user to generate any sort of API token (Spotify or Genius) and serves functionalityright off the bat. This is possible as the song identification is done using our in-house librarySwSpotify which does it locally for all operating systems.

The enhanced user experience is possible due to the backendwhich manages creating issues for unsupported songs and then adding support for them where possible by employing varioustechniques. Any song with lyrics on Genius can be supported without any user interaction owing to the backend.If say, lyrics do not exist for a track then subsequent playings of that track will not waste your resources in tryingto fetch lyrics, this is done by a master list of unsupported songs which ishandled by the backend as well.

1. [results] Tested against LyricsGenius, the most popular similar package on the US Top 50 Chart on Spotify. SwagLyrics was fractionally more accurate and 2.4x times faster.
2. [results] Speed and accuracy benchmark using Google Colab on the Spotify US Top 50 chart.

Installation

Requires Python 3.6+. Use pip or pip3 depending on your installation. You might want to use the --user flag on Linux toavoid using pip as root.

pip install swaglyrics

Arch Linux

Arch Linux users can directly install SwagLyrics from AUR (swaglyricsAUR). Using yay:

yay -S swaglyrics

Nix

Nix users on any Linux distro and NixOS can install SwagLyrics from Nixpkgs.

nix-env -i swaglyrics

Usage

usage: swaglyrics [-h] [-t] [-c] [-n]

Either the tab or cli argument is required to output lyrics.

Arguments:

  -h, --help      show this help message and exit       
  -t, --tab       Display lyrics in a browser tab.      
  -c, --cli       Display lyrics in the command-line.   
  -n, --no-issue  Disable issue-making on cli.

You can quit by pressing Ctrl+C.

Before using, you should check USING.txt to comply with the Genius ToS. There's a copyincluded inside the package as well.

Note: If you have trouble displaying Japanese/Chinese characters on the command-line, simply type chcp 936 to change your code page. List of code pages can be found here: https://en.wikipedia.org/wiki/Code_page

Community

Changelog

  • v1.2.0

    • Add Genius A/B support
    • Add support for Bollywood songs
    • Add update check only once per 24h
    • Add parameter to force update check

See CHANGES.md for prior release notes.

Compiling SwagLyrics for Development

  • Clone the repo by git clone https://github.com/SwagLyrics/SwagLyrics-For-Spotify.git or use ssh.
  • cd into the cloned repo.
  • pip install -e . the -e flag installs it locally in editable mode.

Improvements Planned

  1. Linux and macOS support done
  2. Better logging of unsupported songs, the isolated unsupported.txt is sub-optimal for multiple users since thefile will only update locally with songs which worked fine when it was just me but since I hope others use it too, I'lltry to add a better method with server support.
  3. Better tests to test all of the functionality. (cli.py fully tested!) 100% code coverage
  4. Perhaps a tiny app using Electron that could fit in your tray to be opened whenever you want lyrics for a song.
  5. Supporting more songs, currently the program sometimes fails at remixes since while the lyrics are same asoriginal,the artist is the remixer. done
  6. Documenting all the files.

SwagLyrics on Windows with Terminal

SwagLyrics with Hyper

SwagLyrics on Windows with Firefox Side-View

SwagLyrics with Side-View

Screencast - SwagLyrics on Linux

Watch the video

Screencast - SwagLyrics on macOS

Watch the video

 相关资料
  • 但是,如果使用future的for-complementation,如何为部分指定ExecutionContext? 并且,如果没有指定,什么ExecutionContext以yield方式运行代码? 好的。感谢回答,我发现了一些东西。 如果我不定义或导入隐式ExecutionContext(像),for-complementsion将无法编译。这意味着,for-complementation使用

  • 问题内容: 您是否认为for … in和for循环有很大的不同?您更喜欢使用哪种“用于”,为什么? 假设我们有一个关联数组的数组: 这样我们就可以迭代: 和: 我没什么大不同。有性能问题吗? 问题答案: 该选择应基于对哪种习语最了解。 使用以下方法迭代数组: 使用以下方法来迭代用作关联数组的对象: 除非您有惊天动地的理由,否则请遵循既定的使用模式。

  • for

    Lua 提供了一组传统的、小巧的控制结构,包括用于条件判断的 if 用于迭代的 while、repeat 和 for,本章节主要介绍 for 的使用。 for 数字型 for 语句有两种形式:数字 for(numeric for)和范型 for(generic for)。 数字型 for 的语法如下: for var = begin, finish, step do --body end

  • for

    for循环重复执行一组语句一个预先给定的次数。匹配的end描述该语句。 for n = 3:32 r(n) = rank(magic(n)); end r 内部语句末尾的分号隐藏重复的打印,循环后的r显示最终结果。 为可读性编排循环是个好主意,特别是当它们是嵌套时。 for i = 1:m for j = 1:n H(i,j) = 1/(i+j); end end

  • for

    请参考:http://www.kancloud.cn/manual/thinkphp/1807

  • for loop是一种重复控制结构,允许您有效地编写需要执行特定次数的循环。 语法 (Syntax) 在F#编程语言中for…to循环的语法是 - for var = start-expr to end-expr do ... // loop body F#编程语言中for ... downto循环的语法是 - for var = start-expr downto end-expr do