Skip to content

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