Advertisement
samiroexpikachu

Ytlix

Jun 5th, 2024
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const axios = require('axios');
  2.  
  3. module.exports = {
  4.     config: {
  5.         name: "ytlix",
  6.         aliases: ["ytcribe"],
  7.         version: "1.0",
  8.         author: "Samir Œ x DmatrixPikachu ",
  9.         shortDescription: "Get transcript from the provided YouTube link ",
  10.         longDescription: "Fetches transcript using the provided YouTube link.",
  11.         category: "ai",
  12.         guide: { en: "{pn} [question]" },
  13.     },
  14.  
  15.     onStart: async function ({ message, args }) {
  16.         const question = args.join(" ");
  17.         if (!question) {
  18.             return message.reply("❌ Please provide a link to proceed.");
  19.         } else {
  20.             try {
  21.                 const response = await axios.get(`https://apis-samir.onrender.com/yt/transcript?url=${encodeURIComponent(question)}`);
  22.              
  23.                
  24.                 const urlBase = response.data.transcript;
  25.  
  26.                 message.reply(`caption: ${urlBase}`);
  27.             } catch (e) {
  28.                 console.error(e);
  29.                 message.reply("❌ Error while fetching the response.");
  30.             }
  31.         }
  32.     }
  33. };
  34. //limiter 1 minutes. higher than limit may cause storten response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement