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

feat(yt-dlp) add yt-dlp #2592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

BalliAsghar
Copy link
Contributor

Added Specs for yt-dlp

@withfig-bot
Copy link
Collaborator

Overview

src/yt-dlp.ts:

Info:

Single Functions:

postProcess:

 function (out) {
    // Regex to identify YouTube URLs
    const regex = new RegExp(
      "^(https?://)?(www.)?(youtube.com|youtu.?be)/.+$",
      "gm"
    );

    try {
      // Check if the clipboard content contains YouTube URLs
      const matches = out.match(regex);

      if (!matches || matches.length === 0) return [];

      // Return each matched URL as a suggestion
      return matches.map((url) => {
        const isPlaylist = url.includes("playlist") || url.includes("list=");
        return {
          name: url.trim(),
          description: isPlaylist ? "YouTube playlist" : "YouTube video",
          icon: "https://www.youtube.com/s/desktop/810941b4/img/favicon_32.png",
        };
      });
    } catch (e) {
      console.error(e);
      return [];
    }
  }

URLs:

  • https://www.youtube.com/s/desktop/810941b4/img/favicon_32.png
  • https://sponsor.ajay.app
  • https://sponsor.ajay.app

@withfig-bot
Copy link
Collaborator

Hello @BalliAsghar,
thank you very much for creating a Pull Request!
Here is a small checklist to get this PR merged as quickly as possible:

  • Do all subcommands / options which take arguments include the args property (args: {})?
  • Are all options modular? E.g. -a -u -x instead of -aux
  • Have all other checks passed?

Please add a 👍 as a reaction to this comment to show that you read this.

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

Successfully merging this pull request may close these issues.

2 participants