Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirokamiRyzen committed Dec 11, 2024
1 parent 911041c commit 0ee1d2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/youtube-yta.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let handler = async (m, { conn, command, text, usedPrefix }) => {

if (!response.data || !response.data.url) throw new Error('Audio not found or unavailable.');

const { title, lengthSeconds, views, uploadDate, thumbnail, url, filename } = response.data;
const { title, lengthSeconds, views, uploadDate, thumbnail, url, filename, author } = response.data;

const tmpDir = os.tmpdir();
const filePath = `${tmpDir}/${filename}`;
Expand All @@ -31,7 +31,7 @@ let handler = async (m, { conn, command, text, usedPrefix }) => {
const writableStream = fs.createWriteStream(filePath);
await streamPipeline(audioResponse.data, writableStream);

const info = `Title: ${title}\nLength: ${lengthSeconds}\nViews: ${views}\nUploaded: ${uploadDate}`;
const info = `Title: ${title}\n*Author*: ${author}\nLength: ${lengthSeconds}\nViews: ${views}\nUploaded: ${uploadDate}`;

await conn.sendMessage(m.chat, {
document: {
Expand Down
4 changes: 2 additions & 2 deletions plugins/youtube-ytv.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let handler = async (m, { conn, command, text, usedPrefix }) => {

try {
const response = await axios.get(apiUrl);
const { url: videoStreamUrl, filename, lengthSeconds, title, uploadDate, views } = response.data;
const { url: videoStreamUrl, filename, lengthSeconds, title, uploadDate, views, author } = response.data;

if (!videoStreamUrl) throw 'Video URL not found in API response.';

Expand Down Expand Up @@ -45,7 +45,7 @@ let handler = async (m, { conn, command, text, usedPrefix }) => {
});
});

const caption = `Ini kak videonya @${m.sender.split('@')[0]}\n\n*Title*: ${title} (${resolution})\n*Duration*: ${lengthSeconds}\n*Views*: ${views}\n*Uploaded*: ${uploadDate}`;
const caption = `Ini kak videonya @${m.sender.split('@')[0]}\n\n*Title*: ${title} (${resolution})\n*Author*: ${author}\n*Duration*: ${lengthSeconds}\n*Views*: ${views}\n*Uploaded*: ${uploadDate}`;

// Send the fixed video
await conn.sendMessage(m.chat, {
Expand Down

0 comments on commit 0ee1d2b

Please sign in to comment.