Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

MacOS 下,发音文件下载失败 #111

Open
dotmark opened this issue Oct 23, 2022 · 5 comments
Open

MacOS 下,发音文件下载失败 #111

dotmark opened this issue Oct 23, 2022 · 5 comments

Comments

@dotmark
Copy link

dotmark commented Oct 23, 2022

[23/10/2022 20:20:39][ WARNING] -- 下载AmEPron_invariant.mp3:http://dict.youdao.com/dictvoice?audio=invariant&type=2异常: [Errno 30]
Read-only file system: 'AmEPron_invariant.mp3' - (dict2Anki.workers.AudioDownloadWorker)

分析发现addonWindow.py的这行语句里没有路径
audiosDownloadTasks.append((f"{whichPron}{wordItemData['term']}.mp3", wordItemData[whichPron],))
改成如下形式可下载成功
audiosDownloadTasks.append((f"/Users/testuser/Library/Application Support/Anki2/账户1/collection.media/{whichPron}
{wordItemData['term']}.mp3", wordItemData[whichPron],))

@fdd92
Copy link

fdd92 commented Dec 11, 2022

谢谢。这里遇到同样问题,照着改完后可以正常下载发音。

@HuTuJun
Copy link

HuTuJun commented Mar 4, 2023

多谢, 这个对window也适用,实际下载会直接下载到安装文件夹中去了,而不是 媒体文件夹

媒体文件夹: C:\Users\自己的\AppData\Roaming\Anki2\账户名\collection.media

直接装 : D:\Application\Learn\Anki ( 安装文件夹中 )

@HuTuJun
Copy link

HuTuJun commented Mar 4, 2023

~\Anki2\addons21\1284759083\addon\addonWindow.py

window 下我修改了 代码。 就可以正常下载到Anki 的媒体文件了。

@dotmark @fdd92

是否可以试试 MAC 下的?

原来:

                # 添加发音任务
                if whichPron and wordItemData.get(whichPron):
                    audiosDownloadTasks.append((f"{whichPron}_{wordItemData['term']}.mp3", wordItemData[whichPron],))

修改为:

                # 添加发音任务
                if whichPron and wordItemData.get(whichPron):
                    media_dir = mw.col.media.dir()
                    fpath = os.path.join(media_dir, f"{whichPron}_{wordItemData['term']}.mp3")
                    audiosDownloadTasks.append((fpath, wordItemData[whichPron],))

@sichenhz
Copy link

~\Anki2\addons21\1284759083\addon\addonWindow.py

window 下我修改了 代码。 就可以正常下载到Anki 的媒体文件了。

@dotmark @fdd92

是否可以试试 MAC 下的?

原来:

                # 添加发音任务
                if whichPron and wordItemData.get(whichPron):
                    audiosDownloadTasks.append((f"{whichPron}_{wordItemData['term']}.mp3", wordItemData[whichPron],))

修改为:

                # 添加发音任务
                if whichPron and wordItemData.get(whichPron):
                    media_dir = mw.col.media.dir()
                    fpath = os.path.join(media_dir, f"{whichPron}_{wordItemData['term']}.mp3")
                    audiosDownloadTasks.append((fpath, wordItemData[whichPron],))

M1芯片Senoma14.0,可以解决

@wyizhou
Copy link

wyizhou commented Mar 17, 2024

~\Anki2\addons21\1284759083\addon\addonWindow.py

window 下我修改了 代码。 就可以正常下载到Anki 的媒体文件了。

@dotmark @fdd92

是否可以试试 MAC 下的?

原来:

                # 添加发音任务
                if whichPron and wordItemData.get(whichPron):
                    audiosDownloadTasks.append((f"{whichPron}_{wordItemData['term']}.mp3", wordItemData[whichPron],))

修改为:

                # 添加发音任务
                if whichPron and wordItemData.get(whichPron):
                    media_dir = mw.col.media.dir()
                    fpath = os.path.join(media_dir, f"{whichPron}_{wordItemData['term']}.mp3")
                    audiosDownloadTasks.append((fpath, wordItemData[whichPron],))

已成功,18款 Intel Macbook通过这个方法可以解决发音无法下载的问题

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants