frostpv 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1042,7 +1042,7 @@ async function downloadSmartVideo(url, config) {
|
|
|
1042
1042
|
if (!directUrl) throw new Error("No media URL found in Pinterest response");
|
|
1043
1043
|
|
|
1044
1044
|
// HEAD validate
|
|
1045
|
-
const head = await axios.head(directUrl, { timeout: 10000 }).catch(() => null);
|
|
1045
|
+
const head = await axios.head(directUrl, { timeout: 10000, maxRedirects: 5 }).catch(() => null);
|
|
1046
1046
|
if (!head || (head.status < 200 || head.status >= 400)) {
|
|
1047
1047
|
throw new Error("Pinterest media URL not accessible");
|
|
1048
1048
|
}
|
|
@@ -1459,8 +1459,11 @@ function getFileName(url) {
|
|
|
1459
1459
|
// Function to unshorten URLs
|
|
1460
1460
|
async function unshortenUrl(url) {
|
|
1461
1461
|
try {
|
|
1462
|
-
// Special handling for Facebook
|
|
1463
|
-
if (
|
|
1462
|
+
// Special handling for Facebook and Pinterest short-links
|
|
1463
|
+
if (
|
|
1464
|
+
url.includes('facebook.com') || url.includes('fb.watch') || url.includes('fb.com') ||
|
|
1465
|
+
url.includes('pin.it') || url.includes('pinterest.com')
|
|
1466
|
+
) {
|
|
1464
1467
|
const response = await axios.get(url, {
|
|
1465
1468
|
maxRedirects: 10,
|
|
1466
1469
|
timeout: 10000,
|