diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000..8cc94d5 Binary files /dev/null and b/public/icon.png differ diff --git a/src/pages/api/download.ts b/src/pages/api/download.ts index 5c266fb..f9e7ca3 100644 --- a/src/pages/api/download.ts +++ b/src/pages/api/download.ts @@ -28,3 +28,9 @@ export default async function handler( res.status(405).json({ message: "Method not allowed", code: 405 }); } } + +export const config = { + api: { + responseLimit: false, + }, +}; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e3c0f1a..c0efbb1 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -9,16 +9,13 @@ export default function Home() { const getTitle = async (videoID: string) => { const youtubeAPI = `https://www.googleapis.com/youtube/v3/videos?part=snippet&id=${videoID}&fields=items(id%2Csnippet)&key=AIzaSyB8Fk-MWT_r8nVgG35gIZoP-DhJYpJ_tZ0`; - let response = await fetch(youtubeAPI); - const res = await response.json(); - const title = res.items[0].snippet.title; - return title; + const response = await fetch(youtubeAPI).then(res => res.json()); + return response.items[0].snippet.title; }; const getVideoID = (url: string) => { if (url.match(/watch/)) { - const videoID = url.split("/")[3].split("?")[1].split("=")[1]; - return videoID; + return url.split("/")[3].split("?")[1].split("=")[1]; } else if (url.match(/youtu.be/)) { const videoID = url != "" && url.split("/")[3]; return videoID; @@ -39,7 +36,6 @@ export default function Home() { .then(res => res.blob()) .then(blob => { const sizeInBytes = blob.size; - console.log("sizeInBytes: ", sizeInBytes); if (sizeInBytes <= 0) { setInfo( "Unable to download! Maybe File size is too high. Try to download video less than 5MB" diff --git a/tailwind.config.js b/tailwind.config.js index e182eeb..3027301 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,5 @@ module.exports = { - purge: ["./src/pages/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"], - darkMode: false, // or 'media' or 'class' + purge: ["./src/pages/*.{js,ts,jsx,tsx}"], theme: { extend: {}, },