Giter Club home page Giter Club logo

ximalaya-downloader's Introduction

Hi there

  • 🏫 I'm currently a passionate student pursuing my studies.
  • 🌱 I love exploring new technologies and learning new skills.
  • 💻 My primary programming language is Python.
  • 🎯 My main focus is on Machine Learning and Data Science.
  • 🌱 I'm always eager to grow and learn from others in the field.
  • 🤝 I'm open to collaboration on interesting projects.

Feel free to drop me an email at [email protected]!

Diaoxiaozhang's GitHub stats

ximalaya-downloader's People

Contributors

c469591 avatar diaoxiaozhang avatar tianjyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ximalaya-downloader's Issues

音频格式

您好,感谢维护,下载普通音质音频格式都是m4a格式,能否改为mp3格式呢

VIP资源每个帐号一天限制了1000个下载,超过会失败,提两个解决方向建议。

方向一:配置文件加入多个帐号切换的功能,1000的额度用完了,自动切换帐号,这个感觉限制还是很明显,毕竟很少人会有几个VIP帐号。

方向二(推荐):官方客户端下载好像没有1000个的限制,可以通过客户端下载xm文件,然后进行解密。
这里会涉及一个文件名还原的问题,下载下来的文件名都是转码过的,一个个手动改名恢复会很麻烦。所以解密完之后最好加入文件名还原成软件里看到的文件名的功能。
关于文件名还原,看下这个教程有没有参考价值:https://note.youdao.com/ynoteshare/index.html?id=6b7a9cf902907d4dc4fb97c394a5918e&type=note&_time=1682336799029

专辑里面有些声音无法下载

专辑里面有些声音无法下载。单独下载报错。请帮忙看看

请输入声音ID或链接:
https://www.ximalaya.com/sound/47736239
声音名第3集:舌头会跳舞?(1),判断为已购付费声音或vip免费声音,正在开始下载……
ID为47736239的vip声音解析失败!
Traceback (most recent call last):
  File "D:\GitHub\Ximalaya-Downloader\console-version.py", line 2, in <module>
    main.ConsoleVersion().run()
  File "D:\GitHub\Ximalaya-Downloader\main.py", line 555, in run
    self.ximalaya.get_vip_sound(sound_name, sound_id, headers)
  File "D:\GitHub\Ximalaya-Downloader\main.py", line 343, in get_vip_sound
    sound_url = self.decrypt_url(encrypted_url)
  File "D:\GitHub\Ximalaya-Downloader\main.py", line 235, in decrypt_url
    ciphertext = base64.urlsafe_b64decode(ciphertext + '=' * (4 - len(ciphertext) % 4))
TypeError: object of type 'bool' has no len()

未知错误

请输入cookie:(获取方法详见README)
######; 1&remember_me=y; 1&_token=47437######58
cookie设置成功!
成功登录账号听友47####!
请选择要使用的功能:

  1. 下载单个声音
  2. 下载专辑声音
  3. 退出程序
    2
    请输入专辑ID或链接:
    https://www.ximalaya.com/album/61310701
    成功解析已购付费专辑61310701,专辑名凡人修仙传|精品多人有声剧|忘语原著,共1256个声音
    请选择要使用的功能:
  4. 下载整个专辑
  5. 下载专辑的部分声音
  6. 显示专辑内声音列表
    1
    请选择是否要在下载的音频文件名中加入序号:
  7. 加入序号
  8. 不加序号
    1
    请选择您想要下载的音质:(直接回车默认为普通音质)
  9. 低音质
  10. 普通音质
  11. 高音质(如果没有高音质则将下载普通音质)
    2
    ID为631473213的声音解析失败!
    ID为631636985的声音解析失败!
    ID为631636987的声音解析失败!
    ID为631840545的声音解析失败!
    ID为631840542的声音解析失败!
    ID为631636989的声音解析失败!
    ID为631840547的声音解析失败!
    ID为636628145的声音解析失败!

是否能新增解析手機板連結的功能

你好大大,最近發現下載工具無法解析手機板喜馬拉雅分享的連結,是否可以新增對這種連結的解析,
或是有什麼策略可以轉換手機板連結成電腦版的聯結呢
下面這是網址
https://m.ximalaya.com/selfshare/album/56206086?uid=140986368&shrdv=e8d4322a-2789-374f-983a-ab0054d0ead5&shrh5=android&shrid=18e2c16d427152fd&shrdh=1&shrpid=18e2c16d4277c33&srcType=6&subType=1010&srcId=56206086
最近一週都在研究此項目的code,解析的部分還沒研究,
要是大老有絲路可以先分享函數讓我來測試測試也行,感謝!

关于解密的问题

首先,对大佬表示真诚的感谢,这个解密url和解密xm文件的方法很强。

如果您有时间,可以发一篇文章,或者一个视频,说明一下您是如何破解它加密步骤,并进行解密的吗?

小白一枚,感觉这些东西很强大,想学习一下,如果您有解密相关的学习路线,希望您也能分享一下~

万分感谢!

有几个建议想提出,烦请抽空观看

你好目前有几个问题
1.检测到当前ip不在**大陆,由于喜马拉雅官方限制,必须登录才能继续使用
实际上免费的部份(就是试听的部份)与免费书应该可以在没有cookie的情况下载
至少油猴插件的脚本是可以做的,如果可以的话,这个部份麻烦考虑看看能否施做
https://greasyfork.org/zh-TW/scripts/435495 ← 这是油猴那个脚本

2.能否增加自行设定下载间隔时间,目前程式是直接暴力全数下载,可能有被封号的风险
能否让用户自行设定下载间隔。
例如︰下完一个档案之后间隔30秒才下载下一个档案
最理想的状态是让用户设定一个区间,而程式在这个区间内随机取一个数,倒数完之后才进行下一个档案下载
例如︰用户设定下载间隔为30秒至180秒,那就下完一个档案后随机等待30秒~180秒,再下下一个档案,然后再随机等待此区间秒数
循环往替。

3.希望增加设定proxy的功能
就如同贵程式一开始检测IP是否在**大陆一样,某些书会有非**大陆IP,无法下载的问题,就算有vip也没用
必须要挂上代理转为**大陆IP才能够下载,而在chrome里可以直接对chrome挂代理,而不会影响到全局
目前贵程式如果想要下载此类书籍,我想到的只有改全局去套用代理才能够实现下载
故希望能够提供设定代理功能

4.这个是第三点的补充,是希望而非必要
能够提供批量测试喜玛拉雅站点代理是否能够使用的功能
网路上提供的免费**porxy,很多都显示可以用,但实际上是连不上喜玛拉雅的
如果有个测试工具可以以xxx.xxx.xxx.xxx xxxx (中间空格可为tab或:)
例如将下列proxy丢进程式里,由程式帮忙测试是否能够连接到喜玛拉雅
(就是测试本地IP挂上 proxy IP能否连上目标IP的程式)
14.103.24.20 8000
14.103.26.198 8000
223.215.177.206 8089
47.100.91.57 8080
121.46.201.241 80
121.230.208.226 7788
47.100.254.82 80
120.24.176.185 8080
106.14.255.124 80
60.12.168.114 9002
60.174.1.24 8089
114.231.82.137 8089
当然如果可以指定到页面是最好,直接相当于多出一个由自己所在地去测试
自己是否能够连上代理伺服器,并连接到需要用的网页的测试程式

以上几点,麻烦参考看看,谢谢

建议添加音质选择功能

作者您好,一个小建议:
def get_encrypted_url(self, sound_id, headers):方法中,trackQualityLevel可以设置1-3,对应的["playUrlList"][0]为相应音质的url,指的注意的是,最高画质的音配文件后缀不是.m4a需要修改一下相应的保存代码。

關於使用的問題和建議

你好,這個軟件非常適合我用,但我遇到一些問題,整理如下→

  1. 我用威信或是qq登入,但回到cmd介面之後,他仍然較我輸入cookie,
    因此我直接按enter跳過該步驟,直接輸入網址來下載,
    輸入的網址都是vip會員才能收聽的網址,
    但輸入專輯往只能解析出曲目的名稱,卻都顯示無法下載,
    輸入某一個曲目的網址,他會顯示解析失敗
    專輯往只是
    https://www.ximalaya.com/album/22365086
    請問是必須用手機號登入才行嗎?
  2. 請問下載回的文件是最高音質嗎?
  3. 希望可以自訂下載的保存位置
  4. 另外gui的開發希望可以讓視障朋友也能操作,
    windows10+的系統可以按ctrl+win+enter打開講述人來測試,
    基本上按tab鍵都能朗讀、上、下、左、右鍵能操控並朗讀gui就ok了
  5. 我會將這個好用工具分享到我的網站,把好用的工具分享給更多人→
    小羔羊分享站

非常感謝作者的辛苦付出!

ubuntu18.04报错

请选择您想要下载的音质:(直接回车默认为普通音质)
0. 低音质

  1. 普通音质
  2. 高音质(如果没有高音质则将下载普通音质)
    2
    Traceback (most recent call last):
    File "cli.py", line 183, in
    loop.run_until_complete(ximalaya.get_selected_sounds(sounds, album_name, start, end, headers, int(choice), number, path))
    File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
    File "/root/ximalaya/xxx/main.py", line 244, in get_selected_sounds
    tasks.append(asyncio.create_task(self.async_analyze_sound(sound_id, session, headers)))
    AttributeError: module 'asyncio' has no attribute 'create_task'
    Unclosed client session
    client_session: <aiohttp.client.ClientSession object at 0x7f874f14aef0>

未知错误

请输入cookie:(获取方法详见README)
######; 1&remember_me=y; 1&_token=47437######58
cookie设置成功!
成功登录账号听友47####!
请选择要使用的功能:

  1. 下载单个声音
  2. 下载专辑声音
  3. 退出程序
    2
    请输入专辑ID或链接:
    https://www.ximalaya.com/album/61310701
    成功解析已购付费专辑61310701,专辑名凡人修仙传|精品多人有声剧|忘语原著,共1256个声音
    请选择要使用的功能:
  4. 下载整个专辑
  5. 下载专辑的部分声音
  6. 显示专辑内声音列表
    1
    请选择是否要在下载的音频文件名中加入序号:
  7. 加入序号
  8. 不加序号
    1
    请选择您想要下载的音质:(直接回车默认为普通音质)
  9. 低音质
  10. 普通音质
  11. 高音质(如果没有高音质则将下载普通音质)
    2
    ID为631473213的声音解析失败!
    ID为631636985的声音解析失败!
    ID为631636987的声音解析失败!
    ID为631840545的声音解析失败!
    ID为631840542的声音解析失败!
    ID为631636989的声音解析失败!
    ID为631840547的声音解析失败!
    ID为636628145的声音解析失败!

下载专辑声音失败

The below is error output when run.

while I use below link to get specific soud, it has response.
https://www.ximalaya.com/mobile-playpage/track/v3/baseInfo/1706705279276?device=web&trackId=64429939&trackQualityLevel=2

Ximalaya-Downloader-main/cli.py:11: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
欢迎使用喜马拉雅下载器
在config文件中未检测到有效的下载路径,将使用默认下载路径,如果想要修改下载路径,请修改config.json文件中的path字段为你想要的下载路径
未检测到有效喜马拉雅登录信息,请2选择是否要登录:

  1. 登录
  2. 不登录
    2
    请选择要使用的功能:
  3. 下载单个声音
  4. 下载专辑声音
  5. 退出程序
    2
    请输入专辑ID或链接:
    12285737
    成功解析免费专辑12285737,专辑名Trials of Apollo-Rick Riordan,共58个声音
    请选择要使用的功能:
  6. 下载整个专辑
  7. 下载专辑的部分声音
  8. 显示专辑内声音列表
    1
    请选择是否要在下载的音频文件名中加入序号:
  9. 加入序号
  10. 不加序号
    2
    请选择您想要下载的音质:(直接回车默认为普通音质)
  11. 低音质
  12. 普通音质
  13. 高音质(如果没有高音质则将下载普通音质)
    1

ID为64429939的声音解析失败!

ID为86721652的声音解析失败!

ID为86721626的声音解析失败!

ID为86721620的声音解析失败!

ID为86721658的声音解析失败!

ID为251110561的声音解析失败!

ID为86721645的声音解析失败!

ID为86721664的声音解析失败!

ID为86721650的声音解析失败!

ID为86721649的声音解析失败!

ID为86721659的声音解析失败!

ID为86721630的声音解析失败!

ID为86721618的声音解析失败!

ID为86721654的声音解析失败!

ID为86721629的声音解析失败!

ID为86721622的声音解析失败!

ID为343611263的声音解析失败!

ID为86721656的声音解析失败!

ID为86721660的声音解析失败!

ID为86721648的声音解析失败!

ID为86721646的声音解析失败!

ID为86721662的声音解析失败!

ID为86721638的声音解析失败!

ID为86721633的声音解析失败!

ID为86721644的声音解析失败!

ID为86721635的声音解析失败!

ID为64429938的声音解析失败!

ID为86721623的声音解析失败!

ID为64439295的声音解析失败!

ID为251110562的声音解析失败!

ID为64439294的声音解析失败!

ID为86721625的声音解析失败!

ID为86721640的声音解析失败!

ID为86721651的声音解析失败!

ID为86721636的声音解析失败!

ID为86721657的声音解析失败!

ID为86721643的声音解析失败!

ID为86721627的声音解析失败!

ID为86721663的声音解析失败!

ID为343608351的声音解析失败!

ID为86721637的声音解析失败!

ID为86721632的声音解析失败!

ID为251110563的声音解析失败!

ID为86721616的声音解析失败!

ID为86721619的声音解析失败!

ID为86721634的声音解析失败!

ID为86721639的声音解析失败!

ID为86721661的声音解析失败!

ID为86721665的声音解析失败!

ID为86721642的声音解析失败!

ID为86721647的声音解析失败!

ID为86721621的声音解析失败!

ID为86721653的声音解析失败!

ID为86721641的声音解析失败!

ID为343612747的声音解析失败!

ID为86721628的声音解析失败!

ID为86721631的声音解析失败!

ID为86721655的声音解析失败!
Traceback (most recent call last):
File "/Users/hob_yu/Backup/PythonScripts/ximalay/github/Ximalaya-Downloader-main/cli.py", line 184, in
loop.run_until_complete(ximalaya.get_selected_sounds(sounds, album_name, start, end, headers, int(choice), number, path))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/Users/hob_yu/Backup/PythonScripts/ximalay/github/Ximalaya-Downloader-main/main.py", line 256, in get_selected_sounds
await asyncio.wait(tasks)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/tasks.py", line 368, in wait
raise ValueError('Set of coroutines/Futures is empty.')
ValueError: Set of coroutines/Futures is empty.
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x102ef4e20>

如何解決TypeError: argument of type 'ClientSession' is not iterable

你好,最近發現有些專輯下載時會發生如標題的錯誤,這是報錯的最後幾行
File "d:\python\魔鏡歌詞\code\Ximalaya_main.py", line 238, in async_get_sound
album_name = self.replace_invalid_chars(album_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\python\魔鏡歌詞\code\Ximalaya_main.py", line 186, in replace_invalid_chars
if char in name:
^^^^^^^^^^^^
TypeError: argument of type 'ClientSession' is not iterable
我下載的是這個網址
https://www.ximalaya.com/album/21824864
我也檢查了代碼,問題是出在replace_invalid_chars方法中,似乎送入了一個ClientSession參數給他導致的錯誤,
但是我查了其他掉用此方法的方法沒有看出問題在哪裡,搞不清楚為啥就送了個ClientSession進去,
我是選下載全部專輯的時候,大概到最後幾集的時候才報錯的,
在請大大看應該如何解決,感謝

无法通过浏览器登录

选择浏览器登录就直接闪退了,两个浏览器都一样,能否使用默认浏览器或者手动指定浏览器。

vip专辑某些文件可能不能下载

下载整个vip专辑资源的时候,如果某些文件标记了试听,则会导致该文件不能下载(但是在浏览器端可以通过嗅探工具等手动下载成功)

下載部分聲音只能從第一個曲目開始

你好,剛剛發現下載部分聲音的功能有bug,
我有一個專輯有一千多級,1-500沒問題,但501-1000下載完成後,發現雖然文件名開頭的數字是隊的,但標題仍然是從第一級開始
另外能否控制文件名是否要有編號? 發現有些專輯自己有編號,有時候可能兩者布疋配,
感謝!

下载整个专辑,内容很多无效,只读取了名称,没有音频内容,V0.3.3版本

问题一、也是最大问题
比如圣墟需要VIP来下载,一共2379个声音文件,但是只有1786个是有效的,另外的600个都是无效的,读取了名称,没有内容。比如圣墟 第762集听完,763有,但是都是没有内容的,这种有600个,掺杂在各个序列,有在几十集的残缺,1百多集的残缺,杂乱无章。整个专辑就没有连续性了,作用大打折扣。
Snipaste_2024-02-10_15-00-09

问题二、
能不能多出一个功能,
比如
4.下载专辑段号声音
输入专辑200-300,输入整个专辑ID,只下载200-300的声音
Snipaste_2024-02-10_15-12-44

最新发布包 下载专辑时下载任务线程好像太高了 大部分都失败了

失败后再次尝试会

Traceback (most recent call last):
File "console-version.py", line 2, in
File "main.py", line 512, in run
File "asyncio\base_events.py", line 647, in run_until_complete
File "main.py", line 276, in get_selected_vip_sounds
File "main.py", line 217, in async_get_encrypted_url
KeyError: 'trackInfo'
[8260] Failed to execute script 'console-version' due to unhandled exception!

breadcrumbs.ts:111

   [Player Error] player catch error:  Error: innert Error: errorCode: 0; errorMsg: 当前的声音的地址无效

是不是下载太多了,然后当天就封了

[Player Error] player catch error: 今天操作太频繁啦,可以明天再试试哦~

登录状态获取的playurl,有效期有多久?

我是有声书的爱好者,刚接触这个仓库,非常感谢作者提供这么好的下载器
有个问题,想要咨询下:
vip的playurl在不登录的状态下是无法显示的,登录的话,则可以。问题是我看到的链接是类似这样的:

'https://audiopay.cos.tx.xmcdn.com/download/1.0.0/storages/3d1d-audiopay/61/36/GKwRIaII1YUAABvQ_QJZR-0a.mp3?sign=3d7dd35f68c19d40ed2f44af34b3956c&buy_key=FM&timestamp=1709656534549000&token=5078&duration=455'

看到资源后缀加入了一些参数,看着很像是token之类的东西

就是不清楚,这种预览链接是否有有效期呢?有效期有多久?

专辑内容数量过多时会出现并发问题

我这边下载的专辑大概2000条 初始化就会创建99条 99条并发宽带支撑不住 下载5条成功后直接后面的全部下载失败,再次尝试下载,直接提示下载失败

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.