timothyqiu / xiami-downloader

A simple tool for downloading music previews from Xiami.
http://timothyqiu.com/archives/xiami-music-preview-downloader/
MIT License
74 stars 25 forks source link

⚠️ This tool no longer works since Xiami changed their web player API. This tool utilizes the old API, which may cause your IP to be banned for some time. To be updated.

⚠️ 由于虾米修改了播放器接口,此工具目前已失效。使用此工具访问原接口可能造成 IP 被暂时屏蔽。待更新。

Xiami Music Preview Downloader

MIT license made-with-python

A simple tool for downloading music previews from Xiami.com

Note: this script uses Python 2. Python 3 support is still in progress.

Dependencies

Usage

python -m xiami_downloader.cli [options]

# or, install via pip (Currently not on PyPI, so you have to download this first)
pip install .    # Install
xiami [options]  # Run

Options

<song id>, <playlist id> and <album id> can be retrived from URLs of Xiami.

For downloading on Windows, this script will use the built-in urllib2-library. On all other OSes, it will use wget.

The default template for the filename is set to {id} - {title} - {artist}. The arguments are:

If you have a Vip account, the script will download tracks in 320K. Remember to set the -un and -pw arguments accordingly. Note that Xiami has a limits the downloads. If you are downloading lots of tracks, make sure to pause between downloads.

Example

To download the album Mahōtsukai no Yoru OST, first checkout the album's ID from the url. The url you're visiting may be in one of the two forms:

Numeric ID can be used directly, to download the album:

python -m xiami_downloader.cli -a 511682

If the ID is alphanumeric, click the "立即播放" button in the page and a new player window will pop up. The corresponding numeric ID should be in the url of that window:

https://www.xiami.com/play?ids=/song/playlist/id/511682/type/1#loaded

License

This software is distributed under the MIT License.


虾米音乐试听下载器

MIT license made-with-python

虾米网上下载音乐试听的小工具。

注:这是一个 Python 2 脚本。Python 3 支持工作仍在进行。

依赖

使用方法

python -m xiami_downloader.cli [options]

# 或者,使用 pip 安装(尚未提交 PyPI,所以需要先手动下载源码)
pip install .    # 安装
xiami [options]  # 运行

选项

<歌曲ID><精选集ID><专辑ID> 都可以从对应虾米页面的 URL 中找出。

默认下载工具在 Windows 上是内置的 urllib2,其它平台则是 wget。

文件名模版默认值为 {id} - {title} - {artist},可选参数如下:

如果有VIP账号,可以下载高品质320K的歌曲 虾米有高音质音乐下载限制,所以不要短时间内下一大堆歌

示例

例如要下载专辑《魔法使いの夜 オリジナルサウンドトラック》,首先检查 URL 中的专辑 ID。你可能会看到两种形式的 URL:

数字 ID 可以直接使用,下载该专辑只需执行:

python -m xiami_downloader.cli -a 511682

如果 ID 包含字母,那么需要先点击页面中的「立即播放」按钮打开新的播放器窗口。对应的数字 ID 可以在该窗口的 URL 中找到:

https://www.xiami.com/play?ids=/song/playlist/id/511682/type/1#loaded

许可

Xiami Music Preview Downloader 使用 MIT License 发布。