Skip to content

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

Open
Kariton wants to merge 4 commits into
xojoc:mainfrom
Kariton:canonical_youtube
Open

Fix '__canonical_youtube' - vid ID cant be lower()#1
Kariton wants to merge 4 commits into
xojoc:mainfrom
Kariton:canonical_youtube

Conversation

@Kariton

@Kariton Kariton commented Oct 9, 2023

Copy link
Copy Markdown

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

xojoc commented Oct 11, 2023

Copy link
Copy Markdown
Owner

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

Kariton commented Oct 28, 2023

Copy link
Copy Markdown
Author

I will look into that. :)

@Kariton

Kariton commented Jun 3, 2024

Copy link
Copy Markdown
Author

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

Kariton commented Jun 3, 2024

Copy link
Copy Markdown
Author

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