[GH-ISSUE #156] [Bug Report] Optimized Downloading Error (True or False) #140

Closed
opened 2026-02-27 04:57:47 +03:00 by kerem · 2 comments
Owner

Originally created by @carlyd95 on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/156

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version
v0.15.2 (new-hierarchy)

Bug Description
Zotify the following errors, one with optimized downloading set to true and the other with it set to false. (At least when batch downloading playlists from a file that likely share some tracks)

OPTIMIZED DOWNLOAD: TRUE

Bug Triggering Command
sudo -u pi /home/pi/.local/bin/zotify -f tz.txt --download-format mp3 --download-quality very_high --root-path /media/pi/X9/DJ/Music --output "{artist} - {song_name}" --download-real-time True --md-save-genres True --client-id XXXXXXXXXXXXXXXXXX --debug

Error Traceback / Logs

OUTPUT:

`### SKIPPING: LYRICS FOR "ADB - Out Of Service" (LYRICS NOT AVAILABLE) ###

[∙∙●] Converting File...
### ERROR: UNEXPECTED ERROR DURING DOWNLOADS ###
### ATTEMPTING TO CLEAN UP ###

Traceback (most recent call last):
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download
try: super().download(ParentStack([self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download
item.download(parent_stack)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1295, in download
self[-1].download(self)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 786, in download
if Zotify.CONFIG.get_optimized_dl(): self.clone_to_all()
^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 493, in clone_to_all
if not self.clone_file(ps, clone_path):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 478, in clone_file
if not Path(filepath).exists(): continue
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 871, in new
self = cls._from_parts(args)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 509, in _from_parts
drv, root, parts = self._parse_args(args)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 493, in _parse_args
a = os.fspath(a)
^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not ParentStack

### ERROR: CLEAN UP COMPLETE ###
### LOGGING ERROR AND TRACEBACK ###

DEBUG
Total API Calls: 71

Traceback (most recent call last):
File "/home/pi/.local/bin/zotify", line 7, in
sys.exit(main())
^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/main.py", line 143, in main
client(args, modes)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/app.py", line 186, in client
perform_query(args)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/app.py", line 178, in perform_query
raise e
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/app.py", line 149, in perform_query
Query(Zotify.DATETIME_LAUNCH).request(urls).execute()
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1509, in execute
self.download()
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1498, in download
raise interrupt
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download
try: super().download(ParentStack([self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download
item.download(parent_stack)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1295, in download
self[-1].download(self)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 786, in download
if Zotify.CONFIG.get_optimized_dl(): self.clone_to_all()
^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 493, in clone_to_all
if not self.clone_file(ps, clone_path):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 478, in clone_file
if not Path(filepath).exists(): continue
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 871, in new
self = cls._from_parts(args)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 509, in _from_parts
drv, root, parts = self._parse_args(args)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 493, in _parse_args
a = os.fspath(a)
^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not ParentStack`

DEBUG:

zotify_DEBUG_2026-01-20_22-31-15.log

Config File
config_DEBUG.json

OPTIMIZED DOWNLOAD: FALSE

Bug Triggering Command
sudo -u pi /home/pi/.local/bin/zotify -f tz.txt --download-format mp3 --download-quality very_high --root-path /media/pi/X9/DJ/Music --output "{artist} - {song_name}" --download-real-time True --md-save-genres True --client-id XXXXXXXXXXXXXXXXXX --debug ----optimized-downloading False

Error Traceback / Logs

OUTPUT:

`INFO:zotify.debug:

ERROR:zotify.debug:

UNEXPECTED ERROR DURING DOWNLOADS
ATTEMPTING TO CLEAN UP

ERROR:zotify.debug:

Traceback (most recent call last):
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download
try: super().download(ParentStack([self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download
item.download(parent_stack)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download
item.download(parent_stack)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 731, in download
elif self.downloaded and self.clone_file(path):
^^^^^^^^^^^^^^^^^^^^^
TypeError: DLContent.clone_file() missing 1 required positional argument: 'new_path'

ERROR:zotify.debug:

CLEAN UP COMPLETE
LOGGING ERROR AND TRACEBACK

ERROR:zotify.debug:

Traceback (most recent call last):
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download
try: super().download(ParentStack([self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download
item.download(parent_stack)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download
item.download(parent_stack)
File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 731, in download
elif self.downloaded and self.clone_file(path):
^^^^^^^^^^^^^^^^^^^^^
TypeError: DLContent.clone_file() missing 1 required positional argument: 'new_path'

ERROR:zotify.debug:

{ '_main_items': [ <zotify.api.Playlist object at 0x7fbae5d390>,
<zotify.api.Playlist object at 0x7fbb7544d0>,
<zotify.api.Playlist object at 0x7fbae60110>],
'children': { <zotify.api.Playlist object at 0x7fbae5d390>,
<zotify.api.Playlist object at 0x7fbae60110>,
<zotify.api.Playlist object at 0x7fbb7544d0>},
'downloaded': False,
'hasMetadata': False,
'id': '2026-01-20_22-57-02',
'local_file': False,
'needs_expansion': False,
'needs_recursion': False,
'parents': set(),
'parsed_request': [ [ 'playlist:27O7EmU2R8iivLmR8x0ENQ',
'playlist:7orx9YCe3JAJChF3kizm5b',
'playlist:54Ta0uF3eWizLfTQ7oL5bx'],
[],
[],
[],
[],
[],
[],
[]],
'requested_objs': [ [ <zotify.api.Playlist object at 0x7fbae5d390>,
<zotify.api.Playlist object at 0x7fbb7544d0>,
<zotify.api.Playlist object at 0x7fbae60110>],
[],
[],
[],
[],
[],
[],
[]],
'requested_urls': 'https://open.spotify.com/playlist/27O7EmU2R8iivLmR8x0ENQ?si=a76ec356c4034a61 '
'https://open.spotify.com/playlist/7orx9YCe3JAJChF3kizm5b?si=85714f7460e94b41 '
'https://open.spotify.com/playlist/54Ta0uF3eWizLfTQ7oL5bx?si=3164a704fd8245bf',
'skippable': None,
'uri': 'query:2026-01-20_22-57-02'}

DEBUG:zotify.debug:

Total API Calls: 53`

DEBUG:

zotify_DEBUG_2026-01-20_22-57-02.log

Config File
config_DEBUG.json

Additional Context
WIth optimized downloading set to False it seems this temporary work-around works:

In api.py (line 731) change elif self.downloaded and self.clone_file(path): to elif self.downloaded:.

The optimized downloading set to true skipping speed is nice compared to with it off!

Originally created by @carlyd95 on GitHub (Jan 21, 2026). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/156 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** v0.15.2 (new-hierarchy) **Bug Description** Zotify the following errors, one with optimized downloading set to true and the other with it set to false. (At least when batch downloading playlists from a file that likely share some tracks) ### OPTIMIZED DOWNLOAD: TRUE **Bug Triggering Command** sudo -u pi /home/pi/.local/bin/zotify -f tz.txt --download-format mp3 --download-quality very_high --root-path /media/pi/X9/DJ/Music --output "{artist} - {song_name}" --download-real-time True --md-save-genres True --client-id XXXXXXXXXXXXXXXXXX --debug **Error Traceback / Logs** ### OUTPUT: `\### SKIPPING: LYRICS FOR "ADB - Out Of Service" (LYRICS NOT AVAILABLE) ### [∙∙●] Converting File... \### ERROR: UNEXPECTED ERROR DURING DOWNLOADS ### \### ATTEMPTING TO CLEAN UP ### Traceback (most recent call last): File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download try: super().download(ParentStack([self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download item.download(parent_stack) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1295, in download self[-1].download(self) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 786, in download if Zotify.CONFIG.get_optimized_dl(): self.clone_to_all() ^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 493, in clone_to_all if not self.clone_file(ps, clone_path): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 478, in clone_file if not Path(filepath).exists(): continue ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/pathlib.py", line 871, in __new__ self = cls._from_parts(args) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/pathlib.py", line 509, in _from_parts drv, root, parts = self._parse_args(args) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/pathlib.py", line 493, in _parse_args a = os.fspath(a) ^^^^^^^^^^^^ TypeError: expected str, bytes or os.PathLike object, not ParentStack \### ERROR: CLEAN UP COMPLETE ### \### LOGGING ERROR AND TRACEBACK ### DEBUG Total API Calls: 71 Traceback (most recent call last): File "/home/pi/.local/bin/zotify", line 7, in <module> sys.exit(main()) ^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/__main__.py", line 143, in main client(args, modes) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/app.py", line 186, in client perform_query(args) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/app.py", line 178, in perform_query raise e File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/app.py", line 149, in perform_query Query(Zotify.DATETIME_LAUNCH).request(urls).execute() File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1509, in execute self.download() File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1498, in download raise interrupt File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download try: super().download(ParentStack([self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download item.download(parent_stack) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1295, in download self[-1].download(self) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 786, in download if Zotify.CONFIG.get_optimized_dl(): self.clone_to_all() ^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 493, in clone_to_all if not self.clone_file(ps, clone_path): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 478, in clone_file if not Path(filepath).exists(): continue ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/pathlib.py", line 871, in __new__ self = cls._from_parts(args) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/pathlib.py", line 509, in _from_parts drv, root, parts = self._parse_args(args) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/pathlib.py", line 493, in _parse_args a = os.fspath(a) ^^^^^^^^^^^^ TypeError: expected str, bytes or os.PathLike object, not ParentStack` ### DEBUG: [zotify_DEBUG_2026-01-20_22-31-15.log](https://github.com/user-attachments/files/24756355/zotify_DEBUG_2026-01-20_22-31-15.log) **Config File** [config_DEBUG.json](https://github.com/user-attachments/files/24727970/config_DEBUG.json) ### OPTIMIZED DOWNLOAD: FALSE **Bug Triggering Command** sudo -u pi /home/pi/.local/bin/zotify -f tz.txt --download-format mp3 --download-quality very_high --root-path /media/pi/X9/DJ/Music --output "{artist} - {song_name}" --download-real-time True --md-save-genres True --client-id XXXXXXXXXXXXXXXXXX --debug ----optimized-downloading False **Error Traceback / Logs** ### OUTPUT: `INFO:zotify.debug: ERROR:zotify.debug: UNEXPECTED ERROR DURING DOWNLOADS ATTEMPTING TO CLEAN UP ERROR:zotify.debug: Traceback (most recent call last): File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download try: super().download(ParentStack([self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download item.download(parent_stack) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download item.download(parent_stack) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 731, in download elif self.downloaded and self.clone_file(path): ^^^^^^^^^^^^^^^^^^^^^ TypeError: DLContent.clone_file() missing 1 required positional argument: 'new_path' ERROR:zotify.debug: CLEAN UP COMPLETE LOGGING ERROR AND TRACEBACK ERROR:zotify.debug: Traceback (most recent call last): File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1468, in download try: super().download(ParentStack([self])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download item.download(parent_stack) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 1087, in download item.download(parent_stack) File "/home/pi/.local/share/pipx/venvs/zotify/lib/python3.11/site-packages/zotify/api.py", line 731, in download elif self.downloaded and self.clone_file(path): ^^^^^^^^^^^^^^^^^^^^^ TypeError: DLContent.clone_file() missing 1 required positional argument: 'new_path' ERROR:zotify.debug: { '_main_items': [ <zotify.api.Playlist object at 0x7fbae5d390>, <zotify.api.Playlist object at 0x7fbb7544d0>, <zotify.api.Playlist object at 0x7fbae60110>], 'children': { <zotify.api.Playlist object at 0x7fbae5d390>, <zotify.api.Playlist object at 0x7fbae60110>, <zotify.api.Playlist object at 0x7fbb7544d0>}, 'downloaded': False, 'hasMetadata': False, 'id': '2026-01-20_22-57-02', 'local_file': False, 'needs_expansion': False, 'needs_recursion': False, 'parents': set(), 'parsed_request': [ [ 'playlist:27O7EmU2R8iivLmR8x0ENQ', 'playlist:7orx9YCe3JAJChF3kizm5b', 'playlist:54Ta0uF3eWizLfTQ7oL5bx'], [], [], [], [], [], [], []], 'requested_objs': [ [ <zotify.api.Playlist object at 0x7fbae5d390>, <zotify.api.Playlist object at 0x7fbb7544d0>, <zotify.api.Playlist object at 0x7fbae60110>], [], [], [], [], [], [], []], 'requested_urls': 'https://open.spotify.com/playlist/27O7EmU2R8iivLmR8x0ENQ?si=a76ec356c4034a61 ' 'https://open.spotify.com/playlist/7orx9YCe3JAJChF3kizm5b?si=85714f7460e94b41 ' 'https://open.spotify.com/playlist/54Ta0uF3eWizLfTQ7oL5bx?si=3164a704fd8245bf', 'skippable': None, 'uri': 'query:2026-01-20_22-57-02'} DEBUG:zotify.debug: Total API Calls: 53` ### DEBUG: [zotify_DEBUG_2026-01-20_22-57-02.log](https://github.com/user-attachments/files/24756345/zotify_DEBUG_2026-01-20_22-57-02.log) **Config File** [config_DEBUG.json](https://github.com/user-attachments/files/24727970/config_DEBUG.json) **Additional Context** WIth optimized downloading set to False it seems this temporary work-around works: In api.py (line 731) change `elif self.downloaded and self.clone_file(path):` to `elif self.downloaded:`. The optimized downloading set to true skipping speed is nice compared to with it off!
kerem 2026-02-27 04:57:47 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Googolplexed0 commented on GitHub (Jan 21, 2026):

Should be fixed with github.com/Googolplexed0/zotify@ee88dfca80

<!-- gh-comment-id:3776209757 --> @Googolplexed0 commented on GitHub (Jan 21, 2026): Should be fixed with https://github.com/Googolplexed0/zotify/commit/ee88dfca800042a971ae0df6ebbb7a04aa99ad1b
Author
Owner

@carlyd95 commented on GitHub (Jan 21, 2026):

@Googolplexed0 Thanks, I'll give it a shot! I appreciate your time and effort.

<!-- gh-comment-id:3776263846 --> @carlyd95 commented on GitHub (Jan 21, 2026): @Googolplexed0 Thanks, I'll give it a shot! I appreciate your time and effort.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zotify#140
No description provided.