Skip to main content

MusicTagFindutils

这个 Python 库可以帮助你从 QQ 音乐、网易云音乐等音乐平台上,获取指定歌曲的信息,以便之后将它们写入到音频文件的标签中。

安装

所需依赖:

  • requests - 网络请求库

PyPI

pip install -U MusicTagFindutils

或者前往 PyPI 页面。

本仓库

pip install git+https://github.com/nukemiko/MusicTagFindutils

发布页

最新发布版本:https://github.com/nukemiko/MusicTagFindutils/releases/latest

提供 Wheel 包。

使用

  • 使用网易云音乐作为信息源:

    >>> from tagfindutils import cloudmusic
    >>> cloudmusic_results = cloudmusic.search('朝が来る')
    >>> matched = None
    >>> if cloudmusic_results:
    ...     matched = cloudmusic_results[0]
    ...
    >>> matched
    <
        name: 朝が来る
        trans: 拂晓将至
        aliases: TV动画《鬼灭之刃 花街篇》片尾曲
        artists: Aimer
        album: 朝が来る
        publish time: 2022-01-10 00:00:00
    >
    >>> # 以下命令输出的格式:((歌名, 歌曲 ID), ((歌手 1, 歌手 1 的 ID), (歌手 2(如果有), 歌手 2 的 ID(如果有)), ...), (专辑名, 专辑 ID))
    >>> (matched.songname, matched.songid), tuple(zip(matched.artists, matched.artistids)), (matched.album, matched.albumid)
    (('朝が来る', 1902312104), (('Aimer', 16152),), ('朝が来る', 137312734))
    >>> matched.coverurl  # 封面图像的下载链接
    'http://p4.music.126.net/bCQCvWXXufd7XVvtg5iHkw==/109951166714320898.jpg'
    >>>
    
  • 使用 QQ 音乐作为信息源:

    >>> from tagfindutils import qqmusic
    >>> qqmusic_results = qqmusic.search('Enemies', 'The Score')
    >>> matched = None
    >>> if qqmusic_results:
    ...     matched = qqmusic_results[0]
    ...
    >>> matched
    <
        name: Enemies
        artists: The Score
        album: Enemies
        publish time: 2022-01-14 00:00:00
    >
    >>> # 以下命令输出的格式:((歌名, 歌曲 mID), ((歌手 1, 歌手 1 的 mID), (歌手 2(如果有), 歌手 2 的 mID(如果有)), ...), (专辑名, 专辑 mID))
    >>> (matched.songname, matched.songmid), tuple(zip(matched.artists, matched.artistmids)), (matched.album, matched.albummid)
    (('Enemies', '003nYL8b2u6ygu'), (('The Score', '0023TAHr2UmE2p'),), ('Enemies', '000v14Zi196WkA'))
    >>> matched.coverurl  # 封面图像的下载链接
    'https://y.qq.com/music/photo_new/T002R800x800M000000v14Zi196WkA.jpg'
    >>>
    
  • 从搜索结果获取歌曲的详细信息:

    [...]
    >>> detail = matched.get_detail()
    >>> detail
    <
        name: Enemies
        artists: The Score
        album: Enemies
        publish time: 2022-01-14 00:00:00
        genre: Pop
        company: INgrooves
    >
    >>> # 详细信息和单个搜索结果项相比,只多了“流派(genre)”、“出版方(company)”两个属性
    >>> # 如果使用网易云音乐作为信息源,这两个属性均返回空列表,因为网易云音乐返回的详细信息不包含这两个字段
    >>> # 以下命令输出的格式:([流派 1, 流派 2(如果有), ...], [出版方 1, 出版方 2(如果有), ...])
    >>> (detail.genre, detail.company)
    (['Pop'], ['INgrooves'])
    >>>
    

Metadata

Release files for MusicTagFindUtils 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MusicTagFindUtils 0.1.2
File Size Uploaded Provenance Actions
MusicTagFindUtils-0.1.2.tar.gz 8.1 kB Without provenance Details for MusicTagFindUtils-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MusicTagFindUtils 0.1.2
File Interpreter ABI Platform Actions
MusicTagFindUtils-0.1.2-py3-none-any.whl Python 3 none any Details for MusicTagFindUtils-0.1.2-py3-none-any.whl

Total release size: 18.8 kB

Release files / MusicTagFindUtils-0.1.2.tar.gz

Download URL MusicTagFindUtils-0.1.2.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1f20bd970e862e84c9320f089d21ccaa8ec9b5ee6d28c98475d1d6f51142e15c
BLAKE2b-256 checksum
How to use checksums
c982619e427b12765fed0cd56cd64e032b16fcf9600705f0b6ce38ef73f1195a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.4

Release files / MusicTagFindUtils-0.1.2-py3-none-any.whl

Download URL MusicTagFindUtils-0.1.2-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04a585816bc6f80cb6cfcf2377a4aab7ddf259e41f988a10b0261002a324aae6
BLAKE2b-256 checksum
How to use checksums
628c8cbb6ed5bf000a860e5db1bf0a64e9f6a2f366913a12e2284a037e508104
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.4

Security for MusicTagFindUtils 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page