Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrepol742 committed Aug 7, 2023
1 parent 0bca65a commit 45be1e1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2936,17 +2936,18 @@ async function ai(api, event) {
format: "mp4",
});
threadIdMV[event.threadID] = false;
utils.logged("downloading " + search.results[0].title);
let title = search.results[0].title;
utils.logged("downloading " + title);
sendMessage(api, event, {
body: search.results[0].title.substring(0, 25) + "..." + " is now in upload progress please wait.",
body: title.substring(0, 25) + "..." + " is now in upload progress please wait.",
});
let filename = __dirname + "/cache/video_" + utils.getTimestamp() + ".mp4";
let file = fs.createWriteStream(filename);

for await (var chunk of Utils.streamToIterable(stream)) {
file.write(chunk);
}
getResponseData("https://sampleapi-mraikero-01.vercel.app/get/lyrics?title=" + search.results[0].title).then((response) => {
getResponseData("https://sampleapi-mraikero-01.vercel.app/get/lyrics?title=" + data.join(" ")).then((response) => {
if (response == null) {
sendMessage(api, event, "Unfortunately, There is a problem processing your request.\n\nIf issue persist, please create an appeal at https://github.com/prj-orion/issues.");
} else {
Expand Down Expand Up @@ -2989,9 +2990,10 @@ async function ai(api, event) {
format: "mp4",
});
threadIdMV[event.threadID] = false;
utils.logged("downloading " + search.results[0].title);
let title = search.results[0].title;
utils.logged("downloading " + title);
sendMessage(api, event, {
body: search.results[0].title.substring(0, 25) + "..." + " is now in upload progress please wait.",
body: title.substring(0, 25) + "..." + " is now in upload progress please wait.",
});
let filename = __dirname + "/cache/video_" + utils.getTimestamp() + ".mp4";
let file = fs.createWriteStream(filename);
Expand Down Expand Up @@ -3047,7 +3049,7 @@ async function ai(api, event) {
for await (chunk of Utils.streamToIterable(stream)) {
file.write(chunk);
}
getResponseData("https://sampleapi-mraikero-01.vercel.app/get/lyrics?title=" + search.results[0].title).then((response) => {
getResponseData("https://sampleapi-mraikero-01.vercel.app/get/lyrics?title=" + data.join(" ")).then((response) => {
if (response == null) {
sendMessage(api, event, "Unfortunately, There is a problem processing your request.\n\nIf issue persist, please create an appeal at https://github.com/prj-orion/issues.");
} else {
Expand Down

0 comments on commit 45be1e1

Please sign in to comment.