Diaoxiaozhang / Ximalaya-Downloader

喜马拉雅专辑音频一键下载工具
GNU Affero General Public License v3.0
833 stars 116 forks source link

无法进行的下载! #68

Closed unusuallman closed 3 months ago

unusuallman commented 3 months ago

在调试的时候出现了这个错误

Error occurred during getting browser: iter, but was suppressed with fallback.

async with session.get(url, headers=headers, params=params, timeout=20) as response:

image

unusuallman commented 3 months ago
async def async_analyze_sound(self, sound_id, session, headers):
        retries = 3
        url = f"https://www.ximalaya.com/mobile-playpage/track/v3/baseInfo/{int(time.time() * 1000)}"
        params = {
            "device": "www2",
            "trackId": sound_id,
            "trackQualityLevel": 2
        }
        while retries > 0:
            try:
                async with session.get(url, headers=headers, params=params, timeout=20) as response:
                    response_json = json.loads(await response.text())
                    sound_name = response_json["trackInfo"]["title"]
                    encrypted_url_list = response_json["trackInfo"]["playUrlList"]
                    break
... ...

可能是在这里出现了问题,他们是不是更改了请求用的链接,或者构造的参数体什么的

Diaoxiaozhang commented 3 months ago

我刚刚自己测试了,没有这种问题,你运行我打包的exe文件看看,如果还是有报错把日志文件发过来。我最近很忙,很多问题都来不及处理,可能要等到18号以后

unusuallman commented 3 months ago

我用的是macOS 还是报错了 app.log

Diaoxiaozhang commented 3 months ago

这个是ssl证书验证错误,不知道为什么会这样。 解决方法: 第185行改为:

response = requests.get(sound_url, headers=self.default_headers, timeout=60, verify=False)

第224行改为

conn = aiohttp.TCPConnector(ssl=False)
session` = aiohttp.ClientSession(connector=conn)
Diaoxiaozhang commented 3 months ago

第51行也要改,也是按185行的改法,加verify=False

unusuallman commented 3 months ago

224行的修改不是很清楚

unusuallman commented 3 months ago

image 看到上下游的传递了,应该是这个位置吧