diff --git a/package.json b/package.json index 9d502ac..63045a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrape-websitee", - "version": "1.0.62", + "version": "1.0.63", "description": "Website Scraping", "main": "index.js", "scripts": { diff --git a/src/downloader.js b/src/downloader.js index e3c1974..64919ca 100644 --- a/src/downloader.js +++ b/src/downloader.js @@ -25,9 +25,14 @@ async function twitterdl2(url) { }) } else { $("div.tw-video").each(function () { + if ($(this).find(".tw-right > div > p:nth-child(1) > a").text().includes("(")) { + var qualityText = $(this).find(".tw-right > div > p:nth-child(1) > a").text().split("(")[1].split("p")[0].trim() + } else { + var qualityText = $(this).find(".tw-right > div > p:nth-child(1) > a").text().trim() + } result.type = "video" result.media.push({ - quality: $(this).find(".tw-right > div > p:nth-child(1) > a").text().split("(")[1].split(")")[0], + quality: qualityText, url: $(this).find(".tw-right > div > p:nth-child(1) > a").attr("href") }) }) @@ -36,7 +41,7 @@ async function twitterdl2(url) { } catch (err) { const result = { status: false, - message: "Media not found!" + String(err) + message: "Media not found!\n\n" + String(err) } console.log(result) return result