yt icon indicating copy to clipboard operation
yt copied to clipboard

can't get the correct videos from Channel's short link on Yt::Channel module

Open calvinsugianto opened this issue 3 years ago • 2 comments

hello guys, anyone know if we can handle link like https://www.youtube.com/c/SothebysInternationalRealtyCanada

for this Channel module Yt::Channel.new(url: urlString)

it fetch the wrong videos If u se that kind of link, but it works if I use with the channel ID instead like: https://www.youtube.com/channel/UCThC92be9fNbkZ4P2cXpMjg

If we can't use that kind of url, is there any way we can get Channel ID from this kind of url: https://www.youtube.com/c/SothebysInternationalRealtyCanada

So I can convert it in my backend to become channel/[ID]

Thanks guys, really need help for this issue

calvinsugianto avatar Feb 15 '22 07:02 calvinsugianto

I think it is not possible to fix this reliably. Recently I was working on an algorithm that would convert channel custom names into channel ids

And this is the only workaround, I found https://stackoverflow.com/questions/63046669/obtaining-a-channel-id-from-a-youtube-com-c-xxxx-link/63081162#63081162

In your example, "SothebysInternationalRealtyCanada" is the channel's custom name

pavelbonda avatar Apr 06 '22 11:04 pavelbonda

That's weird, this regex covers that channel url

https://github.com/Fullscreen/yt/blob/master/lib/yt/models/resource.rb#L101

Screen Shot 2022-06-16 at 1 37 40 PM

kangkyu avatar Jun 16 '22 20:06 kangkyu

I think we can close this issue. Let me know if other concerns

kangkyu avatar Oct 29 '22 18:10 kangkyu