Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -986,13 +986,17 @@ app.get('/r34cookie', async (req, res) => {
|
|
986 |
}
|
987 |
});
|
988 |
|
|
|
989 |
|
990 |
|
991 |
// Fungsi untuk mendapatkan data dari API Pixiv berdasarkan ID ilustrasi
|
992 |
async function pixivGetData(illustId) {
|
993 |
const headers = {
|
994 |
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; SM-G998B Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.58 Mobile Safari/537.36 WhatsApp/1.2.3',
|
995 |
-
'Referer': 'https://www.pixiv.net/'
|
|
|
|
|
|
|
996 |
};
|
997 |
|
998 |
try {
|
@@ -1008,12 +1012,18 @@ async function pixivGetData(illustId) {
|
|
1008 |
async function downloadAndExtractZipFromPixivData(pixivData) {
|
1009 |
const pixivId = pixivData.body.illust_details.id;
|
1010 |
const zipUrl = pixivData.body.illust_details.ugoira_meta.src;
|
1011 |
-
|
|
|
|
|
|
|
1012 |
|
1013 |
try {
|
1014 |
const headers = {
|
1015 |
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; SM-G998B Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.58 Mobile Safari/537.36 WhatsApp/1.2.3',
|
1016 |
-
'Referer': 'https://www.pixiv.net/'
|
|
|
|
|
|
|
1017 |
};
|
1018 |
const response = await axios.get(zipUrl, { responseType: 'arraybuffer', headers });
|
1019 |
|
@@ -1035,6 +1045,7 @@ async function downloadAndExtractZipFromPixivData(pixivData) {
|
|
1035 |
}
|
1036 |
}
|
1037 |
|
|
|
1038 |
// Fungsi untuk membuat video dari file image yang sudah diekstrak
|
1039 |
async function createVideoFromExtractedImages(pixivData, frameDir) {
|
1040 |
const pixivId = pixivData.body.illust_details.id;
|
|
|
986 |
}
|
987 |
});
|
988 |
|
989 |
+
let kue = 'p_ab_id=5; p_ab_id_2=4; p_ab_d_id=1131020051; PHPSESSID=98423123_ooWiGNZmn10FSApJ6AE7tfFStuzzSPvS; device_token=204de0e72a664d1b93d4d9bf1913c6cf; privacy_policy_agreement=7; webp_available=1; c_type=19; privacy_policy_notification=0; a_type=0; b_type=2; yuid_b=I0QxAZA; first_visit_datetime=2024-10-23%2016%3A18%3A55; __cf_bm=AF3_34pfnlX3j.z9HgTHRXT_VPiboGN1xCtpGEIAl6g-1729667935-1.0.1.1-i8bf6DbM4hqEBcXVI8PtrjFt4pgvg.SNNkr9y1wwhnilldAD6qQYltFmwlFJgVgug3zR41_1NO43zA4kdLe0MvRYRu3SkoiyaH8_bf7S4Rw; cf_clearance=myv1GHmvbUejqJyyBWI.VKf26uxBSPf_TIslXxb1t74-1729667943-1.2.1.1-pbZD7QZA95M9OqhnIuUreLC4aGuTLgXpm8DN7eRAb_XmjwLv53uYqq3vVTF06MMKOxQmVER9aZIUU7vw2zT3sGK_3nrDLHCSJ4CeAezc7yjS69guPqtmkqn.tMIuxt399W82C.9zagzJ.Eo0vs91tllX1yVBNPIZ8rV2BunLinWWIcHR8lqiVyXUgRh1VEk_juC0_Tsezh1OcZ39LswLY8da0Vf5g6z5REZRgw1X18LwBNARVetsNojdIiUasWn7jLbPCGYezaHrMsg7Eqy.sfb8T6xlGGS4hDjr_dD9sTIp7RcU6geIAl5KiY4dXjhTY3Kn1B8MugIzpSjNzBvMqkTI9fEVuil7iaPXfw_O8Dc8TPc7z2q.wk0ofJVSn.7O';
|
990 |
|
991 |
|
992 |
// Fungsi untuk mendapatkan data dari API Pixiv berdasarkan ID ilustrasi
|
993 |
async function pixivGetData(illustId) {
|
994 |
const headers = {
|
995 |
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; SM-G998B Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.58 Mobile Safari/537.36 WhatsApp/1.2.3',
|
996 |
+
'Referer': 'https://www.pixiv.net/',
|
997 |
+
"Sec-Ch-Ua": `"Not-A.Brand";v="99", "Chromium";v="124"`,
|
998 |
+
'Baggage': "sentry-environment=production,sentry-release=1ab9ad920c28fb6fd4598d3745c828c3e2facd3a,sentry-public_key=e0efdb023498416a827321504f31f009,sentry-trace_id=bc354f2c0c8a461eaab6764025f0b7e1,sentry-sample_rate=0.0001",
|
999 |
+
'Cookie': kue
|
1000 |
};
|
1001 |
|
1002 |
try {
|
|
|
1012 |
async function downloadAndExtractZipFromPixivData(pixivData) {
|
1013 |
const pixivId = pixivData.body.illust_details.id;
|
1014 |
const zipUrl = pixivData.body.illust_details.ugoira_meta.src;
|
1015 |
+
|
1016 |
+
// Generate nama folder dengan karakter acak
|
1017 |
+
const randomFolderName = crypto.randomBytes(8).toString('hex');
|
1018 |
+
const outputDirectory = path.join(tmpDir, `${pixivId}_${randomFolderName}`);
|
1019 |
|
1020 |
try {
|
1021 |
const headers = {
|
1022 |
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; SM-G998B Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.58 Mobile Safari/537.36 WhatsApp/1.2.3',
|
1023 |
+
'Referer': 'https://www.pixiv.net/',
|
1024 |
+
"Sec-Ch-Ua": `"Not-A.Brand";v="99", "Chromium";v="124"`,
|
1025 |
+
'Baggage': "sentry-environment=production,sentry-release=1ab9ad920c28fb6fd4598d3745c828c3e2facd3a,sentry-public_key=e0efdb023498416a827321504f31f009,sentry-trace_id=bc354f2c0c8a461eaab6764025f0b7e1,sentry-sample_rate=0.0001",
|
1026 |
+
'Cookie': kue
|
1027 |
};
|
1028 |
const response = await axios.get(zipUrl, { responseType: 'arraybuffer', headers });
|
1029 |
|
|
|
1045 |
}
|
1046 |
}
|
1047 |
|
1048 |
+
|
1049 |
// Fungsi untuk membuat video dari file image yang sudah diekstrak
|
1050 |
async function createVideoFromExtractedImages(pixivData, frameDir) {
|
1051 |
const pixivId = pixivData.body.illust_details.id;
|