Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snapsave-media-downloader

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snapsave-media-downloader - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

3

dist/index.d.ts

@@ -1,2 +0,1 @@

declare const snapsave: (url: string) => Promise<SnapSaveDownloaderResponse>;
interface SnapSaveDownloaderMedia {

@@ -17,2 +16,4 @@ resolution?: string;

declare const snapsave: (url: string) => Promise<SnapSaveDownloaderResponse>;
export { snapsave };

@@ -43,2 +43,12 @@ var __defProp = Object.defineProperty;

import { load } from "cheerio";
// src/utils.ts
var facebookRegex = /^https?:\/\/(?:www\.|web\.|m\.)?facebook\.com\/(watch(\?v=|\/\?v=)[0-9]+(?!\/)|reel\/[0-9]+|[a-zA-Z0-9.\-_]+\/(videos|posts)\/[0-9]+|[0-9]+\/(videos|posts)\/[0-9]+|[a-zA-Z0-9]+\/(videos|posts)\/[0-9]+|share\/(v|r)\/[a-zA-Z0-9]+\/?)([^/?#&]+).*$|^https:\/\/fb\.watch\/[a-zA-Z0-9]+$/g;
var instagramRegex = /^https?:\/\/(?:www\.)?instagram\.com\/(?:p|reel|reels|tv|stories)\/([^/?#&]+).*/g;
var tiktokRegex = /^https?:\/\/(?:www\.|m\.|vm\.)?tiktok\.com\/(?:@[^/]+\/video\/\d+|v\/\d+|t\/[\w]+|[\w]+)\/?/g;
var normalizeURL = (url) => {
return /^(https?:\/\/)(?!www\.)[a-z0-9]+/i.test(url) ? url.replace(/^(https?:\/\/)([^./]+\.[^./]+)(\/.*)?$/, "$1www.$2$3") : url;
};
// src/index.ts
var snapsave = (url) => __async(void 0, null, function* () {

@@ -86,9 +96,6 @@ try {

};
const facebookRegex = /(https|http):\/\/(?:(?:(?:www\.)?facebook\.com\/(?:(?:(?:video\.php)||(?:watch\/))\?v=\d+|(?:[0-9a-zA-Z-_.]+\/(?:(?:video|(post))(?:s))\/)(?:[0-9a-zA-Z-_.]+(?:\/\d+)*)))|(?:fb\.watch\/(?:\w|-)+)|(?:(?:www\.)?facebook\.com\/reel\/\d+)|(?:(?:www\.)?facebook\.com\/share\/(v|r)\/[a-zA-Z0-9]+\/)\/?)/;
const instagramRegex = /((?:https?:\/\/)?(?:www\.)?instagram\.com\/(?:p|reel|reels|tv|stories)\/([^/?#&]+)).*/g;
const tiktokRegex = /((?:https?:\/\/)?(?:www\.|m\.|vm\.)?tiktok\.com\/(?:@[^/]+\/video\/\d+|v\/\d+|t\/[\w]+|[\w]+)\/?)/g;
const regexList = [facebookRegex, instagramRegex, tiktokRegex];
if (!regexList.some((regex) => url.match(regex))) return { success: false, message: "Invalid URL" };
const formData = new URLSearchParams();
formData.append("url", /^(https?:\/\/)(?!www\.)[a-z0-9]+/i.test(url) ? url.replace(/^(https?:\/\/)([^./]+\.[^./]+)(\/.*)?$/, "$1www.$2$3") : url);
formData.append("url", normalizeURL(url));
const response = yield fetch("https://snapsave.app/action.php?lang=en", {

@@ -95,0 +102,0 @@ method: "POST",

{
"name": "snapsave-media-downloader",
"version": "2.0.1",
"version": "2.0.2",
"description": "Download Instagram, Facebook and TikTok media using snapsave.app downloader",

@@ -48,3 +48,4 @@ "type": "module",

"tsup": "^8.3.5",
"typescript": "^5.6.3"
"typescript": "^5.6.3",
"vitest": "^2.1.5"
},

@@ -55,7 +56,9 @@ "dependencies": {

"scripts": {
"lint": "eslint . --fix",
"lint": "eslint .",
"build": "shx rm -rf ./dist/* && tsup-node src/index.ts --format esm --dts --config tsconfig.json",
"playground": "node playground/index.js",
"release": "changelogen --release"
"release": "changelogen --release",
"test": "vitest run --reporter=verbose",
"test:types": "tsc --noEmit"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc