Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add error handling for downloading with Tidal #769

Open
joolstorrentecalo opened this issue Nov 9, 2024 · 0 comments
Open

[FEATURE] Add error handling for downloading with Tidal #769

joolstorrentecalo opened this issue Nov 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@joolstorrentecalo
Copy link

Is the feature request related to a problem. Please describe it.

Everytime when the script is trying to download something, it will immediatly throw an error whenever a song isn't available. When removing the unavailable songs from the playlist, it suddenly works. Such an option is not available for when you want to download other people's playlist or artists, so it would be a nice addition. See error:

╭──────── Traceback (most recent call last) ─────────╮
│ C:\Users\xxxxxxxxxxxxxxxxx\AppData\Local\Programs\ │
│ Python\Python311\Lib\site-packages\streamrip\rip\c │
│ li.py:168 in url │
│ │
│ 165 │ │ async with Main(cfg) as main: │
│ 166 │ │ │ await main.add_all(urls) │
│ 167 │ │ │ await main.resolve() │
│ ❱ 168 │ │ │ await main.rip() │
│ 169 │ │ │
│ 170 │ │ if version_coro is not None: │
│ 171 │ │ │ latest_version, notes = await ve │
│ │
│ C:\Users\xxxxxxxxxxxxxxxxx\AppData\Local\Programs\ │
│ Python\Python311\Lib\site-packages\streamrip\rip\m │
│ ain.py:165 in rip │
│ │
│ 162 │ │
│ 163 │ async def rip(self): │
│ 164 │ │ """Download all resolved items.""" │
│ ❱ 165 │ │ await asyncio.gather(*[item.rip() fo │
│ 166 │ │
│ 167 │ async def search_interactive(self, sourc │
│ 168 │ │ client = await self.get_logged_in_cl │
│ │
│ ... 5 frames hidden ... │
│ │
│ C:\Users\xxxxxxxxxxxxxxxxx\AppData\Local\Programs\ │
│ Python\Python311\Lib\site-packages\streamrip\clien │
│ t\tidal.py:324 in api_request │
│ │
│ 321 │ │ │
│ 322 │ │ async with self.rate_limiter: │
│ 323 │ │ │ async with self.session.get(f"{B │
│ ❱ 324 │ │ │ │ resp.raise_for_status() │
│ 325 │ │ │ │ return await resp.json() │
│ 326 │
│ │
│ C:\Users\xxxxxxxxxxxxxxxxx\AppData\Local\Programs\ │
│ Python\Python311\Lib\site-packages\aiohttp\client

│ reqrep.py:1070 in raise_for_status │
│ │
│ 1067 │ │ │ # reason should always be not N │
│ 1068 │ │ │ assert self.reason is not None │
│ 1069 │ │ │ self.release() │
│ ❱ 1070 │ │ │ raise ClientResponseError( │
│ 1071 │ │ │ │ self.request_info, │
│ 1072 │ │ │ │ self.history, │
│ 1073 │ │ │ │ status=self.status, │
╰────────────────────────────────────────────────────╯
ClientResponseError: 404, message='Not Found',
url=URL('https://api.tidalhifi.com/v1/tracks/64168269?
countryCode=NL&limit=100')

During handling of the above exception, another
exception occurred:

╭──────── Traceback (most recent call last) ─────────╮
│ in _run_module_as_main:198 │
│ in _run_code:88 │
│ │
│ ... 15 frames hidden ... │
│ │
│ C:\Users\xxxxxxxxxxxxxxxxx\AppData\Local\Programs\ │
│ Python\Python311\Lib\shutil.py:621 in │
│ _rmtree_unsafe │
│ │
│ 618 │ │ │ try: │
│ 619 │ │ │ │ os.unlink(fullname) │
│ 620 │ │ │ except OSError: │
│ ❱ 621 │ │ │ │ onerror(os.unlink, fullname │
│ 622 │ try: │
│ 623 │ │ os.rmdir(path) │
│ 624 │ except OSError: │
│ │
│ C:\Users\xxxxxxxxxxxxxxxxx\AppData\Local\Programs\ │
│ Python\Python311\Lib\shutil.py:619 in │
│ _rmtree_unsafe │
│ │
│ 616 │ │ │ _rmtree_unsafe(fullname, onerro │
│ 617 │ │ else: │
│ 618 │ │ │ try: │
│ ❱ 619 │ │ │ │ os.unlink(fullname) │
│ 620 │ │ │ except OSError: │
│ 621 │ │ │ │ onerror(os.unlink, fullname │
│ 622 │ try: │
╰────────────────────────────────────────────────────╯
PermissionError: [WinError 32] The process cannot
access the file because it is being used by another
process:
'C:\Users\xxxxxxxxxxxxxxxxx\Nextcloud\Music\Playl
ists\(Dub)
Reggea\__artwork\cover6300566544733971824.jpg'
sys:1: RuntimeWarning: coroutine 'Playlist.download.._resolve_download' was never awaited

Describe the solution you would like.

Add basic error handling that would make sure that the program doesn't immediatly throw an exit whenever a song isn't available. Make sure it skips the song and downloads whatever IS possible.

Describe alternatives you've considered.

Deleting unavailable songs from a playlist.

@joolstorrentecalo joolstorrentecalo added the enhancement New feature or request label Nov 9, 2024
@joolstorrentecalo joolstorrentecalo changed the title [FEATURE] <Add error handling for downloading with Tidal> [FEATURE] Add error handling for downloading with Tidal Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant