You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using pytube to download some YouTube Music albums, and got this error with two of at least 200 albums (so it's a pretty rare problem):
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/lucas/repos/ytdownloader/main.py", line 184, in <module>
globals()[sys.argv[1]]()
File "/home/lucas/repos/ytdownloader/main.py", line 173, in run
list_pool.map(download_playlist, links)
File "/usr/lib64/python3.12/multiprocessing/pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/multiprocessing/pool.py", line 774, in get
raise self._value
File "/usr/lib64/python3.12/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
^^^^^^^^^^^^^^^^
File "/home/lucas/repos/ytdownloader/main.py", line 143, in download_playlist
print(f"Downloading {playlist.title.replace('Album - ', '')} - {author}")
^^^^^^^^^^^^^^
File "/home/lucas/repos/ytdownloader/.venv/lib64/python3.12/site-packages/pytube/contrib/playlist.py", line 351, in title
return self.sidebar_info[0]['playlistSidebarPrimaryInfoRenderer'][
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'runs'
First I had this problem with the Playlist().title method, then I figured the code returned a playlist with 0 videos (thus unable to iterate the loop with Playlist().videos).
Only then I found the videos were in fact unavailable due to an unknown reason.
I did some digging and when using extract.playability_status(), got a message 'This video is only available to Music Premium members'
I'm using oauth with an account that have Music Premium subscription, but even so, the playability still returns the above message.
Is it possible to enable access to Music Premium restricted content when logged in with a Premium account?
The bug occurred because, I think, the Playlist class does not use the oauth credentials to get the Playlist html, hence not being able to read it from a Music Premium restricted playlist (if that exists).
I asked the question before mentioning an explanation to the bug, because if it's impossible to use the credentials to access Premium content, this error is just a unhandled exception to a Music Premium content unavailability.
Hello!
Let me explain the problem first:
I'm using pytube to download some YouTube Music albums, and got this error with two of at least 200 albums (so it's a pretty rare problem):
First I had this problem with the Playlist().title method, then I figured the code returned a playlist with 0 videos (thus unable to iterate the loop with Playlist().videos).
Only then I found the videos were in fact unavailable due to an unknown reason.
I did some digging and when using
extract.playability_status()
, got a message'This video is only available to Music Premium members'
I'm using oauth with an account that have Music Premium subscription, but even so, the playability still returns the above message.
Is it possible to enable access to Music Premium restricted content when logged in with a Premium account?
The bug occurred because, I think, the Playlist class does not use the oauth credentials to get the Playlist html, hence not being able to read it from a Music Premium restricted playlist (if that exists).
I asked the question before mentioning an explanation to the bug, because if it's impossible to use the credentials to access Premium content, this error is just a unhandled exception to a Music Premium content unavailability.
The text was updated successfully, but these errors were encountered: