Compare commits

...

13 Commits

Author SHA1 Message Date
Dniel97
14305d3a68 Merge branch 'develop' 2024-02-20 13:35:56 +01:00
Dniel97
95174458e2 Hotfix for HiFi subscriptions 2024-02-20 13:35:48 +01:00
Dniel97
9e29b24ef1 Merge branch 'develop' 2024-02-12 21:42:09 +01:00
Dniel97
15a232f4d4 Updated readme for HiRes 2024-02-12 21:41:45 +01:00
Dniel97
633d7cc9fc Merge remote-tracking branch 'origin/master' into develop 2024-02-12 21:24:29 +01:00
Daniel
e8d953737d Merge pull request #53 from hell001/master
Update README.md
2024-02-12 21:22:00 +01:00
Daniel
f63b9162fa Merge pull request #55 from uhwot/spatial-codec-rework
rework spatial codec handling
2024-01-04 14:02:11 +01:00
uh wot
ffff53f427 remove 'force_non_spatial' setting from README 2024-01-04 13:52:26 +01:00
uh wot
3e6b2d1d3c rework spatial codec handling 2024-01-04 13:34:38 +01:00
hell001
aa8eea1dc9 Update README.md 2023-12-31 16:07:50 -05:00
Daniel
48d218f55c Merge pull request #50 from uhwot/session-selection-fix
fix session selection
2023-11-24 23:12:26 +01:00
uh wot
bd660e0102 change mobile default client id to DefaultHiResClientId 2023-11-24 15:37:31 +01:00
uh wot
458edd2582 fix session selection for atmos + hires tracks 2023-11-24 15:33:56 +01:00
2 changed files with 51 additions and 50 deletions

View File

@@ -87,7 +87,7 @@ loaded module. You'll find the configuration file here: `config/settings.json`
"global": {
"general": {
// ...
"download_quality": "lossless"
"download_quality": "hifi"
},
"formatting": {
"album_format": "{artist}/{name}{quality}{explicit}"
@@ -105,15 +105,22 @@ loaded module. You'll find the configuration file here: `config/settings.json`
}
```
`download_quality`: Choose one of the following settings:
* "hifi": FLAC with MQA up to 48/24
* "lossless": FLAC with 44.1/16 (is MQA if the album is available in MQA)
* "high": same as "medium"
* "medium": AAC 320 kbit/s
* "low": same as "minimum"
* "minimum": AAC 96 kbit/s
#### `download_quality`
`album_format`:
Choose one of the following settings:
| Quality | Info |
|------------|--------------------------------------------------------------------------------------|
| `hifi` | FLAC up to 192/24 **or** MQA (FLAC) up to 48/24 when `proprietary_codecs` is enabled |
| `lossless` | FLAC with 44.1/16 (is MQA if the album is available in MQA) |
| `high` | same as `medium` |
| `medium` | AAC 320 kbit/s |
| `low` | same as `minimum` |
| `minimum` | AAC 96 kbit/s |
**Note: HiRes will ALWAYS be preferred instead of MQA!**
#### `album_format`
* `{quality}` will add
```
[Dolby Atmos]
@@ -130,31 +137,29 @@ loaded module. You'll find the configuration file here: `config/settings.json`
| Option | Info |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| proprietary_codecs | Enables/Disables MQA (Tidal Masters) downloading regardless the "hifi" setting from `download_quality` |
| spatial_codecs | Enables/Disables downloading of Dolby Atmos (EAC-3, AC-4) and Sony 360RA |
| proprietary_codecs | Enables/Disables MQA (Tidal Masters) downloading when no HiRes track is available |
| spatial_codecs | Enables/Disables downloading of Dolby Atmos (EAC-3, AC-4) and Sony 360RA (MHA1) |
| main_resolution | Tidal only supports 80x80, 160x160, 320x320, 480x480, 640x640, 1080x1080 and 1280x1280px (1280px won't work for playlists). <br/>If you choose 1400 or anything above 1280, it will get the highest quality even if the highest is 4000x4000px. That's because Tidal doesn't provide the "origin artwork" size, so the module will just get the largest. |
### TIDAL
```json
{
"tv_token": "7m7Ap0JC9j1cOM3n",
"tv_secret": "vRAdA108tlvkJpTsGZS8rGZ7xTlbJ0qaZ2K9saEzsgY=",
"mobile_atmos_token": "dN2N95wCyEBTllu4",
"mobile_default_token": "WAU9gXp3tHhK4Nns",
"tv_atmos_token": "4N3n6Q1x95LL5K7p",
"tv_atmos_secret": "oKOXfJW371cX6xaZ0PyhgGNBdNLlBZd4AKKYougMjik=",
"mobile_atmos_hires_token": "km8T1xS355y7dd3H",
"mobile_hires_token": "6BDSRdpK9hqEBTgU",
"enable_mobile": true,
"force_non_spatial": false,
"prefer_ac4": false,
"fix_mqa": true
}
```
| Option | Info |
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| tv_token | Enter a valid TV client token |
| tv_secret | Enter a valid TV client secret for the `tv_token` |
| mobile_* | Enter a valid MOBILE client token for the desired session |
| enable_mobile | Enables a second MOBILE session which needs a `username` and `password` (can be the same "TV" account) to archive Sony 360RA and Dolby AC-4 if available or allows `force_non_spatial` to work properly |
| force_non_spatial | Forces a default Mobile session (`mobile_default_token` without support for Dolby Atmos at all, Sony 360RA will still be available) to get FLAC/AAC tracks |
| enable_mobile | Enables a MOBILE session to archive Sony 360RA and Dolby AC-4 if available |
| prefer_ac4 | If enabled and a mobile session is available (`enable_mobile` is set to `true`) this will ensure to get Dolby AC-4 on Dolby Atmos tracks |
| fix_mqa | If enabled it will download the MQA file before the actual track and analyze the FLAC file to extract the bitDepth and originalSampleRate. The tags `MQAENCODER`, `ENCODER` and `ORIGINALSAMPLERATE` are than added to the FLAC file in order to get properly detected by MQA enabled software such as Roon, UAPP or Audirvana. |
@@ -163,7 +168,7 @@ loaded module. You'll find the configuration file here: `config/settings.json`
[@purpl3F0x](https://github.com/purpl3F0x) and [mqaid](https://github.com/redsudo/mqaid) by
[@redsudo](https://github.com/redsudo).**
**NOTE: `fix_mqa` is experimental! May be slower as a download with `fix_mqa` disabled and could be incorrect**
**NOTE: `fix_mqa` may be slower as a download without `fix_mqa` and could be incorrect.**
<!-- Contact -->
## Contact

View File

@@ -24,9 +24,8 @@ module_information = ModuleInformation(
'tv_atmos_token': '4N3n6Q1x95LL5K7p',
'tv_atmos_secret': 'oKOXfJW371cX6xaZ0PyhgGNBdNLlBZd4AKKYougMjik=',
'mobile_atmos_hires_token': 'km8T1xS355y7dd3H',
'mobile_default_token': 'WAU9gXp3tHhK4Nns',
'mobile_hires_token': '6BDSRdpK9hqEBTgU',
'enable_mobile': True,
'force_non_spatial': False,
'prefer_ac4': False,
'fix_mqa': True
},
@@ -166,7 +165,7 @@ class ModuleInterface:
elif session_type == SessionType.MOBILE_ATMOS.name:
session = TidalMobileSession(self.settings['mobile_atmos_hires_token'])
else:
session = TidalMobileSession(self.settings['mobile_default_token'])
session = TidalMobileSession(self.settings['mobile_hires_token'])
return session
def auth_session(self, session, session_type, login_session):
@@ -192,8 +191,8 @@ class ModuleInterface:
return session
def check_subscription(self, subscription: str) -> bool:
# returns true if "disable_subscription_checks" is enabled or subscription is HIFI Plus
if not self.disable_subscription_check and subscription not in {'HIFI', 'PREMIUM_PLUS'}:
# returns true if "disable_subscription_checks" is enabled or subscription is HIFI (Plus)
if not self.disable_subscription_check and subscription not in {'HIFI', 'PREMIUM', 'PREMIUM_PLUS'}:
self.print(f'{module_information.service_name}: Account does not have a HiFi (Plus) subscription, '
f'detected subscription: {subscription}')
return False
@@ -460,30 +459,31 @@ class ModuleInterface:
media_tags = track_data['mediaMetadata']['tags']
format = None
if 'HIRES_LOSSLESS' in media_tags and quality_tier is QualityEnum.HIFI:
format = 'flac_hires'
if 'SONY_360RA' in media_tags and not format and not self.settings['force_non_spatial']:
if codec_options.spatial_codecs:
if 'SONY_360RA' in media_tags:
format = '360ra'
if 'DOLBY_ATMOS' in media_tags and not format and not self.settings['force_non_spatial']:
elif 'DOLBY_ATMOS' in media_tags:
if self.settings['prefer_ac4']:
format = 'ac4'
else:
format = 'ac3'
if 'HIRES_LOSSLESS' in media_tags and not format and quality_tier is QualityEnum.HIFI:
format = 'flac_hires'
session = {
'flac_hires': SessionType.MOBILE_ATMOS,
'360ra': SessionType.MOBILE_ATMOS,
'flac_hires': SessionType.MOBILE_DEFAULT,
'360ra': SessionType.MOBILE_DEFAULT,
'ac4': SessionType.MOBILE_ATMOS,
'ac3': SessionType.TV,
# MOBILE_DEFAULT is used whenever possible to avoid MPEG-DASH, which slows downloading
None: SessionType.MOBILE_DEFAULT,
# TV is used whenever possible to avoid MPEG-DASH, which slows downloading
None: SessionType.TV,
}[format]
if not format and 'SONY_360RA' in media_tags:
# if 360RA is available, we don't use the mobile session here because that will get 360RA
if not format and 'DOLBY_ATMOS' in media_tags:
# if atmos is available, we don't use the TV session here because that will get atmos everytime
# there are no tracks with both 360RA and atmos afaik,
# so this shouldn't be an issue for now
session = SessionType.TV
session = SessionType.MOBILE_DEFAULT
if session.name in self.available_sessions:
self.session.default = session
@@ -607,10 +607,6 @@ class ModuleInterface:
credits_extra_kwargs={'data': {track_id: track_data['credits']} if 'credits' in track_data else {}}
)
if not codec_options.spatial_codecs and codec_data[track_codec].spatial:
track_info.error = 'Info: Spatial codecs are disabled, if you want to download it, set "spatial_codecs": ' \
'true '
if error is not None:
track_info.error = f'Error: {error}'