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 1.0.7 to 1.1.0

53

dist/index.js

@@ -54,3 +54,7 @@ var __async = (__this, __arguments, generator) => {

}
return decodeURIComponent(encodeURIComponent(r));
const fixEncoding = (str) => {
const bytes = new Uint8Array(str.split("").map((char) => char.charCodeAt(0)));
return new TextDecoder("utf-8").decode(bytes);
};
return fixEncoding(r);
}, getEncodedSnapApp = function(data) {

@@ -63,7 +67,9 @@ return data.split("decodeURIComponent(escape(r))}(")[1].split("))")[0].split(",").map((v) => v.replace(/"/g, "").trim());

};
const fbRegex = /(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 igRegex = /((?:https?:\/\/)?(?:www\.)?instagram\.com\/(?:p|reel|reels|tv|stories)\/([^/?#&]+)).*/g;
if (!url.match(fbRegex) && !url.match(igRegex)) return { status: false, msg: "Link Url not valid" };
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 { status: false, msg: "Link Url not valid" };
const formData = new URLSearchParams();
formData.append("url", url);
formData.append("url", /^(https?:\/\/)(?!www\.)([a-z0-9]+)\.[a-z0-9]+\.[a-z]{2,}/i.test(url) ? url : url.replace(/^(https?:\/\/)/, "$&www."));
const response = yield fetch("https://snapsave.app/action.php?lang=id", {

@@ -86,19 +92,30 @@ method: "POST",

const thumbnail = $("article.media > figure").find("img").attr("src");
$("tbody > tr").each((_, el) => {
var _a;
const $el = $(el);
const $td = $el.find("td");
const resolution = $td.eq(0).text();
let _url = $td.eq(2).find("a").attr("href") || $td.eq(2).find("button").attr("onclick");
const shouldRender = /get_progressApi/ig.test(_url || "");
if (shouldRender) {
_url = ((_a = /get_progressApi\('(.*?)'\)/.exec(_url || "")) == null ? void 0 : _a[1]) || _url;
}
const description = $("span.video-des").text().trim();
if ($("table.table").length) {
$("tbody > tr").each((_, el) => {
var _a;
const $el = $(el);
const $td = $el.find("td");
const resolution = $td.eq(0).text();
let _url = $td.eq(2).find("a").attr("href") || $td.eq(2).find("button").attr("onclick");
const shouldRender = /get_progressApi/ig.test(_url || "");
if (shouldRender) {
_url = ((_a = /get_progressApi\('(.*?)'\)/.exec(_url || "")) == null ? void 0 : _a[1]) || _url;
}
results.push({
resolution,
thumbnail,
url: _url,
description,
shouldRender
});
});
} else {
let _url = $("a").attr("href") || $("button").attr("onclick");
results.push({
resolution,
thumbnail,
url: _url,
shouldRender
description
});
});
}
} else {

@@ -105,0 +122,0 @@ $("div.download-items__thumb").each((_, tod) => {

{
"name": "snapsave-media-downloader",
"version": "1.0.7",
"description": "Download Instagram and Facebook Media using snapsave.app downloader",
"version": "1.1.0",
"description": "Download Instagram, Facebook and TikTok media using snapsave.app downloader",
"type": "module",

@@ -9,2 +9,3 @@ "keywords": [

"facebook",
"tiktok",
"downloader",

@@ -41,12 +42,14 @@ "media",

"devDependencies": {
"@stylistic/eslint-plugin": "^2.7.2",
"@types/node": "^22.5.4",
"@typescript-eslint/parser": "^8.4.0",
"changelogen": "^0.5.5",
"cheerio": "1.0.0",
"eslint": "^9.9.1",
"@stylistic/eslint-plugin": "^2.8.0",
"@types/node": "^22.7.2",
"@typescript-eslint/parser": "^8.7.0",
"changelogen": "^0.5.7",
"eslint": "^9.11.1",
"shx": "^0.3.4",
"tsup": "^8.2.4",
"typescript": "^5.5.4"
"tsup": "^8.3.0",
"typescript": "^5.6.2"
},
"dependencies": {
"cheerio": "^1.0.0"
},
"scripts": {

@@ -53,0 +56,0 @@ "lint": "eslint . --fix",

# Snapsave Media Downloader
Download Instagram and Facebook Media using snapsave.app downloader
Download Instagram, Facebook and TikTok media using snapsave.app downloader
## Install dependency
```bash
# Using npm
npm install snapsave-media-downloader
# Using pnpm
pnpm add snapsave-media-downloader
```
Example:

@@ -6,0 +15,0 @@ ```js

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