LyricsMaster是一个从多个歌词提供商下载歌词的库。提供LyricWiki、Az歌词、Genius、Lyrics007、MusixMatch和其他歌词提供商

lyricsmaster的Python项目详细描述


歌词母版

PyPi StatusLinux Continuous Integration StatusWindows Continuous Integration StatusDocumentation StatusDependencies Update StatusCoverage Status

LyricsMaster是一个从多个歌词提供商下载歌词的库。

支持以下歌词提供程序:

  • 抒情维基
  • Az歌词
  • 天才
  • 歌词007
  • 音乐匹配
  • 原嘻哈(RAP)歌词档案-ohhla.com
  • 不久还会有更多。

功能

  • 从LyricWiki、Az歌词、Genius、Lyrics007、MusixMatch、Ohla等网站下载歌词。
  • 异步下载歌词。
  • 可以通过Tor请求匿名下载歌曲。
  • 轻松地将歌词保存在计算机上。

用法

在项目中使用LyricsMaster:

from lyricsmaster import LyricWiki, TorController


# Select a provider from the supported Lyrics Providers (LyricWiki, AzLyrics, Genius etc..)
# The default Provider is LyricWiki
provider = LyricWiki()

# Fetch all lyrics from 2Pac
discography = provider.get_lyrics('2Pac')

# Discography Objects and Album Objects can be iterated over.
for album in discography:    # album is an Album Object.
    print('Album: ', album.title)
    for song in album:       # song is a Song Object.
        print('Song: ', song.title)
        print('Lyrics: ', song.lyrics)

# New indexing and slicing support of Discography and Album Objects
first_song_of_first_album = discography.albums[0].songs[0]
lat_two_songs_of_first_album = discography.albums[0].songs[-2:]

# Fetch all lyrics from 2pac's album 'All eyez on me'.
album = provider.get_lyrics('2Pac', album='All eyes on me')

# Fetch the lyrics from the song 'California Love' in 2pac's album 'All eyez on me'.
song = provider.get_lyrics('2Pac', album='All eyez on me', song='California Love)

# Once the lyrics are fetched, you can save them on disk.
# The 'save()' method is implemented for Discography, Album and Song objects.
# By default, the lyrics are saved in {user}/Documents/lyricsmaster/
discography.save()

# You can also supply a folder to save the lyrics in.
folder = 'c:\MyFolder'
discography.save(folder)

# For anonymity, you can use a Tor Proxy to make requests.
# The TorController class has the same defaults as a default Tor Install.
provider = LyricWiki(TorController())
discography = provider.get_lyrics('2Pac')

# For enhanced anonymity, the TorController can renew the the Tor ciruit for each album dowloaded.
# For this functionnality to work, the Tor ControlPort option must be enabled in your torrc config file.
# See https://www.torproject.org/docs/tor-manual.html.en for more information.
provider = LyricWiki(TorController(control_port=9051, password='password))
discography = provider.get_lyrics('2Pac')

从命令行使用lyricsmaster(默认歌词提供程序是lyricwiki):

$ lyricsmaster <artist_name> options

示例:

$ lyricsmaster "2Pac"
Anonymous requests disabled. The connexion will not be anonymous.
Downloading 2Pacalypse Now (1991)
2Pacalypse Now (1991) succesfully downloaded
Downloading Strictly 4 My N.I.G.G.A.Z... (1993)
Strictly 4 My N.I.G.G.A.Z... (1993) succesfully downloaded
Downloading Thug Life - Volume 1 (1994)
...


$ lyricsmaster "2Pac" --provider Genius
Anonymous requests disabled. The connexion will not be anonymous.
Downloading The Rose That Grew From Concrete (Book)
The Rose That Grew From Concrete (Book) succesfully downloaded
Downloading Best of 2Pac Part 2: Life
Best of 2Pac Part 2: Life succesfully downloaded
...


$ lyricsmaster "2Pac" --tor 127.0.0.1
Anonymous requests enabled. The Tor circuit will change according to the Tor network defaults.
Downloading 2Pacalypse Now (1991)
2Pacalypse Now (1991) succesfully downloaded
Downloading Strictly 4 My N.I.G.G.A.Z... (1993)
Strictly 4 My N.I.G.G.A.Z... (1993) succesfully downloaded
Downloading Thug Life - Volume 1 (1994)
...


$ lyricsmaster "2Pac" --tor 127.0.0.1 --controlport 9051 --password password
Anonymous requests enabled. The Tor circuit will change for each album.
New Tor circuit created
Downloading 2Pacalypse Now (1991)
2Pacalypse Now (1991) succesfully downloaded
New Tor circuit created
Downloading Strictly 4 My N.I.G.G.A.Z... (1993)
Strictly 4 My N.I.G.G.A.Z... (1993) succesfully downloaded
New Tor circuit created
Downloading Thug Life - Volume 1 (1994)
...

历史记录

2.8.1(2019-04-07)

  • 更全面地实现了discography和album类的python数据模型。
  • 现在,在一个DeC形像对象中单独的相册或歌曲可以通过在先前迭代的顶部进行索引或切片来单独访问。
  • 例如discography.albums[0].songs[0]或discography.albums[0].songs[2:5]
  • 更新的依赖项。

2.8(2019-03-31)

2.7.25(2019-03-23)

  • 增强了对utf-8字符的支持,即使html编码有错误的信息。(见https://github.com/SekouD/lyricsmaster/issues/211
  • 修正了musixmatch错误,当只有一些歌词的第一句话被解析时。
  • 当LyricsMaster用作库而不是独立库时,更新了记录器配置以避免重复日志。
  • 更新的依赖项。

2.7.24(2019-03-16)

2.7.23(2019-02-28)

  • 更新了LyricsMaster以反映MusixMatch和Lyrics007 API中的更改。
  • 更新的依赖项。

2.7.22(2018-11-18)

  • 更新的依赖项。

2.7.21(2018-11-04)

  • 更新到最新的TOR版本。
  • 更新的依赖项。

2.7.20(2018-07-29)

  • 更新到最新的TOR版本。
  • 更新文件。

2.7.19(2018-07-16)

  • 当唱片集的发行日期不在所有提供程序的标题标记中时捕获异常。

2.7.17(2018-07-08)

  • 改进测试。
  • 更新文件。

2.7.16(2017-09-27)

  • 总体改进。

2.7.0(2017-09-27)

  • 添加了命令行界面。

2.6.0(2017-09-26)

  • 添加了Genius提供程序。

2.5.0(2017-09-26)

  • 增加了Python2.7兼容性

2.4.0(2017-09-24)

  • 添加了Az歌词提供程序。

2.3.0(2017-09-21)

  • 添加了完整的文档。
  • 修正了更新TOR电路时的异步请求错误。

2.2.0(2017-09-20)

  • 已将保存方法添加到光盘画册,专辑,歌曲对象。

2.1.0(2017-09-20)

  • 添加了异步请求。

2.0.0(2017-09-19)

  • 增加了匿名性。

1.0.0(2017-09-17)

  • 添加了LyricWiki提供程序。

0.1.0(2017-09-11)

  • pypi上的第一个版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在片段中使用listView?   java Android Studio:在不同的活动中使用“OnClick”方法?   设置IntelliJ时,java字符未正确显示   如何使用Java解析每个不同键和值的JSON对象?   简单的java AI响应程序?   java更改进程中不确定对话框的颜色   java类型不匹配:无法在eclipse中从双精度转换为整数   java如何理解我的类的属性是否已更改   xml Java Jena API获取另一个类的属性   java在JPanel上缩放和加载地图分幅   java在安卓 studio上使用工具栏的正确方法是什么?   java使用基于iText Core的OpenPdf从pdf页面删除或更新添加的图像图标   JavaFacebookGraphAPI在第一次请求时返回400,在第二次请求时返回200,这两个请求是相同的   java如何在DynamoDB中实现选择和插入项作为一个事务   java如何使用MAVEN运行方法?   (如何)在Java三元运算符语句中捕获异常?   java如何使用Hibernate SchemaExport和BeanValidation约束导出数据库模式?   java如何在weblogic中使用hibernate代替eclipselink?   Java读socketTcp更快