diff options
| author | Robert Honz <exislow+github@gmail.com> | 2023-12-19 23:58:57 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2023-12-19 23:58:57 +0100 |
| commit | 0d4a9d6b8740035346d098f5bc28ebca64f6cd4d (patch) | |
| tree | f52c9569509565e581b03b6e60fe32e611b79ad2 /tidal_dl_ng/helper/url.py | |
| parent | 82a8fe96aa08903919a90a76030bacba9f93b8e0 (diff) | |
| download | tidal-dl-ng-0d4a9d6b8740035346d098f5bc28ebca64f6cd4d.tar.gz | |
🌟 Re-add all project files.
Diffstat (limited to 'tidal_dl_ng/helper/url.py')
| -rw-r--r-- | tidal_dl_ng/helper/url.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tidal_dl_ng/helper/url.py b/tidal_dl_ng/helper/url.py new file mode 100644 index 0000000..cb52238 --- /dev/null +++ b/tidal_dl_ng/helper/url.py @@ -0,0 +1,15 @@ +def get_tidal_media_id(url_or_id_media: str) -> str: + id_dirty = url_or_id_media.rsplit("/", 1)[-1] + id = id_dirty.rsplit("?", 1)[0] + + return id + + +def get_tidal_media_type(url_media: str) -> str | bool: + result = False + url_split = url_media.split("/")[-2] + + if len(url_split) > 1: + result = url_media.split("/")[-2] + + return result |
