Skip to content

Commit

Permalink
upload new version
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronzz committed Nov 15, 2021
2 parents fc96331 + 6cc1805 commit dc1ba68
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 16 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,41 @@

![image-20200806013705425](https://i.loli.net/2020/08/06/sPLowIlCGyOdpVN.png)

## Settings - Possible Tags

### Album

| Tag | Example value |
| ----------------- | ----------------------------- |
| {ArtistName} | The Beatles |
| {AlbumArtistName} | The Beatles |
| {Flag} | |
| {AlbumID} | 55163243 |
| {AlbumYear} | 1963 |
| {AlbumTitle} | Please Please Me (Remastered) |
| {AudioQuality} | LOSSLESS |
| {DurationSeconds} | 1919 |
| {Duration} | 31:59 |
| {NumberOfTracks} | 14 |
| {NumberOfVideos} | 0 |
| {NumberOfVolumes} | 1 |
| {ReleaseDate} | 1963-03-22 |
| {RecordType} | ALBUM |

### Track

| Tag | Example Value |
| ----------------- | ------------------------------------------ |
| {TrackNumber} | 01 |
| {ArtistName} | The Beatles |
| {TrackTitle} | I Saw Her Standing There (Remastered 2009) |
| {ExplicitFlag} | |
| {AlbumYear} | 1963 |
| {AlbumTitle} | Please Please Me (Remastered) |
| {AudioQuality} | LOSSLESS |
| {DurationSeconds} | 173 |
| {Duration} | 02:53 |

## ☕ Support

If you really like my projects and want to support me, you can buy me a coffee and star this project.
Expand Down
3 changes: 2 additions & 1 deletion TIDALDL-PY/tidal_dl/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'''
import logging
import os
import datetime

import aigpy
import lyricsgenius
Expand Down Expand Up @@ -147,7 +148,6 @@ def __loadVideoAPI__(user):
# result = __stripPathParts__(result, "\\")
# return result.strip()


# "{ArtistName}/{Flag} [{AlbumID}] [{AlbumYear}] {AlbumTitle}"
# def getAlbumPath(conf: Settings, album):
# base = conf.downloadPath + '/Album/'
Expand Down Expand Up @@ -324,6 +324,7 @@ def __loadVideoAPI__(user):
# return True



def __downloadVideo__(conf, video: Video, album=None, playlist=None):
if video.allowStreaming is False:
Printf.err("Download failed! " + video.title + ' not allow streaming.')
Expand Down
14 changes: 7 additions & 7 deletions TIDALDL-PY/tidal_dl/lang/english.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# -*- encoding: utf-8 -*-
'''
@File : english.py
@Time : 2020/08/19
@Author : Yaronzz
@Version : 1.0
@Time : 2021/11/11
@Author : Yaronzz & jee019
@Version : 1.1
@Contact : [email protected]
@Desc :
'''
Expand All @@ -24,7 +24,7 @@ class LangEnglish(object):
SETTING_CHECK_EXIST = "Check exist"
SETTING_ARTIST_BEFORE_TITLE = "ArtistName before track-title"
SETTING_ALBUMID_BEFORE_FOLDER = "Id before album-folder"
SETTING_INCLUDE_EP = "Include single&ep"
SETTING_INCLUDE_EP = "Include singles & EPs"
SETTING_SAVE_COVERS = "Save covers"
SETTING_LANGUAGE = "Language"
SETTING_USE_PLAYLIST_FOLDER = "Use playlist folder"
Expand All @@ -36,7 +36,7 @@ class LangEnglish(object):
SETTING_SAVE_ALBUMINFO = "Save AlbumInfo.txt"
SETTING_ADD_LYRICS = "Add lyrics"
SETTING_LYRICS_SERVER_PROXY = "Lyrics server proxy"
SETTINGS_ADD_LRC_FILE = "Save timed lyricss (.lrc file)"
SETTINGS_ADD_LRC_FILE = "Save timed lyrics (.lrc file)"
SETTING_PATH = "Settings path"

CHOICE = "CHOICE"
Expand Down Expand Up @@ -81,7 +81,7 @@ class LangEnglish(object):
CHANGE_SAVE_ALBUM_INFO = "Save AlbumInfo.txt('0'-No,'1'-Yes):"
CHANGE_ADD_LYRICS = "Add lyrics('0'-No,'1'-Yes):"
CHANGE_LYRICS_SERVER_PROXY = "Lyrics server proxy('0' not modify):"
CHANGE_ADD_LRC_FILE = "Save timed lyricss .lrc file ('0'-No,'1'-Yes):"
CHANGE_ADD_LRC_FILE = "Save timed lyrics .lrc file ('0'-No,'1'-Yes):"

# {} are required in these strings
AUTH_START_LOGIN = "Starting login process..."
Expand Down Expand Up @@ -110,4 +110,4 @@ class LangEnglish(object):
MODEL_ALBUM = 'Album'
MODEL_ID = 'ID'
MODEL_NAME = 'Name'
MODEL_TYPE = 'Type'
MODEL_TYPE = 'Type'
113 changes: 113 additions & 0 deletions TIDALDL-PY/tidal_dl/lang/korean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : korean.py
@Time : 2021/11/11
@Author : jee019
@Version : 1.0
@Contact : [email protected]
@Desc :
'''


class LangKorean(object):
SETTING = "설정"
VALUE = "값"
SETTING_DOWNLOAD_PATH = "다운로드 경로"
SETTING_ONLY_M4A = "mp4를 m4a로 변환"
SETTING_ADD_EXPLICIT_TAG = "explicit 태그 추가"
SETTING_ADD_HYPHEN = "하이픈 추가"
SETTING_ADD_YEAR = "앨범 폴더 앞에 연도 추가"
SETTING_USE_TRACK_NUM = "사용자 트랙 번호 추가"
SETTING_AUDIO_QUALITY = "음질"
SETTING_VIDEO_QUALITY = "영상 화질"
SETTING_CHECK_EXIST = "존재 유무 확인"
SETTING_ARTIST_BEFORE_TITLE = "트랙 제목 앞 아티스트 이름"
SETTING_ALBUMID_BEFORE_FOLDER = "앨범 폴더 앞 ID"
SETTING_INCLUDE_EP = "싱글 및 EP 포함"
SETTING_SAVE_COVERS = "커버 저장"
SETTING_LANGUAGE = "언어"
SETTING_USE_PLAYLIST_FOLDER = "재생목록 폴더 사용"
SETTING_MULITHREAD_DOWNLOAD = "다중 스레드 다운로드"
SETTING_ALBUM_FOLDER_FORMAT = "앨범 폴더 형식"
SETTING_TRACK_FILE_FORMAT = "트랙 파일 형식"
SETTING_SHOW_PROGRESS = "진행 상태 표시"
SETTING_SHOW_TRACKIFNO = "트랙 정보 표시"
SETTING_SAVE_ALBUMINFO = "AlbumInfo.txt 저장"
SETTING_ADD_LYRICS = "가사 추가"
SETTING_LYRICS_SERVER_PROXY = "가사 서버 프록시"
SETTINGS_ADD_LRC_FILE = "맞춤 가사 저장 (.lrc 파일)"
SETTING_PATH = "설정 경로"

CHOICE = "선택"
FUNCTION = "기능"
CHOICE_ENTER = "엔터"
CHOICE_ENTER_URLID = "'Url/ID' 입력:"
CHOICE_EXIT = "종료"
CHOICE_LOGIN = "액세스 토큰 확인"
CHOICE_SETTINGS = "설정"
CHOICE_SET_ACCESS_TOKEN = "액세스 토큰 설정"
CHOICE_DOWNLOAD_BY_URL = "url 또는 id로 다운로드"
CHOICE_LOGOUT = "로그아웃"

PRINT_ERR = "[에러]"
PRINT_INFO = "[정보]"
PRINT_SUCCESS = "[성공]"

PRINT_ENTER_CHOICE = "선택 입력:"
PRINT_LATEST_VERSION = "최신 버전:"
# PRINT_USERNAME = "유저 이름:"
# PRINT_PASSWORD = "비밀번호:"

CHANGE_START_SETTINGS = "설정 시작('0'-뒤로가기,'1'-예):"
CHANGE_DOWNLOAD_PATH = "다운로드 경로('0' 변경 안 함):"
CHANGE_AUDIO_QUALITY = "음질('0'-보통,'1'-높음,'2'-HiFi,'3'-Master):"
CHANGE_VIDEO_QUALITY = "영상 화질(1080, 720, 480, 360):"
CHANGE_ONLYM4A = "mp4를 m4a로 변환('0'-아니요,'1'-예):"
CHANGE_ADD_EXPLICIT_TAG = "파일 이름에 explicit 태그 추가('0'-아니요,'1'-예):"
CHANGE_ADD_HYPHEN = "파일 이름에 공백 대신 하이픈 사용('0'-아니요,'1'-예):"
CHANGE_ADD_YEAR = "앨범 폴더 이름에 연도 추가('0'-아니요,'1'-예):"
CHANGE_USE_TRACK_NUM = "파일 이름 앞에 트랙 번호 추가('0'-아니요,'1'-예):"
CHANGE_CHECK_EXIST = "다운로드 트랙 전에 존재하는 파일 확인('0'-아니요,'1'-예):"
CHANGE_ARTIST_BEFORE_TITLE = "트랙 제목 앞에 아티스트 이름 추가('0'-아니요,'1'-예):"
CHANGE_INCLUDE_EP = "아티스트 앨범 다운로드시 싱글 및 EP 포함('0'-아니요,'1'-예):"
CHANGE_ALBUMID_BEFORE_FOLDER = "앨범 폴더 앞에 ID 추가('0'-아니요,'1'-예):"
CHANGE_SAVE_COVERS = "커버 저장('0'-아니요,'1'-예):"
CHANGE_LANGUAGE = "언어 선택"
CHANGE_ALBUM_FOLDER_FORMAT = "앨범 폴더 형식('0' 변경 안 함,'default' 기본 설정):"
CHANGE_TRACK_FILE_FORMAT = "트랙 파일 형식('0' 변경 안 함,'default' 기본 설정):"
CHANGE_SHOW_PROGRESS = "진행 상태 표시('0'-아니요,'1'-예):"
CHANGE_SHOW_TRACKINFO = "트랙 정보 표시('0'-아니요,'1'-예):"
CHANGE_SAVE_ALBUM_INFO = "AlbumInfo.txt 저장('0'-아니요,'1'-예):"
CHANGE_ADD_LYRICS = "가사 추가('0'-아니요,'1'-예):"
CHANGE_LYRICS_SERVER_PROXY = "가사 서버 프록시('0' 변경 안 함):"
CHANGE_ADD_LRC_FILE = "맞춤 가사 .lrc 파일 저장 ('0'-아니요,'1'-예):"

# {} are required in these strings
AUTH_START_LOGIN = "로그인 중..."
AUTH_LOGIN_CODE = "로그인 코드는 다음과 같습니다. {}"
AUTH_NEXT_STEP = "설치를 완료하려면 {}로 이동하십시오. 다음 {} 내에 있습니다."
AUTH_WAITING = "승인 대기 중..."
AUTH_TIMEOUT = "작업 시간 초과"

MSG_VALID_ACCESSTOKEN = "{}에 대해 액세스토큰이 유효합니다."
MSG_INVAILD_ACCESSTOKEN = "만료된 액세스 토큰입니다. 새로 고침 중입니다."
MSG_PATH_ERR = "경로 오류!"
MSG_INPUT_ERR = "입력 오류!"

MODEL_ALBUM_PROPERTY = "앨범-정보"
MODEL_TRACK_PROPERTY = "트랙-정보"
MODEL_VIDEO_PROPERTY = "영상-정보"
MODEL_ARTIST_PROPERTY = "아티스트-정보"
MODEL_PLAYLIST_PROPERTY = "재생목록-정보"

MODEL_TITLE = '제목'
MODEL_TRACK_NUMBER = '트랙 넘버'
MODEL_VIDEO_NUMBER = '영상 넘버'
MODEL_RELEASE_DATE = '발매일'
MODEL_VERSION = '버전'
MODEL_EXPLICIT = 'Explicit'
MODEL_ALBUM = '앨범'
MODEL_ID = '아이디'
MODEL_NAME = '이름'
MODEL_TYPE = '형식'
5 changes: 5 additions & 0 deletions TIDALDL-PY/tidal_dl/lang/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from tidal_dl.lang.turkish import LangTurkish
from tidal_dl.lang.ukrainian import LangUkrainian
from tidal_dl.lang.vietnamese import LangVietnamese
from tidal_dl.lang.korean import LangKorean

LANG = None

Expand Down Expand Up @@ -71,6 +72,8 @@ def setLang(index):
LANG = LangDanish()
elif str(index) == '16':
LANG = LangHungarian()
elif str(index) == '17':
LANG = LangKorean()
else:
LANG = LangEnglish()
return LANG
Expand Down Expand Up @@ -116,6 +119,8 @@ def getLangName(index):
return "Danish"
if str(index) == '16':
return "Hungarian"
if str(index) == '17':
return "Korean"
return ""


Expand Down
14 changes: 7 additions & 7 deletions TIDALDL-PY/tidal_dl/lang/vietnamese.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LangVietnamese(object):
SETTING = "THIẾT LẬP"
VALUE = "GIÁ TRỊ"
SETTING_DOWNLOAD_PATH = "Đường dẫn tải về"
SETTING_ONLY_M4A = "Đổi mp4 qua m4a"
SETTING_ONLY_M4A = "Đổi mp4 sang m4a"
SETTING_ADD_EXPLICIT_TAG = "Thêm tag explicit"
SETTING_ADD_HYPHEN = "Thêm dấu nối"
SETTING_ADD_YEAR = "Thêm năm trước thư mục album"
Expand All @@ -36,8 +36,8 @@ class LangVietnamese(object):
SETTING_SAVE_ALBUMINFO = "Lưu AlbumInfo.txt"
SETTING_ADD_LYRICS = "Thêm lời bài hát"
SETTING_LYRICS_SERVER_PROXY = "Máy chủ proxy cho lyrics"
SETTING_PATH = "Settings path"
SETTINGS_ADD_LRC_FILE = "Save timed lyrics (.lrc file)"
SETTINGS_ADD_LRC_FILE = "Lưu timed lyrics (tệp .lrc)"
SETTING_PATH = "Đường dẫn cài đặt"

CHOICE = "LỰA CHỌN"
FUNCTION = "CHỨC NĂNG"
Expand All @@ -63,9 +63,9 @@ class LangVietnamese(object):
CHANGE_DOWNLOAD_PATH = "Đường dẫn tải về('0' không đổi):"
CHANGE_AUDIO_QUALITY = "Chất lượng âm thanh('0'-Normal,'1'-High,'2'-HiFi,'3'-Master):"
CHANGE_VIDEO_QUALITY = "Chất lượng video(1080, 720, 480, 360):"
CHANGE_ONLYM4A = "Đổi mp4 qua m4a('0'-Không,'1'-Có):"
CHANGE_ONLYM4A = "Đổi mp4 sang m4a('0'-Không,'1'-Có):"
CHANGE_ADD_EXPLICIT_TAG = "Thêm tag explicit vào tên tệp('0'-Không,'1'-Có):"
CHANGE_ADD_HYPHEN = "Dùng gạch nối thay vì spaces trong tên tệp('0'-Không,'1'-Có):"
CHANGE_ADD_HYPHEN = "Dùng gạch nối thay vì dấu cách trong tên tệp('0'-Không,'1'-Có):"
CHANGE_ADD_YEAR = "Thêm năm phía trước tên thư mục album('0'-Không,'1'-Có):"
CHANGE_USE_TRACK_NUM = "Thêm số thứ tự bài ở đầu tên tệp('0'-Không,'1'-Có):"
CHANGE_CHECK_EXIST = "Kiểm tra tệp đã tồn tại chưa trước khi tải('0'-Không,'1'-Có):"
Expand All @@ -77,11 +77,11 @@ class LangVietnamese(object):
CHANGE_ALBUM_FOLDER_FORMAT = "Định dạng thư mục album('0' không đổi,'default' để đặt về mặc định):"
CHANGE_TRACK_FILE_FORMAT = "Định dạng tên tệp nhạc('0' không đổi,'default' để đặt về mặc định):"
CHANGE_SHOW_PROGRESS = "Hiện tiến trình('0'-Không,'1'-Có):"
CHANGE_SHOW_TRACKINFO = "Show track info('0'-No,'1'-Yes):"
CHANGE_SHOW_TRACKINFO = "Hiện thông tin bài('0'-No,'1'-Yes):"
CHANGE_SAVE_ALBUM_INFO = "Lưu AlbumInfo.txt('0'-Không,'1'-Có):"
CHANGE_ADD_LYRICS = "Thêm lời bài hát('0'-Không,'1'-Có):"
CHANGE_LYRICS_SERVER_PROXY = "Máy chủ proxy cho lyrics('0' không đổi):"
CHANGE_ADD_LRC_FILE = "Save timed lyrics .lrc file ('0'-No,'1'-Yes):"
CHANGE_ADD_LRC_FILE = "Lưu timed lyrics tệp .lrc ('0'-No,'1'-Yes):"

# {} are required in these strings
AUTH_START_LOGIN = "Đang bắt đầu đăng nhập..."
Expand Down
2 changes: 1 addition & 1 deletion TIDALDL-PY/tidal_dl/printf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
https://github.com/yaronzz/Tidal-Media-Downloader
'''
VERSION = '2021.9.23.1'
VERSION = '2021.11.15.1'


class Printf(object):
Expand Down
19 changes: 19 additions & 0 deletions TIDALDL-PY/tidal_dl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def __getExtension__(url):
return '.m4a'


def __secondsToTimeStr__(seconds):
time_string = str(datetime.timedelta(seconds=seconds))
if time_string.startswith('0:'):
time_string = time_string[2:]
return time_string

def __parseContributors__(roleType, Contributors):
if Contributors is None:
return None
Expand Down Expand Up @@ -96,6 +102,7 @@ def getArtistsName(artists):
def getAlbumPath(conf: Settings, album):
base = conf.downloadPath + '/Album/'
artist = aigpy.path.replaceLimitChar(getArtistsName(album.artists), '-')
albumArtistName = album.artist.name if album.artist is not None else "None"
# album folder pre: [ME][ID]
flag = API.getFlag(album, Type.Album, True, "")
if conf.audioQuality != AudioQuality.Master:
Expand All @@ -116,10 +123,19 @@ def getAlbumPath(conf: Settings, album):
if retpath is None or len(retpath) <= 0:
retpath = Settings.getDefaultAlbumFolderFormat()
retpath = retpath.replace(R"{ArtistName}", artist.strip())
retpath = retpath.replace(R"{AlbumArtistName}", albumArtistName.strip())
retpath = retpath.replace(R"{Flag}", flag)
retpath = retpath.replace(R"{AlbumID}", sid)
retpath = retpath.replace(R"{AlbumYear}", year)
retpath = retpath.replace(R"{AlbumTitle}", albumname.strip())
retpath = retpath.replace(R"{AudioQuality}", album.audioQuality)
retpath = retpath.replace(R"{DurationSeconds}", str(album.duration))
retpath = retpath.replace(R"{Duration}", __secondsToTimeStr__(album.duration))
retpath = retpath.replace(R"{NumberOfTracks}", str(album.numberOfTracks))
retpath = retpath.replace(R"{NumberOfVideos}", str(album.numberOfVideos))
retpath = retpath.replace(R"{NumberOfVolumes}", str(album.numberOfVolumes))
retpath = retpath.replace(R"{ReleaseDate}", album.releaseDate)
retpath = retpath.replace(R"{RecordType}", album.type)
retpath = stripPath(retpath.strip())
return base + retpath

Expand Down Expand Up @@ -169,6 +185,9 @@ def getTrackPath(conf: Settings, track, stream, album=None, playlist=None):
retpath = retpath.replace(R"{ExplicitFlag}", explicit)
retpath = retpath.replace(R"{AlbumYear}", year)
retpath = retpath.replace(R"{AlbumTitle}", albumname.strip())
retpath = retpath.replace(R"{AudioQuality}", track.audioQuality)
retpath = retpath.replace(R"{DurationSeconds}", str(track.duration))
retpath = retpath.replace(R"{Duration}", __secondsToTimeStr__(track.duration))
retpath = retpath.strip()
return base + retpath + extension

Expand Down

0 comments on commit dc1ba68

Please sign in to comment.