Skip to content

Commit

Permalink
test: add some testing and prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkaroid committed Apr 18, 2023
1 parent ce45eea commit da29c28
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import p from "phin";
import { load } from "cheerio";

const url = "https://www.pornhub.com/view_video.php?viewkey=ph63c4e1dc48fe7";

async function test() {
const res = await p({
url: url,
"headers": {
"User-Agent": process.env.USER_AGENT || "lustpress/1.6.0 Node.js/16.9.1",
},
});

const $ = load(res.body);
const title = $("meta[property='og:title']").attr("content");
console.log(title);
console.log(res.statusCode);
}

test().catch(console.error);

0 comments on commit da29c28

Please sign in to comment.