Package Details: netease-cloud-music-dl-git r31.5c57275-1

Git Clone URL: https://aur.archlinux.org/netease-cloud-music-dl-git.git (read-only, click to copy)
Package Base: netease-cloud-music-dl-git
Description: Netease cloud music song downloader, with full ID3 metadata, eg: front cover image, artist name, album name, song title and so on.
Upstream URL: https://github.com/codezjx/netease-cloud-music-dl
Keywords: cloud-music downloader id3-tags netease python
Licenses: MIT
Submitter: chenjunyu19
Maintainer: None
Last Packager: chenjunyu19
Votes: 0
Popularity: 0.000000
First Submitted: 2018-06-25 09:35 (UTC)
Last Updated: 2020-05-05 07:32 (UTC)

Latest Comments

13905069 commented on 2023-08-03 09:53 (UTC) (edited on 2023-08-03 10:04 (UTC) by 13905069)

把以下内容复制保存在fix_pillow.patchPKGBUILD放在同一目录

--- ncm/file_util.py.org    2023-08-03 17:44:32.059298306 +0800
+++ ncm/file_util.py    2023-08-03 17:35:21.521619066 +0800
@@ -13,7 +13,7 @@
         return

     if img.size[0] > max_size[0] or img.size[1] > max_size[1]:
-        img.thumbnail(max_size, Image.ANTIALIAS)
+        img.thumbnail(max_size, Image.LANCZOS)
         img = img.convert('RGB')
         img.save(file_path, quality=quality)

然后再把以下内容复制保存为fix_PKGBUILD.patchPKGBUILD放在同一目录

--- PKGBUILD    2023-08-03 17:56:21.517185531 +0800
+++ PKGBUILD        2023-08-03 17:54:51.577826219 +0800
@@ -10,8 +10,8 @@
 depends=('python' 'python-requests>=2.17.3' 'python-pycryptodomex' 'python-mutagen>=1.38.0' 'python-pillow>=4.3.0')
 makedepends=('git' 'python-setuptools')
 options=(!emptydirs)
-source=("git+https://github.com/codezjx/netease-cloud-music-dl.git")
-md5sums=('SKIP')
+source=("git+https://github.com/codezjx/netease-cloud-music-dl.git" "fix_pillow.patch")
+md5sums=('SKIP' 'SKIP')
 _gitname=netease-cloud-music-dl

 pkgver() {
@@ -21,6 +21,7 @@

 package(){
   cd "$srcdir/$_gitname"
+  patch -p0 -i ../fix_pillow.patch
   python setup.py install --root="$pkgdir/" --optimize=1
   install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }

最后在PKGBUILD的目录下运行patch -p0 -i fix_PKGBUILD.patch修补PKGBUILD文件,再makepkg -i编译并安装,即可解决AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'报错的问题

chenjunyu19 commented on 2023-07-24 09:24 (UTC) (edited on 2023-07-24 09:26 (UTC) by chenjunyu19)

@frat 需要 python-pillow<10(可以使用 python-pillow95

可以和上游反馈一下这个问题,以便和最新版本的 pillow 兼容。

我已经不再使用这个软件包,我将进行弃置。

frat commented on 2023-07-24 08:36 (UTC)

Traceback (most recent call last): File "/usr/bin/ncm", line 33, in <module> sys.exit(load_entry_point('netease-cloud-music-dl==0.2.0', 'console_scripts', 'ncm')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/ncm/start.py", line 83, in main download_song_by_id(get_parse_id(args.song_id), config.DOWNLOAD_DIR) File "/usr/lib/python3.11/site-packages/ncm/downloader.py", line 22, in download_song_by_id download_song_by_song(song, download_folder, sub_folder) File "/usr/lib/python3.11/site-packages/ncm/downloader.py", line 86, in download_song_by_song resize_img(os.path.join(song_download_folder, cover_file_name)) File "/usr/lib/python3.11/site-packages/ncm/file_util.py", line 16, in resize_img img.thumbnail(max_size, Image.ANTIALIAS) ^^^^^^^^^^^^^^^ AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'