test: add some testing and prototype
This commit is contained in:
9
src/utils/options.ts
Normal file
9
src/utils/options.ts
Normal file
@@ -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"
|
||||
};
|
||||
14
test/test.ts
Normal file
14
test/test.ts
Normal file
@@ -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`);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user