Merge branch 'develop'
This commit is contained in:
57
README.md
57
README.md
@@ -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,40 +137,38 @@ 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 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 |
|
||||
| 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. |
|
||||
| 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 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. |
|
||||
|
||||
|
||||
**Credits: [MQA_identifier](https://github.com/purpl3F0x/MQA_identifier) by
|
||||
[@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
|
||||
|
||||
40
interface.py
40
interface.py
@@ -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):
|
||||
@@ -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:
|
||||
if codec_options.spatial_codecs:
|
||||
if 'SONY_360RA' in media_tags:
|
||||
format = '360ra'
|
||||
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'
|
||||
if 'SONY_360RA' in media_tags and not format and not self.settings['force_non_spatial']:
|
||||
format = '360ra'
|
||||
if 'DOLBY_ATMOS' in media_tags and not format and not self.settings['force_non_spatial']:
|
||||
if self.settings['prefer_ac4']:
|
||||
format = 'ac4'
|
||||
else:
|
||||
format = 'ac3'
|
||||
|
||||
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}'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user