From ce45eea025e89d90a0666246927aef04a01824b1 Mon Sep 17 00:00:00 2001 From: sinkaroid Date: Tue, 18 Apr 2023 11:17:37 +0700 Subject: [PATCH] test: add some testing and prototype --- src/utils/options.ts | 9 +++++++++ test/test.ts | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/utils/options.ts create mode 100644 test/test.ts diff --git a/src/utils/options.ts b/src/utils/options.ts new file mode 100644 index 0000000..ffcdbb3 --- /dev/null +++ b/src/utils/options.ts @@ -0,0 +1,9 @@ +export default { + PORNHUB: "https://www.pornhub.com", + XNXX: "https://www.xnxx.com", + REDTUBE: "https://www.redtube.com", + XVIDEOS: "https://www.xvideos.com", + XHAMSTER: "https://xheve2.com", + YOUPORN: "https://www.youporn.com", + JAVHD: "https://javhd.today" +}; \ No newline at end of file diff --git a/test/test.ts b/test/test.ts new file mode 100644 index 0000000..2bd6a71 --- /dev/null +++ b/test/test.ts @@ -0,0 +1,14 @@ +import c from "../src/utils/options"; +import p from "phin"; + +for (const url of + [c.PORNHUB, c.XNXX, c.REDTUBE, c.XVIDEOS, c.XHAMSTER, c.YOUPORN]) { + p({ url }).then(res => { + if (res.statusCode !== 200) { + console.log(`${url} is not available, status code: ${res.statusCode}, check the sites or your own user-agent`); + } + else { + console.log(`${url} is available, can be scraped`); + } + }); +} \ No newline at end of file