【免費註冊】 【會員登入】 【個人資料】 【會員列表】 【論壇幫助】 【論壇搜尋】 【登出論壇】

∮Ω奧米加空間∮
∮Ω奧米加空間∮»技術文件區»【教學】Tidal mqa flac 下載

訂覽該主題更新消息 | 將該主題推薦給朋友 發表新主題 發起投票  回覆
作者 主題     分頁:[ 1 2 ]
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 1 篇) 【教學】Tidal mqa flac 下載

Tidal 是高品質的串流音樂網站,支援 MQA 編碼格式。
Tidal APP 可以離線下載撥放,但是每隔一段時間就需要重新驗證一次才能繼續撥放離線音樂。

想說找一下有沒有離線下載的程式沒想到還真的有@@

Google 找到的版本比較舊
https://www.androidbrick.com/how-to-download-tidal-mqa-albums/

建議直接到他的 GitHub 找最新版
https://github.com/yaronzz/Tidal-Media-Downloader

中文的安裝文檔在這裡
https://yaronzz.com/post/tidal_dl_installation_chn/

tidal-gui 請下載 1.2.0.5 版本,因為最新版 1.2.0.6 無法正常下載檔案
https://github.com/yaronzz/Tidal-Media-Downloader-PRO/releases

Linux下安裝: pip3 install tidal-dl --upgrade

Mac OS 下安裝:
brew instal ffmpeg
brew install python
curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
pip3 install --upgrade tidal-dl
tidal-dl

Android 下安裝:
a). 安裝 termux:https://play.google.com/store/apps/details?id=com.termux
b). 開啟權限:termux-setup-storage
c). 安裝 python 和 tidal-dl
pkg install python clang libjpeg-turbo ffmpeg zlib -y
apt update
apt upgrade
pkg update
pip3 install --upgrade pip
pip3 install --upgrade tidal-dl
tidal-dl


初學者建議選擇 GUI 介面來使用
請先登入 Tidal 之後開啟 tidal-gui.exe 到設定裡 AccessToken 這裡按下 Try Get 取得目前登入 Tidal 的 Token 後才能下載最高音質的 Master


回到 Tidal 選擇專輯的中間 ... 按一下滑鼠左鍵


選擇 Share -> Copy Alburm Link


將 連結 貼到搜尋框按下輸入鍵就可以找到專輯,勾選後音質可選 Master 後按下 Download 下載


就能看到下載的 mqa 音樂囉



如果使用海貝的撥放器,可以使用海貝APP來播放 mqa 的 flac 檔案。


從 Tidal 下載的檔案不需要這一步,但是其他的 mqa 檔案如果無法正常解碼的話需要使用這套軟體
MQA TAG RENAMING APPLICATION
https://www.mqa.co.uk/tag435sdf43te

將 mqa 格式的 flac 檔案拉進來,他會在該目錄下建立一個 MQA 的資料夾,是打上 MQA TAG 的檔案。
可以再將裡面的檔案拿來撥放看看~





本帖由dc最後編輯於2021-12-06 22:03

Your mind to my mind,

your thought to my thought
發表時間:2020-11-08 14:21
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:114.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 2 篇)

Hiby R6 Pro 可以解 8 倍 352.8




Hiby New R6 可以解 16 倍 705.6








Your mind to my mind,

your thought to my thought
發表時間:2020-11-17 13:40
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:118.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 3 篇)

在 Centos7 底下的教學

事先要安裝 gcc
yum install gcc -y

安裝主程式
>>pip3 install tidal-dl --upgrade

>>tidal-dl

/$$$$$$$$ /$$       /$$           /$$               /$$ /$$
|__  $$__/|__/      | $$          | $$              | $$| $$
   | $$    /$$  /$$$$$$$  /$$$$$$ | $$          /$$$$$$$| $$
   | $$   | $$ /$$__  $$ |____  $$| $$ /$$$$$$ /$$__  $$| $$
   | $$   | $$| $$  | $$  /$$$$$$$| $$|______/| $$  | $$| $$
   | $$   | $$| $$  | $$ /$$__  $$| $$        | $$  | $$| $$
   | $$   | $$|  $$$$$$$|  $$$$$$$| $$        |  $$$$$$$| $$
   |__/   |__/ \_______/ \_______/|__/         \_______/|__/
  
       https://github.com/yaronzz/Tidal-Media-Downloader

                      v2020.12.10.0
+-----------------------+------------------------------------------------------------+
| SETTINGS              | VALUE                                                      |
+-----------------------+------------------------------------------------------------+
| Settings path         | /xxxx                                                      |
| Download path         | ./download/                                                |
| Convert mp4 to m4a    | False                                                      |
| Audio quality         | AudioQuality.Normal                                        |
| Video quality         | VideoQuality.P360                                          |
| Check exist           | True                                                       |
| Show progress         | True                                                       |
| Include single&ep     | True                                                       |
| Save covers           | True                                                       |
| Language              | English                                                    |
| Use playlist folder   | True                                                       |
| Multi thread download | True                                                       |
| Album folder format   | {ArtistName}/{Flag} {AlbumTitle} [{AlbumID}] [{AlbumYear}] |
| Track file format     | {TrackNumber} - {ArtistName} - {TrackTitle}{ExplicitFlag}  |
+-----------------------+------------------------------------------------------------+
Starting login process...
Your login code is ABCDE
Go to link.tidal.com within the next 5 minutes to complete setup.
Waiting for authorization...

開啟瀏覽器連結到 https://link.tidal.com 先輸入自己的帳號與密碼登入 tidal 會到下面的畫面,請輸入上面給的 code ABCDE


登入成功的畫面


[SUCCESS] AccessToken good for 1 week.
====================================================
CHOICE                 FUNCTION                    
Enter '0':             Exit                        
Enter '1':             Check AccessToken            
Enter '2':             Settings                    
Enter '3':             Logout                      
Enter '4':             Set AccessToken              
Enter 'Url/ID':        Download by url or id        
====================================================
Enter Choice:

我們先輸入 2 來修改設定值
Start settings('0'-Return,'1'-Yes):1
Download path('0' not modify):設定你要放置下載檔的路徑
Audio quailty('0'-Normal,'1'-High,'2'-HiFi,'3'-Master):3
Video quailty('0'-1080,'1'-720,'2'-480,'3'-360):0
Convert mp4 to m4a('0'-No,'1'-Yes):0
Check exist file before download track('0'-No,'1'-Yes):1
Include singles and EPs when downloading an artist's albums('0'-No,'1'-Yes):1
Save covers('0'-No,'1'-Yes):1
Show progress('0'-No,'1'-Yes):1
Select language('0'-English,'1'-中文,'2'-Turkish,'3'-Italiano,'4'-Czech,'5'-Arabic,'6'-Russian,'7'-Filipino,'8'-Croatian,'9'-Spanish,'10'-Portuguese,'11'-Ukrainian,'12'-Vietnamese,'13'-French,'14'-German):0
Album folder format('0' not modify,'default' to set default):0
Track file format('0' not modify,'default' to set default):0
====================================================
CHOICE                 FUNCTION                    
Enter '0':             Exit                        
Enter '1':             Check AccessToken            
Enter '2':             Settings                    
Enter '3':             Logout                      
Enter '4':             Set AccessToken              
Enter 'Url/ID':        Download by url or id        
====================================================

設定完畢後輸入要抓的歌連結就能下載囉
Enter Choice:https://tidal.com/browse/album/156764950
+----------------+---------------------------------+
| ALBUM-PROPERTY | VALUE                           |
+----------------+---------------------------------+
| Title          | Born To Be Alive (feat. Chlara) |
| ID             | 156764950                       |
| Track Number   | 1                               |
| Video Number   | 0                               |
| Release Date   | 2020-10-02                      |
| Version        | None                            |
| Explicit       | False                           |
+----------------+---------------------------------+
100%|▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓| 48.91/48.91 mb
[SUCCESS] 01 - Eldissa - Born To Be Alive (feat. Chlara).flac

AccessToken 只能保留一周~目前看只能一個一個下載~無法讀取文字檔清單來下載






Your mind to my mind,

your thought to my thought
發表時間:2020-12-11 14:17
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:118.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 4 篇)

目前最新的版本下載有點問題

version 1.2.1.8
"For some reasons, this version only supports LOSSLESS"

主要是因為原本五月份只在澳洲推出的方案,已經推廣到全部的地區~目前只能等作者更新了~

Premium - $11.99 AUD a month with standard sound quality (320 Kbps)

HiFi - $17.99 AUD a month with lossless High Fidelity sound quality (1411
Kbps)

HiFi Plus - $23.99 AUD a month with lossless High Fidelity sound quality
(1411 Kbps), Master Quality audio (up to 9216 Kbps), and immersive audio -
360 Reality Audio, Dolby Atmos Music

翻譯文章
https://www.sabrehifi.com/2021/05/tidalmqa.html

2021年5月4日 星期二
Tidal宣布新的價格變動:MQA現在以高價出售
Tidal; 它最近在三月份被Jack Dorsey的Square公司以2.97億美元的價格收購,它宣布了新的定價方案,讓您以更少的錢選擇退出MQA。

我們知道Spotify HiFi將對數位音樂串流媒體產生重大影響,現在我們終於開始看到,所有主要的串流媒體服務都將發生重大變化。Jack Dorsey的Square公司今年3月以2.97億美元的價格收購了Tidal公司大部分股份。該公司宣布了新的定價方式,這些定價方式最初在澳洲市場推出。

我們希望今年於北美看到這些新的定價方案,因此,有趣的是看看訂戶如何反應以及哪個串流方案成為最受歡迎的方案。

最大的變化是Tidal現在提供了一個新的串流傳輸方案,該方案將無損CD品質(HiFi)與Hi-Res MQA / Dolby Atmos / Sony 360 Reality Audio (HiFi Plus)區分開。

Spotify HiFi並非高解析串流媒體,但很顯然,Tidal的新主人可以在這見樹又見林。高解析音訊佔其串流媒體庫的比例不到10%,如果對此格式不感興趣的人,或者根本沒有設備可以從中受益,為什麼要推銷高解析MQA來阻擋潛在的訂閱者。

即使有新的DAC提供了從其“音效”中受益所需的展開和渲染技術,發燒友也不一定會購買MQA。

現實情況是,Qobuz提供了大量沒有MQA的高解析音樂庫,並且價格(目前暫未波動)使其看起來似乎更好。

Tidal的新的三層價格結構現在包括以下選擇:

Premium – 每月$11.99澳元,標準音質(320 Kbps)
HiFi – 每月$17.99澳元,無損高傳真音質(1411 Kbps)
HiFi Plus – 每月$23.99澳元,提供無損 Hi-Res(1411 Kbps)、Master Quality 音訊 (高達9216 Kbps) 和身臨其境的音訊 – Sony 360 Reality Audio 和 Dolby Atmos Music
因此,如果您不關心Hi-Res的無損問題,則可以選擇每月減少$6的HiFi,而不必在24/96、MQA上猶豫難以選擇,也無需要求該技術並能享受Tidal現有90%的音樂庫服務。

有趣的是,會有多少人決定選擇退出支持MQA並保留無損CD音質的現有串流傳輸方案。

資料來源:ecoustics




關於升級後的音質可以看這裡說明
https://support.tidal.com/hc/en-au/articles/360002599997-What-Audio-Quality-Do-TIDAL-HiFi-Plans-Offer-



目前的版本只支援 LOSSLESS 可以對照上圖,主要是方案改變了。

本來只在 澳洲 推出的方案,已經推廣到所有地區
https://www.engadget.com/tidal-free-streaming-plan-artist-paymetns-royalties-153606001.html


中文可以看這裡
https://3c.ltn.com.tw/news/46731

Tidel 推出 HiFi Plus 超高品質音樂服務!付費用戶自動升級
2021/11/20 13:09
3C科技頻道/綜合報導

無損音樂串流平台 Tidal 宣布,將修改原先的會員等級制度,並新增免費會員試用,並免費升級 HiFi 會員

原先的「Premium」會員將免費升級成「HiFi」會員,從原本提供的 320kbps 音質直接升級為 1411kbps 的 CD 等級音樂,而原本的「HiFi」用戶則升級成「Tidal HiFi Plus」,有超高音質的 MQA 音樂、最高 9,216kbps 超高音質,及杜比全景聲、Sony 360 空間音訊等服務。

比起付費會員,免費會員將有幾個限制,包括廣告推送、串流音質最高限制 160kbps、無法離線收聽、跳歌字數限制等,類似於 Spotify 的免費會員。

另外,Tidal 還宣布兩個全新服務,其一為「以藝人為中心的版稅」及「粉絲為本的版稅」,前者 Tidal 將收取訂閱者會費的 10%,並直接提供給與 Tidal 簽約的藝人,當藝人製作的音樂越多,那他們也能從 10% 的會員費得到更多。而後者則為藝人的粉絲聆聽數量越多,分絲喜愛的藝人也能獲得更多的報酬。

Tidal 宣佈以上兩種服務最快將於 2022 年 1 月上線,而會員更動則是從今日開始實施。


我的訂閱也是在 20 號時 由 HiFi 自動升級到 HiFi Plus 價格不變。
幣別是阿根廷 換算台幣約 40 元


音質分別如下





本帖由dc最後編輯於2021-11-24 10:46

Your mind to my mind,

your thought to my thought
發表時間:2021-11-24 10:45
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:118.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 5 篇)

版本更新
v2021-11-30
- [x] Add language:Japanese
- [x] Support select apikey(Different keys support different formats)
翻譯
- [x] 添加語言:日語
- [x] 支援選擇 apikey(不同 key 支持不同格式)

多了一項 Select APIKey ,如果要跟以前一樣下載 Master MQA 檔案的話請選 1

升級指令
pip3 install tidal-dl --upgrade


====================================================
CHOICE                 FUNCTION                    
Enter '0':             Exit                        
Enter '1':             Check AccessToken            
Enter '2':             Settings                    
Enter '3':             Logout                      
Enter '4':             Set AccessToken              
Enter '5':             Select APIKey                
Enter 'Url/ID':        Download by url or ID        
====================================================
Enter Choice:5
[INFO] Current APIKeys: 0 Fire TV-Normal/High/HiFi(No Master)
-------------API-KEYS---------------
+-------+------------+-----------------------------+
| Index | Platform   | Formats                     |
+-------+------------+-----------------------------+
| 0     | Fire TV    | Normal/High/HiFi(No Master) |
| 1     | Fire TV    | Master-Only(Else Error)     |
| 2     | Android TV | Normal/High/HiFi(No Master) |
+-------+------------+-----------------------------+
APIKEY index:1
Starting login process...
Your login code is xxxxx
Go to link.tidal.com within the next 5 minutes to complete setup.
Waiting for authorization...
[SUCCESS] AccessToken good for 1 week.


預設
APIKey support,Normal/High/HiFi(No Master)
APIKEY 改成 1 之後會是
APIKey support,Master-Only(Else Error)




本帖由dc最後編輯於2022-01-25 15:45

Your mind to my mind,

your thought to my thought
發表時間:2021-12-02 14:54
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:118.*.*.* 編輯  引言回覆 
Jude Lai
註冊會員



性別:男
來自:
發表總數:1
註冊時間:2021-12-06 12:47
(第 6 篇) 【求助】

板主您好想請教我有點看不懂如何在MAC下安裝不知道是否可以教教我?感激不盡




發表時間:2021-12-06 12:55
Jude Lai的個人資料 傳送郵件給Jude Lai Jude Lai發表的所有文章 送出悄悄話給Jude Lai IP:114.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 7 篇)


Jude Lai在大作中提到:
板主您好想請教我有點看不懂如何在MAC下安裝不知道是否可以教教我?感激不盡


中文的安裝文檔在這裡,第一篇 文章連結已修正。
https://yaronzz.com/post/tidal_dl_installation_chn/






Your mind to my mind,

your thought to my thought
發表時間:2021-12-06 22:05
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:114.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 8 篇)

版本更新
v2022-01-21
Update api key from @morguldir
Remove bug of 'No module named 'importlib.metadata'
翻譯
更新 api 密鑰 來自 https://github.com/morguldir
移除 'No module named 'importlib.metadata' 的臭蟲

升級指令
pip3 install tidal-dl --upgrade


====================================================
CHOICE                 FUNCTION                    
Enter '0':             Exit                        
Enter '1':             Check AccessToken            
Enter '2':             Settings                    
Enter '3':             Logout                      
Enter '4':             Set AccessToken              
Enter '5':             Select APIKey                
Enter 'Url/ID':        Download by url or ID        
====================================================
Enter Choice:5
[INFO] Current APIKeys: 1 Fire TV-Master-Only(Else Error)
-------------API-KEYS---------------
+-------+-------+------------+-----------------------------+
| Index | Valid | Platform   | Formats                     |
+-------+-------+------------+-----------------------------+
| 0     | False | Fire TV    | Normal/High/HiFi(No Master) |
| 1     | True  | Fire TV    | Master-Only(Else Error)     |
| 2     | False | Android TV | Normal/High/HiFi(No Master) |
| 3     | True  | TV         | Normal/High/HiFi/Master     |
+-------+-------+------------+-----------------------------+
APIKEY index:3
Starting login process...
Go to http://link.tidal.com/xxxx within the next 5 minutes to complete setup.
Waiting for authorization...
[SUCCESS] AccessToken good for 1 week.

APIKEY 改成 3 之後會是
APIKey support,Normal/High/HiFi/Master
全版本都能下載不用再切換了~例如下列

Inmune - Andrea López - 2022 MASTER 版本
https://tidal.com/browse/album/210177481

FM Igualdad - Ilan Amores - 2022 一般音質版本
https://tidal.com/browse/album/209191110




本帖由dc最後編輯於2022-01-25 15:45

Your mind to my mind,

your thought to my thought
發表時間:2022-01-25 15:43
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:203.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 9 篇)

APIKEY  3 目前失效了會出現
[ERR] Device authorization failed. Please try again
只剩 1 可以使用
1     | True  | Fire TV    | Master-Only(Else Error)     |

暫時可以使用這個方案替代
https://github.com/DDKnoll/Tidal-Media-Downloader

安裝方式
pip3 uninstall tidal-dl
git clone https://github.com/DDKnoll/Tidal-Media-Downloader.git DDKnoll-tidal
cd DDKnoll-tidal/TIDALDL-PY
pip3 install -r requirements.txt --user

先安裝的話會遇到下載專輯錯誤1
[http @ 0x56362f817de0] Protocol 'http' not on whitelist 'file,crypto'!
需更新白名单: -protocol_whitelist "http,file,crypto"
編輯 util.py
~/DDKnoll-tidal/TIDALDL-PY# vi tidal_dl/util.py

process = ffmpeg.input(mpdPath, hide_banner=None, y=None).output(path, acodec='copy', loglevel='error').run();
改為
process = ffmpeg.input(mpdPath, hide_banner=None, y=None, protocol_whitelist="tcp,http,file,crypto").output(path, acodec='copy', loglevel='error').run();

python3 setup.py install

~/DDKnoll-tidal/TIDALDL-PY# tidal-dl

會沿用之前 Tidal-Media-Downloader 的設定

錯誤2 暫時未解決
dash @ 0x555ad70159c0] Error when loading first fragment, playlist 0

網友 nobodyexpectsahistorian 說可能是我的 ffmpeg 版本太低 我是 3.x版 他是 4.3.x

使用 APIKEY 1 來登入 tidal , 因為是 Master-Only 所以下載 mqa 的歌曲是使用 tidal-dl 原來的程式下載,只有非 mqa 的歌曲是呼叫 ffmpeg 來下載與mdp轉檔flac


還有分析也很棒
SageSyS 提問
@nobodyexpectsahistorian I've tried both OrpheusDL-Tidal and @DDKnoll 's Pull request and the difference is that reported bitrates are higher on OrpheusDL (as well as the file size by the whole megabyte) but when I compare audio files (spectrums) - they're 100% the same, any explanation?

nobodyexpectsahistorian 回覆
Good question! Short answer: I have no clue …

I can absolutely see what your are talking about. We can produce three "different" files: 1. Downloaded by orpheusdl: biggest in file size, highest bitrate 2. Downloaded by tidal-dl with orpheus-code to parse the mpd-information and 3: Downloaded with tidal-dl and DDKnoll's code using ffmpeg for essentially everything. The last two files are nearly identical, although DDKnoll's files are usually slightly (~100Bytes) smaller then files produced by method 2. The bitrate is generally identical for 2 and 3.

I tend to think that the differences in file size and bitrate originate from the ffmpeg-conversion and/or the way tags and cover art is added since the source files after downloading and concatenation are bit-identical for method 1 and 2 but the end result is quite different. For method 3 there is no original source file since ffmpeg not only downloads it but does the conversion in the same step, so no luck comparing there. Whether or not these differences are of any concern regarding audio quality is beyond my understanding. I have also not enough experience with ffmpeg or audio/video-files-formats in general to understand what happens there "behind the curtain" and why the results can differ.

One other note: These files downloaded with any of the "new" methods all differ from the files that were previously directly available from tidal, although files downloaded via methods 2/3 generally only differ at ~100 bytes in file size and are (nearly) identical in bitrate.

I am not sure, if this helps …




本帖由dc最後編輯於2022-02-05 02:08

Your mind to my mind,

your thought to my thought
發表時間:2022-02-04 17:55
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:114.*.*.* 編輯  引言回覆 
dc
管理員



性別:男
來自:瓦肯星
發表總數:10296
註冊時間:2002-05-07 16:32
(第 10 篇)

官方新增了 apikey 4 可以原版的 tidal-dl 下載歌曲囉~

有使用第 9 篇替代方案的記得要先反安裝
pip3 uninstall tidal-dl

再重新安裝原版的 tidal-dl
pip3 install tidal-dl --upgrade

並修改 apikey 為 4
====================================================
CHOICE                 FUNCTION                    
Enter '0':             Exit                        
Enter '1':             Check AccessToken            
Enter '2':             Settings                    
Enter '3':             Logout                      
Enter '4':             Set AccessToken              
Enter '5':             Select APIKey                
Enter 'Url/ID':        Download by url or ID        
====================================================
Enter Choice:5
[INFO] Current APIKeys: 3 TV-Normal/High/HiFi/Master
[INFO] Current Version: 1.0.1 GIST
-------------API-KEYS---------------
+-------+-------+--------------+-----------------------------+
| Index | Valid | Platform     | Formats                     |
+-------+-------+--------------+-----------------------------+
| 0     | False | Fire TV      | Normal/High/HiFi(No Master) |
| 1     | True  | Fire TV      | Master-Only(Else Error)     |
| 2     | False | Android TV   | Normal/High/HiFi(No Master) |
| 3     | False | TV           | Normal/High/HiFi/Master     |
| 4     | True  | Android Auto | Normal/High/HiFi/Master     |
+-------+-------+--------------+-----------------------------+
APIKEY index:4
Starting login process...
Go to http://link.tidal.com/xxxx within the next 5 minutes to complete setup.
Waiting for authorization...
[SUCCESS] AccessToken good for 1 week.

一般音質 OK
https://tidal.com/browse/album/149438658
MQA OK
https://tidal.com/browse/album/50593975

這次 apikey 失效是因為被官方封了~

那要自己取得 apikey 該如何做呢?


首先在不使用第三方工具的狀況下我們可以很簡單的取得 AccessToken 資料來源 https://www.yaronzz.com/post/get_accesstoken/
只節錄 Tidal Android 的部分

。AccessToken is a key to get the track\video streamurl.
AccessToken from Tidal Desktop: Support MQA Flac, can’t download 360\Dobly
AccessToken from Tidal Android: Support all
AccessToken from Tidal IOS: Can’t download Flac

。How to use AccessToken.
For tidal-dl: Open tidal-dl and Enter 10 to set AccessToken
For tidal-gui: Open file tidal-ini and add a key “accesstoken=xxxxxxxxx” (xxxxxxx is your AccessToken)

。Get AccessToken from Tidal Android
1.Login Tidal Android and play a track
2.With any file explorer, go to /sdcard/Android/data/com.aspiro.tidal/cache/okhttp

3.Open a file in the folder and Find the ‘Authorization: Bearer’ very_long_key (At the beginning of the file)
very_long_key is what you need to copy/paste, if the file not contain the ‘Authorization: Bearer’, open another file.


但這只是取得  track\video streamurl 使用而已,下載的話需要 apikey 才行~不過是加密的需要解密


要解密的 APIKey 請參考 資料來源 https://gist.github.com/charleywright/59c14e083177619d8cc9630d7f468690
These are some things I have reversed relating to TIDAL's auth
scrape.sh
代碼:

#!/bin/bash
if ! command -v apktool &> /dev/null; then
  echo "apktool Must be installed"
  exit
fi

APK=$(ls | grep .apk | head -1)
if [ -z "$APK" ]; then
  echo "APK must be in this directory"
  exit
fi

echo "Unpacking APK..."
apktool -f d "$APK" &> /dev/null
echo "APK Unpacked"
STRING_PATHS=$(find "$(echo $APK | rev | cut -c5- | rev)" | grep strings.xml)
KNOWN_IDS=()
for STRING_PATH in $STRING_PATHS; do
  CLIENTS=$(grep -E 'client_(id|secret)' $STRING_PATH)
  CLIENT_TYPES=$(echo $CLIENTS | grep -Po '[a-z_]+(?=(_client_id))')
  for CLIENT in $CLIENT_TYPES; do
    KNOWN=""
    for i in "${KNOWN_IDS[@]}"; do
      if [ "$i" = "$CLIENT" ]; then
        KNOWN="1"
      fi
    done
    if [ "$KNOWN" = "" ]; then
      KNOWN_IDS+=("$CLIENT")
      ID=$(echo $CLIENTS | grep -Po "(?<=(${CLIENT}_client_id\">))[a-zA-Z0-9=\.\-]+")
      SECRET=$(echo $CLIENTS | grep -Po "(?<=(${CLIENT}_client_secret\">))[a-zA-Z0-9=\.\-]+")
      DEVICE_RES=$(curl --silent --request POST "https://auth.tidal.com/v1/oauth2/device_authorization" --header "Content-Type: application/x-www-form-urlencoded" --data-urlencode "scope=r_usr+w_usr+w_sub" --data-urlencode "client_id=$ID")
      if [[ $DEVICE_RES != *"invalid_client"* ]]; then
        DEVICE_SUPPORT="true"
        if [[ $DEVICE_RES == *"Limited Input Device"* ]]; then
          DEVICE_SUPPORT="false"
        fi
        if [ ! -z "$SECRET" ]; then
          printf "\nClient: $CLIENT\nID: $ID\nSecret: $SECRET\nDevice Auth: $DEVICE_SUPPORT\n"
        fi
      fi
    fi
  done
done

App Keys
Extracting them from the android APK - Thanks to @1nikolas for the idea

Using my script
1.Get a version of the APK. It can be downloaded from APK Mirror or extract it from a device after downloading it from the play store.
2.Put the APK in the same directory as the script
3.Mark the script as executable: chmod +x ./scrape.sh and run it: ./scrape.sh

Using APKTool
1.Get a version of the APK. It can be downloaded from APK Mirror or extract it from a device after downloading it from the play store.
2.Decompress the APK: apktool x Path_To_Apk
3.Open the folder with the same name as the APK, the go to res/values/strings.xml
4.Search for client_id or client_secret
5.Test if they are valid. Make this request and check the response. If it creates a deviceCode, the client is valid and supports device auth. If the response says something like Client with clientId[5121] is not a Limited Input Device client then the client is valid, but doesn't support device auth. If the response says Client with token ... not found then the client is invalid (it might be used by a different endpoint, need to do more testing)

。Encryption
Some tidal files are encrypted, their manifest looks like this:

{
    "mimeType": "audio/flac",
    "codecs": "flac",
    "encryptionType": "OLD_AES",
    "keyId": "Qws5RDZdr6Ak4kwFJ0QhhjwrPvEvjvJdFqX4t9oBGh1TK6u0m1xdN86yxfd9UCM6hfuIrpKr9q1ra51nQp/slA==",
    "urls": [
        "https://sp-pr-fa.audio.tidal.com/mediatracks/CAE..."
    ]
}
Master key base64 encoded is UIlTTEMmmLfGowo/UC60x2H45W6MdGgTRfo/umg4754=

The decryption goes like this:

Get keyId bytes by base64 decoding it
Get keyIV using the first 16 bytes of keyId
Decrypt the rest of the keyId bytes using AES-CBC, the master key and keyIV
This will produce 32 bytes like this 210fc7bb818639ac48a4c6afa2f1581a7200969bf0a5e5740000000000000000 which contains 3 values, the key, nonce, & counter. The key bytes 1-16, nonce is 17-24, counter is 25-32
Decrypt the song using AES counter mode, the key, nonce & counter
Full example in JS

// manifest is the manifest object, song is an ArrayBuffer with the song in it
let keyId = atob(manifest.keyId);
let tidalMasterKey = await window.crypto.subtle.importKey(
  "raw",
  Buffer.from("UIlTTEMmmLfGowo/UC60x2H45W6MdGgTRfo/umg4754=", "base64"),
  { name: "AES-CBC" },
  false,
  ["decrypt"]
);
const track_cfg = await window.crypto.subtle.decrypt(
  { name: "AES-CBC", iv: keyId.slice(0, 16) },
  tidalMasterKey,
  keyId.slice(16)
);
const ctr_key = await window.crypto.subtle.importKey(
  "raw",
  track_cfg.slice(0, 16),
  { name: "AES-CTR" },
  false
  ["decrypt"]
);
const decrypted_song = await window.crypto.subtle.decrypt(
  {
    name: "AES-CTR",
    counter: track_cfg.slice(16),
    length: 64,
  },
  ctr_key,
  song
);
Note: When callling window.crypto.subtle.decrypt with AES-CTR, the counter param takes both the nonce and the counter. See here for more details.

白話來說我們要使用 Apktool 來解密 tidal apk 取得 apikey 使用 Linux 的範例教學

安裝 Apktool 資料來源 https://ibotpeaches.github.io/Apktool/install/
Linux:
1.Download Linux wrapper script (Right click, Save Link As apktool)
2.Download apktool-2 (find newest here)
3.Rename downloaded jar to apktool.jar
4.Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
5.Make sure both files are executable (chmod +x)
6.Try running apktool via cli

下載 wrapper script
wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool
下載 apktool-2 我們選最新的 apktool_2.6.0.jar 並更名為 apktool.jar
wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.6.0.jar -O apktool.jar
將我們抓下來的 apktool 與 apktool.jar 加上執行的權限,並且搬移到 /usr/local/bin 底下,需要 root 權限
chmod +x apktool; chmod +x apktool.jar;mv apktool /usr/local/bin; mv apktool.jar /usr/local/bin; ls -l /usr/local/bin/apktool*
回覆這樣代表檔案位置正確了~
-rwxrwxrwx 1 root root     2320 Feb  7 02:45 /usr/local/bin/apktool
-rwxrwxrwx 1 root root 19964258 Sep  2 11:07 /usr/local/bin/apktool.jar
接下來執行 apktool 如果出現如下是因為沒有安裝 java
/usr/local/bin/apktool: line 77: exec: java: not found
安裝 java
apt install default-jre
檢查版本 java -version 沒問題後再執行一次 apktool 出現
Apktool v2.6.0 - a tool for reengineering Android apk files
就是安裝成功囉~

接下來我們到 APK Mirror 取得 tidal apk 檔案
https://www.apkmirror.com/apk/tidal/tidal-tidal/

我們選擇 2022/1/27 的版本下載
TIDAL Music - Hifi Songs, Playlists, & Videos 2.54.0
January 27, 2022 GMT+0800
要下載 apk 版本不是 apkm 喔
https://www.apkmirror.com/apk/tidal/tidal-tidal/tidal-tidal-2-54-0-release/tidal-music-hifi-songs-playlists-videos-2-54-0-android-apk-download/
com.aspiro.tidal_2.54.0-1052_minAPI23(arm64-v8a,armeabi-v7a,x86,x86_64)(nodpi)_apkmirror.com.apk


在 apk 檔案同一個路徑下
vi scrape.sh
將內容貼上去然後給予執行的權限
chmod +x ./scrape.sh
再來執行
./scrape.sh
會解密 apk 並且取得 api key 紅色那一組就是我們需要的 api key

Unpacking APK...
APK Unpacked

Client: bits
ID: GzkAnGAH9GluAKST
Secret: T1BT0rHy4KGrqZ1
Device Auth: false

Client: default_automotive
ID: zU4XHVVkc2tDPo4t
Secret: VJKhDFqJPqvsPVNBV6ukXTJmwlvbttP7wlMlrc72se4=
Device Auth: true


Client: default_clear
ID: 03Gxi46ezfOR9VYx
Secret: my2p5AKqYfMp2zXulKnqX0jlXtsLNnT6xybFvf3Q3xA=
Device Auth: false

Client: default_clear_dolby_atmos
ID: O8m8TenhETTs1ePw
Secret: GbJfUmIV5FdWLj1ppuc47q6G803QXq96cU3EnFAE6xc=
Device Auth: false

Client: default
ID: pSoioUnTRTmHJune
Secret: LEyNG8kf8rNxsmV5FGgO47uOwsNW8SroHpmSOrirObE=
Device Auth: false

Client: default_dolby_atmos
ID: eMgw0HZqwX7Gffvj
Secret: uYKrLzAwLf7N8401Nl62Y37FKdtx93tHIh9sTK9mkUA=
Device Auth: false

Client: default_tv
ID: COFVfUXkiLTN3lAe
Secret: DzcOwwEiEWPtMj4RXQ4Y2EwGIKWMGiV05KCQuqhXdzU=
Device Auth: true

Client: default_tv_dolby_atmos
ID: N0MuL7eBEFb5hGX8
Secret: hpYPlIdiel3xWXtDYRLzGJJIST55yjWuMXKxR9nAjQo=
Device Auth: true

Client: facebook_portal_mini
ID: KDNEfww06haSofNC
Secret: ognkmDdzAk2G2fMh1hiVfzlaQLkdEttBqNOA8qhpuQs=
Device Auth: true

Client: fire_tv
ID: rrkl9M8MdqYVFpA2
Secret: lRMtLxD2XJseOhMufg9PrkiE7YszQhqzBCFQ7FLiKrA=
Device Auth: true

Client: fire_tv_dolby_atmos
ID: 7m7Ap0JC9j1cOM3n
Secret: vRAdA108tlvkJpTsGZS8rGZ7xTlbJ0qaZ2K9saEzsgY=
Device Auth: true

Client: free_tier
ID: jo0MWwLMMvMIrBia
Secret: YsYOQIqRWua2vMPjNW2kBeiGErnjF5WioR9uCG5dXqM=
Device Auth: false


修改 api Key.py
vi /usr/local/lib/python3.6/dist-packages/tidal_dl/apiKey.py

使用這個 setup.py
https://github.com/DDKnoll/Tidal-Media-Downloader/blob/master/TIDALDL-PY/setup.py
代碼:

from setuptools import setup, find_packages
from tidal_dl.printf import VERSION

setup(
    name='tidal-dl',
    version=VERSION,
    license="Apache2",
    description="Tidal Music Downloader.",

    author='YaronH',
    author_email="yaronhuang@foxmail.com",

    packages=find_packages(exclude=['tidal_gui*']),
    include_package_data=False,
    platforms="any",
    install_requires=["aigpy>=2022.01.20.1", "requests>=2.22.0",
                      "pycryptodome", "pydub", "prettytable", "lyricsgenius", "ffmpeg-python"],
    entry_points={'console_scripts': ['tidal-dl = tidal_dl:main', ]}
)

因為修改了 apiKey.py 要重新安裝才能吃進去
python3 setup.py install
會有錯誤 因為沒有將 https://github.com/yaronzz/Tidal-Media-Downloader 抓到本地來安裝
待下次 apikey 失效再來修改~




本帖由dc最後編輯於2022-02-08 12:17

Your mind to my mind,

your thought to my thought
發表時間:2022-02-07 12:06
dc的個人資料 傳送郵件給dc dc的個人首頁 dc發表的所有文章 送出悄悄話給dc IP:203.*.*.* 編輯  引言回覆 
所有時間均為GMT+8, 現在是2022-11-29 03:27     分頁:[ 1 2 ]
訂覽該主題更新消息 | 將該主題推薦給朋友 發表新主題 發起投票  回覆

快速回覆
主題 ( 回覆文章可以不輸入標題 )
URLs自動分析
有回覆時郵件通知
禁用表情符號
使用簽名

<聯絡我們 - OMEGA - 控制面板>

Powered by Centaur & Joksky & DC, ver 2003.08.14
Copyright ©2002-2008 PHPY.COM


頁面生成時間:0.02391505241394