Skip to content

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

@miku4k

Description

@miku4k

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";
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions