mirror of
https://github.com/arkorty/DownLink.git
synced 2026-03-18 00:57:15 +00:00
Add support for instagram
This commit is contained in:
@@ -13,9 +13,10 @@ const DownloadForm = () => {
|
||||
const [showConfetti, setShowConfetti] = useState(false);
|
||||
const [notification, setNotification] = useState(null);
|
||||
|
||||
const isValidYouTubeUrl = (url) => {
|
||||
const youtubeRegex = /^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\/.+$/;
|
||||
return youtubeRegex.test(url);
|
||||
const isValidUrl = (url) => {
|
||||
const legalDomains =
|
||||
/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be|instagram\.com)\/.+$/;
|
||||
return legalDomains.test(url);
|
||||
};
|
||||
|
||||
const handleDownload = async (e) => {
|
||||
@@ -24,8 +25,8 @@ const DownloadForm = () => {
|
||||
if (!url) {
|
||||
setNotification("Maybe enter an URL first");
|
||||
return;
|
||||
} else if (!isValidYouTubeUrl(url)) {
|
||||
setNotification("Doesn't look like YouTube to me");
|
||||
} else if (!isValidUrl(url)) {
|
||||
setNotification("Doesn't look like a valid URL to me");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ const Home = () => {
|
||||
sequence={[
|
||||
"From YouTube!",
|
||||
1200,
|
||||
"And Instagram",
|
||||
1200,
|
||||
"Download Now!",
|
||||
1200,
|
||||
"HD Quality!",
|
||||
|
||||
Reference in New Issue
Block a user