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

Support a different YouTube playlist URL #20

Open
Sinderella opened this issue Aug 27, 2022 · 2 comments
Open

Support a different YouTube playlist URL #20

Sinderella opened this issue Aug 27, 2022 · 2 comments

Comments

@Sinderella
Copy link

Sinderella commented Aug 27, 2022

First of all, thank you for this great piece of software.

I couldn't get the right YT playlist URL format at first, then I noticed the supported URL format is different. The one I got from my address bar when browsing is as follows:

https://music.youtube.com/browse/<playlist-id>

Alternatively, as we have to specify the service anyway, wouldn't it be better if we just enter the playlist ID?

@platers
Copy link
Owner

platers commented Aug 27, 2022

I usually click the share button on the playlist to get the url, which is why its this way. Adding more parsing options would be good.

@Sinderella
Copy link
Author

Using the share button also results in the following error.

Traceback (most recent call last):
  File "/path/clones/unitunes/unitunes/gui/engine.py", line 109, in _process_queue
    job.execute()
  File "/path/clones/unitunes/unitunes/gui/engine.py", line 66, in execute
    self.pm.pull_playlist(
  File "/path/clones/unitunes/unitunes/main.py", line 205, in pull_playlist
    remote_metadata = service.pull_metadata(uri)
  File "/path/clones/unitunes/unitunes/services/ytm.py", line 224, in pull_metadata
    res = self.wrapper.get_playlist(uri.uri)
  File "/path/clones/unitunes/unitunes/services/ytm.py", line 45, in get_playlist
    return self.ytm.get_playlist(*args, **kwargs)
  File "/path/Library/Caches/pypoetry/virtualenvs/unitunes-it616VEz-py3.10/lib/python3.10/site-packages/ytmusicapi/mixins/playlists.py", line 68, in get_playlist
    results = nav(response,
  File "/path/Library/Caches/pypoetry/virtualenvs/unitunes-it616VEz-py3.10/lib/python3.10/site-packages/ytmusicapi/parsers/utils.py", line 155, in nav
    raise err
  File "/path/Library/Caches/pypoetry/virtualenvs/unitunes-it616VEz-py3.10/lib/python3.10/site-packages/ytmusicapi/parsers/utils.py", line 149, in nav
    root = root[k]

URL:

https://music.youtube.com/playlist?list=<playlist-id>&feature=share

Removing the feature parameter seems to sort it. I suppose we're not parsing the URL properly. I would suggest using urllib.parse.

I apologise as I am unable to contribute as I will be traveling for the next 2 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants