invidious icon indicating copy to clipboard operation
invidious copied to clipboard

[Bug] Redirect from short youtu.be URLs does not work

Open Trit34 opened this issue 1 year ago • 5 comments

Describe the bug youtu.be/××××× short URLs are usually converted as [Invidious]/××××× and they used to be redirected to the full URLs [Invidious]/watch?v=×××××. As of today (but I don’t know since when exactly), it does not work anymore and such shortened URLs lead to the homepage of the instance instead.

Steps to Reproduce Tested on FDN’s Invidious instance (updated each Sunday):

  1. Go to https://invidious.fdn.fr/yWsS5UJf8yU (for example)
  2. Instead of redirecting to https://invidious.fdn.fr/watch?v=yWsS5UJf8yU, it loads https://invidious.fdn.fr/feed/popular, the homepage.

Additional context

  • Browser (if applicable): Vivaldi
  • OS (if applicable): Arch Linux

Trit34 avatar Jun 23 '23 10:06 Trit34

Closing as it works fine on instances that are officially published on https://instances.invidious.io

unixfox avatar Jun 23 '23 11:06 unixfox

Closing as it works fine on instances that are officially published on https://instances.invidious.io

Not all of them, then: it works with yewtu.be (last updated on 11th June), but not with https://yt.artemislena.eu/, nor https://invidious.projectsegfau.lt/ (both last updated to 21st June, and both are instances on this list).

Maybe you don’t want to hear about it anymore since it (still?) works on the instances you tested with (and it’s good to hear, but how long will it last for them?), but I wonder if there was a commit that break this redirect (since it seems to affect only instances updated circa after mid-June), and I’m not a programmer. Luckily, it’s a minor (but annoying) bug, but I guess that if other people notice it on their side, they will report it too.

Trit34 avatar Jun 23 '23 13:06 Trit34

Reopening as I can reproduce the issue on the test instance: https://test.invidious.io/yWsS5UJf8yU

I did close the issue before because it was working on an up to date instance: https://vid.puffyan.us/yWsS5UJf8yU

unixfox avatar Jun 23 '23 19:06 unixfox

Yes, there is indeed such a problem with some instances. For example, on the yt.artemislena.eu instance, any attempt to enter a short video ID (example https://yt.artemislena.eu/kwrKVY72iSk) only results in a redirect to the site root. There are suspicions that this is due to some kind of incorrect web server settings, but I don’t know with which ones.

ghost avatar Jun 25 '23 08:06 ghost

There are suspicions that this is due to some kind of incorrect web server settings, but I don’t know with which ones.

No I don't think it's that. It used to work in the past and invidious never required any special configuration.

It could be that youtube is doing some A/B testing and an endpoint that we are using for detecting short URLs doesn't work anymore.

unixfox avatar Jun 25 '23 08:06 unixfox

I have this bug too.

I use this invidious configuration on my instance https://invidious.ethibox.fr.

The format https://invidious.ethibox.fr/watch?v=fmsoym8I-3o works correctly.

But when I try to access a YouTube video with the https://invidious.ethibox.fr/fmsoym8I-3o format, it doen't work, it redirects to the homepage.

johackim avatar Jul 12 '23 10:07 johackim

"Me Too" - the same problem has been plaguing my instance for a while now, it is unclear when exactly it started. Turn on debug logging and the following shows when trying to view an affected video (using https://youtu.be/5Ge2RcvDlgw to test):

2023-07-31 22:26:09 UTC [info] 302 GET /5Ge2RcvDlgw 57.15ms
2023-07-31 22:26:09 UTC [info] 200 GET / 310.29µs

That's it, no more.

Yetangitu avatar Jul 31 '23 22:07 Yetangitu

There are suspicions that this is due to some kind of incorrect web server settings, but I don’t know with which ones.

No I don't think it's that. It used to work in the past and invidious never required any special configuration.

It could be that youtube is doing some A/B testing and an endpoint that we are using for detecting short URLs doesn't work anymore.

I dont know if it is the addon https://github.com/libredirect/browser_extension/issues/763 or invidious. but I don't think it is youtube. and my guess is invidious is as fault here. when I use that addon and use piped it redirects correctly.

in my history I see redirect from https://youtu.be/q9t8TRxEjus to https://invidious.projectsegfau.lt/q9t8TRxEjus and that goes to https://invidious.projectsegfau.lt/feed/popular.

if I do https://www.youtube.com/q9t8TRxEjus I on youtube get a

This page isn't available. Sorry about that.
Try searching for something else.

rezad1393 avatar Aug 15 '23 10:08 rezad1393

It has to be something with the routing that's been caused by the refactoring in or around https://github.com/iv-org/invidious/commit/1e25894f7ec37044698f9fddf60813e0199b921b (pull request https://github.com/iv-org/invidious/pull/3261)

Maybe this is triggered while it shouldn't since the refactoring?

ltguillaume avatar Aug 15 '23 11:08 ltguillaume

I think this might be the issue:

1e25894#diff-b83bd9a4ffeb9402d24fe6ade99f304367e1ee03b6cd25dac08b94160b034cf0R16

Aug 10, 2022?

rezad1393 avatar Aug 15 '23 11:08 rezad1393

@rezad1393 It's been around for a while now, certainly longer than the existence of this issue, and quite a few instances take a long time to update, so that would have delayed the introduction of the bug.

ltguillaume avatar Aug 15 '23 11:08 ltguillaume

Reopening as I can reproduce the issue on the test instance: https://test.invidious.io/yWsS5UJf8yU

I did close the issue before because it was working on an up to date instance: https://vid.puffyan.us/yWsS5UJf8yU

@unixfox while this example works on vid.puffyan.us, it doesn't work for e.g. https://vid.puffyan.us/dQw4w9WgXcQ. Instead of redirecting to https://vid.puffyan.us/watch?v=dQw4w9WgXcQ, it redirects to some random channel (https://vid.puffyan.us/channel/UCoG6BrhgmivrkcbEHcYtK4Q). Some other instances, including yewtu.be, redirect to the front page.

selurvedu avatar Aug 16 '23 17:08 selurvedu

It's a known problem, it's on the track list of issues to solve.

unixfox avatar Aug 16 '23 17:08 unixfox

Well, for now, you can copy the video ID, open a random video after being redirected to the front page and replace its video ID by yours to go to the video you want to see. It takes just seconds…

Trit34 avatar Aug 17 '23 07:08 Trit34

Wasn't the consensus back in #2347 that youtu.be links should be handled by external redirect programs? Did the consensus change since then?


Anyways, seems like there is logic pertaining to redirect youtu.be video ids within the 404 handler. Weird that its never triggered.

https://github.com/iv-org/invidious/blob/34508966027fce3f460d9670eeecef67b92565a0/src/invidious/routes/errors.cr#L37-L41

Probably something related to this short-circuit here.

https://github.com/iv-org/invidious/blob/34508966027fce3f460d9670eeecef67b92565a0/src/invidious/routes/errors.cr#L13-L16

syeopite avatar Aug 17 '23 19:08 syeopite

Adding that the share button gives short URLs. As they fail, it prevents users from easily to an invidious instance with a timestamp. Of course, one could still manually modify a link, but that seems like pre-industrial revolution-level toil. Love the project! image

dud1337 avatar Sep 04 '23 00:09 dud1337

these are also not correctly redirected? https://youtube.com/live/video-id like: https://youtube.com/live/ZPnlpbymGZc

rezad1393 avatar Sep 04 '23 18:09 rezad1393

many of youtube redirections that work with piped, don't work with invidious. like this https://www.youtube.com/channel/UCaB9TDPxm_dpNx6sDpZTuzg/featured because it have /features at the end, it goes to homepage of instance and not even the channel page.

rezad1393 avatar Sep 05 '23 23:09 rezad1393

many of youtube redirections that work with piped, don't work with invidious. like this https://www.youtube.com/channel/UCaB9TDPxm_dpNx6sDpZTuzg/featured because it have /features at the end, it goes to homepage of instance and not even the channel page.

This is a separate issue, this is because we do not support this functionality called "featured".

Could you please open a separate issue for that?

unixfox avatar Sep 06 '23 07:09 unixfox

Could you please open a separate issue for that?

done. https://github.com/iv-org/invidious/issues/4091

rezad1393 avatar Sep 07 '23 20:09 rezad1393