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

Improve Qt URL handling for FreeTube rediect #212

Closed
sith-on-mars opened this issue Apr 22, 2022 · 12 comments
Closed

Improve Qt URL handling for FreeTube rediect #212

sith-on-mars opened this issue Apr 22, 2022 · 12 comments

Comments

@sith-on-mars
Copy link

I'm on the Tumbleweed KDE. Everything seemed to work fine when I was using Tumbleweed Gnome. However, after switching to KDE, the extension only opened the main app, but won't go to the YouTube link that it's trying to direct to.

Is there anything libredirect can do to solve it? Or maybe should I report the issue to KDE?

@ManeraKai
Copy link
Member

ManeraKai commented Apr 22, 2022

Can you try the Firefox in flatpak or download it directly and see if it's maybe Firefox's problem?

@sith-on-mars
Copy link
Author

I don't think it's the problem with Firefox. I've tried the extension on Chromium and the result was the same.

@ManeraKai
Copy link
Member

ManeraKai commented Apr 22, 2022

It's weird as I myself am using KDE (Kubuntu LTS).

@ManeraKai
Copy link
Member

Did something happen on your side?

@ManeraKai
Copy link
Member

Hello?

@sith-on-mars sith-on-mars changed the title FreeTube redirect stops redirecting YouTube link in KDE environment FreeTube redirect stops redirecting YouTube link in OpenSUSE KDE Apr 30, 2022
@sith-on-mars
Copy link
Author

It could be a KDE or OpenSUSE issue. I'll report bug to them. For now, I'll close the issue.

@sith-on-mars
Copy link
Author

Here is the bug report which I think it might be of help for you. I think Libredirect could have improved the URL handling of the YouTube redirect function in the Qt environment, as I quote here from a SUSE developer:

I gave it a try and I can reproduce the issue. The libredirect extension simply changes any https://youtube.com/watch?v=... url by prepending freetube://, resulting in e.g. freetube://https://www.youtube.com/watch?v=dQw4w9WgXcQ.
Qt's QUrl parses that as scheme=freetube host=https port=empty and converts it to freetube://https//www.youtube.com/watch?v=dQw4w9WgXcQ (no colon!). The freetube app can't handle that.

This can be reproduced easily by xdg-open freetube://https://www.youtube.com/watch?v=dQw4w9WgXcQ. The started freetube process gets the URL without colon as argument.

I don't think freetube://https://... is a valid URL, so IMO this is something for libredirect and freetube to figure out how to solve. Using an authority-less URL like freetube:https://www.youtube.com/watch?v=dQw4w9WgXcQ might work, as colons in filenames are allowed. As a workaround, freetube could handle the lost colon in the passed URL.

And the reason why the extension works on Gnome and Kubuntu, but not on a rolling distro like Tumbleweed KDE:

Gnome doesn't use Qt for URL handling. Kubuntu might either use an older version of Qt or KDE software with different behaviour or somehow not use KIO for handling the URL (missing browser integration?)

@sith-on-mars sith-on-mars reopened this May 3, 2022
@sith-on-mars sith-on-mars changed the title FreeTube redirect stops redirecting YouTube link in OpenSUSE KDE Improve Qt URL handling for FreeTube rediect May 3, 2022
@ManeraKai
Copy link
Member

ManeraKai commented May 3, 2022

well this url seems to work: freetube://https:www.youtube.com/watch?v=dQw4w9WgXcQ

@sith-on-mars
Copy link
Author

sith-on-mars commented May 3, 2022

Have you read this?
Gnome doesn't use Qt for URL handling. Kubuntu might either use an older version of Qt or KDE software with different behaviour or somehow not use KIO for handling the URL (missing browser integration?)

It seems changing the way of URL handling from freetube://https//www.youtube.com/watch?v=... to xdg-open freetube://https//www.youtube.com/watch?v=... would be a quick fix, as I understand?

@ManeraKai
Copy link
Member

yeah I read it. The url I wrote earlier isn't different and doesn't have double forward slash infront of https, I want to know if this quick fix would do it rather to talk to the Freetube dev as I can't manage to open freetube://www.youtube.com/watch?v...., I should write and use the https protocol.

@sith-on-mars
Copy link
Author

well this url seems to work: freetube://https:www.youtube.com/watch?v=dQw4w9WgXcQ

Without double forward slash, it doesn't work on my system. I don't have any coding/programming knowledge so my technological understanding can be quite limited...

@ManeraKai
Copy link
Member

it works on my system when I open it through Firefox, not through xdg-open.

If it's like this then you should open an issue on Freetube and tell them to delete the https:// from their url handling. I can't do anything from my side.

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

No branches or pull requests

2 participants