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

Automatically parse Youtube URLs to get channel or user's feed #20

Open
anewuser opened this issue Jul 19, 2017 · 16 comments
Open

Automatically parse Youtube URLs to get channel or user's feed #20

anewuser opened this issue Jul 19, 2017 · 16 comments

Comments

@anewuser
Copy link
Contributor

anewuser commented Jul 19, 2017

A useful idea from Inoreader is to convert Youtube URLs in feed blocks to their appropriate feed URLs automatically on your server side, since Youtube doesn't embed the addresses in its pages, and people would need to look it up manually every time they create a new pipe.

Examples of URLs formats that may be entered in a feed block, and their corresponding feeds:

Channel:

https://www.youtube.com/channel/EXAMPLE/videos (featured|videos|about|etc.)
Actual feed: https://www.youtube.com/feeds/videos.xml?channel_id=EXAMPLE

User page:

https://www.youtube.com/user/EXAMPLE/videos (featured|videos|about|etc.)
Actual feed: https://www.youtube.com/feeds/videos.xml?user=EXAMPLE

Playlist:

https://www.youtube.com/playlist?list=EXAMPLE / https://www.youtube.com/watch?v=FOO&list=EXAMPLE
Actual feed: https://www.youtube.com/feeds/videos.xml?playlist_id=EXAMPLE

@onli
Copy link
Member

onli commented Jul 24, 2017

That's even a complete list of scenarios, isn't it? Playlists, channels, user page feeds.

@anewuser
Copy link
Contributor Author

anewuser commented Jul 26, 2017

Well, hopefully your users will be "computer literate" enough to enter URLs that include the channel or user ID (which can be manipulated with regexes to get the feeds, like in my examples), so those are all scenarios. :)

If someone is inclined to enter a direct video URL, you'd have to make use of Youtube APIs to get the feed, but I doubt that they'd be interested in your service in first place.

@onli
Copy link
Member

onli commented Jul 26, 2017

Okay then. Thanks, this is a great idea. I got it implemented in the current dev version, it will go live with the next update.

@onli
Copy link
Member

onli commented Aug 1, 2017

This feature is also online now. Could you give me feedback whether this works as expected for you?

@anewuser
Copy link
Contributor Author

anewuser commented Aug 3, 2017

It worked with the URLs I inserted to test it. I'll report it if I run through any problems.

Out of the other changes, I think that "My Pipes" should have a consistent position in the menu (it's visible on the frontpage but hidden once you open a pipe), and the settings button looks like a "turn off" icon, so my first guess was that it was a "logout" button.

@anewuser anewuser closed this as completed Aug 3, 2017
@onli
Copy link
Member

onli commented Aug 3, 2017

Super, thanks.

the settings button looks like a "turn off" icon, so my first guess was that it was a "logout" button

Oh, which button do you mean exactly?

I think that "My Pipes" should have a consistent position in the menu (it's visible on the frontpage but hidden once you open a pipe)

Yeah, I'm not sure about that. On the one hand you are right, that should be consistent. On the other it does not make sense to have a profile avatar and menu on the landing page. I'm conflicted there, thanks for the feedback though!

@anewuser
Copy link
Contributor Author

anewuser commented Aug 9, 2017

aa6565858d3a61987e46447847e700c2

@onli
Copy link
Member

onli commented Aug 10, 2017

If you see that image at the top right, then that should be there because it is your gravatar image. I remember that one being used by Wordpress, maybe they set it as default in the past? Not sure though.

But I do indeed think that menu is a bit too hidden, but I'm not sure how to fix that.

@anewuser
Copy link
Contributor Author

It must still be the default then (at least for the API you use), because the email address I'm using with your service is new and I haven't set a Gravatar for it.

@anewuser
Copy link
Contributor Author

anewuser commented Jun 22, 2019

@onli can you please take a look at this? The second feed (a Youtube playlist) is causing errors: -edited-

@anewuser anewuser reopened this Jun 22, 2019
@onli
Copy link
Member

onli commented Jun 23, 2019

@anewuser Sure. It looks like there was an additional situation where the system could not find the feed link. I added a workaround and it seems to work now. Could you test again?

@anewuser
Copy link
Contributor Author

Thank you!

@anewuser
Copy link
Contributor Author

@onli

URLs that start with https://www.youtube.com/c/NoCopyrightSounds should redirect to https://www.youtube.com/feeds/videos.xml?channel_id=UC_aEa8K-EOJ3D6gOs7HcyNg

@onli
Copy link
Member

onli commented Nov 13, 2020

I tried to get around parsing the youtube page by instead redirecting to https://www.youtube.com/feeds/videos.xml?user=NoCopyrightSounds - that works equally well here, right?

@anewuser
Copy link
Contributor Author

anewuser commented Nov 17, 2020

That depends on whether it started off as a regular user or a brand account. The previous example is actually a user account, because https://www.youtube.com/user/NoCopyrightSounds/ works too.

Here's an example of a brand account: https://www.youtube.com/c/dwpolski/videos / https://www.youtube.com/dwpolski/videos (the /c/ part seems to be optional). These links don't work on Pipes currently.

For these cases (Youtube links that don't include /user/, /channel/, or /playlist?), I think that you'd have to get the canonical channel ID from the source code (<link rel="canonical" href="https://www.youtube.com/channel/UCgLYY5Ghbnw-e1ItZg8Y82g">) and then add it to https://www.youtube.com/feeds/videos.xml?channel_id=.

@onli
Copy link
Member

onli commented Nov 22, 2020

Alright, great to know!

Let's start with the canoncal url parsing when the url contains /c/. I added that in 914841c

https://www.youtube.com/dwpolski/videos (the /c/ part seems to be optional). These links don't work on Pipes currently.

For that one in general we do not detect youtube's /videos page yet. But that could be added I think. And right, we could do that in general for all channel pages, with the canoncial url detection.

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

No branches or pull requests

2 participants