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

Check if the original link is refering to a video #94

Open
BackHDLP opened this issue Nov 3, 2023 · 0 comments
Open

Check if the original link is refering to a video #94

BackHDLP opened this issue Nov 3, 2023 · 0 comments

Comments

@BackHDLP
Copy link

BackHDLP commented Nov 3, 2023

Problem

Some links to youtube.com aren't videos (e.g. community posts, the settings, and YouTube Studio), but they get picked up by PipedLinkBot anyway which spits out broken links.

This would fix #1 and #67.

Possible Solution

With my limited understanding of things, I think changing the array at line 14 in utils.ts to replace "youtube.com"with "youtube.com/watch" and add "youtube.com/shorts" and somehow making line 20 use "piped.video/watch" if urlObj.hostname begins with "youtube.com" would do the job.

This code should be near functional to replace line 20, but I don't have a way of verifying that right now.

const isYTcom = urlObj.hostname.startsWith("youtube.com");

if (isYTcom) {
        urlObj.hostname = "piped.video/watch";
}; 
else {
        urlObj.hostname = "piped.video";
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant