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

Fix '__canonical_youtube' - vid ID cant be lower() #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Kariton
Copy link

@Kariton Kariton commented Oct 9, 2023

The youtube links dont work when the video ID is in lower case.

https://youtu.be/71ssvumt1ys -> "This video isn't available anymore"
https://youtu.be/71SsVUmT1ys -> Plays "Real"

@xojoc xojoc added the bug Something isn't working label Oct 10, 2023
@xojoc
Copy link
Owner

xojoc commented Oct 11, 2023

Hi,
thanks for the PR. Could you change it to call lower only when respect_semantics == False? And possibly add a test to test_semantics which tests that the case remains unchagned.

@Kariton
Copy link
Author

Kariton commented Oct 28, 2023

I will look into that. :)

@Kariton
Copy link
Author

Kariton commented Jun 3, 2024

somehting is odd.

>>> r = cleanurl.cleanurl('https://www.youtube.com/watch?v=dsbA4XH2-3A', respect_semantics=True)
>>> r.url
'https://www.youtube.com/watch?v=dsbA4XH2-3A'
>>> r = cleanurl.cleanurl('https://www.youtube.com/watch?v=dsbA4XH2-3A', respect_semantics=False)
>>> r.url
'https://youtube.com/watch?v=dsbA4XH2-3A'
>>> r = cleanurl.cleanurl('https://www.youtube.com/watch?v=71SsVUmT1ys&ignore=query', respect_semantics=False)
>>> r.url
'https://youtube.com/watch?ignore=query&v=71SsVUmT1ys'
>>> r = cleanurl.cleanurl('https://www.youtube.com/watch?v=71SsVUmT1ys&ignore=query', respect_semantics=True)
>>> r.url
'https://www.youtube.com/watch?ignore=query&v=71SsVUmT1ys'

while im pretty sure that the code should work... it does not.
maybe my env is broken. ill investigate this further / later.

@Kariton
Copy link
Author

Kariton commented Jun 3, 2024

what an oversight...

>>> import cleanurl
>>> r = cleanurl.cleanurl('https://www.youtube.com/watch?v=71SsVUmT1ys&ignore=query', respect_semantics=True)
>>> r.url
'https://youtu.be/71SsVUmT1ys'
>>> r = cleanurl.cleanurl('https://www.youtube.com/watch?v=71SsVUmT1ys&ignore=query', respect_semantics=False)
>>> r.url
'https://youtu.be/71ssvumt1ys'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants