twitter-downloader
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -44,7 +44,7 @@ export interface Twitter { | ||
type: string; | ||
url: string; | ||
image?: string; | ||
expandedUrl: string; | ||
cover?: string; | ||
duration?: string; | ||
variants?: VideoVariants[]; | ||
videos?: VideoVariants[]; | ||
} | ||
@@ -51,0 +51,0 @@ export interface VideoVariants { |
@@ -96,14 +96,14 @@ "use strict"; | ||
if (v.type === "photo") { | ||
return { type: v.type, url: v.media_url_https, expandedUrl: v.expanded_url }; | ||
return { type: v.type, image: v.media_url_https, expandedUrl: v.expanded_url }; | ||
} | ||
else { | ||
const url = v.video_info.variants | ||
.filter((v) => v.content_type === "video/mp4") | ||
.map((v) => { | ||
let quality = v.url.match(/\/([\d]+x[\d]+)\//)[1]; | ||
const videos = v.video_info.variants | ||
.filter((video) => video.content_type === "video/mp4") | ||
.map((variants) => { | ||
let quality = variants.url.match(/\/([\d]+x[\d]+)\//)[1]; | ||
return { | ||
bitrate: v.bitrate, | ||
content_type: v.content_type, | ||
bitrate: variants.bitrate, | ||
content_type: variants.content_type, | ||
quality, | ||
url: v.url, | ||
url: variants.url, | ||
}; | ||
@@ -116,3 +116,3 @@ }); | ||
expandedUrl: v.expanded_url, | ||
url, | ||
videos, | ||
}; | ||
@@ -119,0 +119,0 @@ } |
{ | ||
"name": "twitter-downloader", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Scraper for download Media from Twitter", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
@@ -8,0 +7,0 @@ "build": "tsc --build" |
@@ -78,2 +78,23 @@ # Twitter Downloader | ||
} | ||
/** Image Media */ | ||
{ | ||
type: string | ||
image: string | ||
expandedUrl: string | ||
}[] | ||
/** Video Media */ | ||
{ | ||
type: string | ||
expandedUrl: string | ||
cover: string | ||
duration: string | ||
videos: { | ||
bitrate: number | ||
content_type: string | ||
quality: string | ||
url: string | ||
}[] | ||
}[] | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14873
100
0