Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this code is from : https://leaksradar.com/converter
- function addCookieToArr(cookieStr, arrObjects) {
- var kuka = cookieStr.split("\t");
- if (kuka.length > 6) {
- var cook = new Object();
- cook.domain = kuka[0];
- cook.expirationDate = parseInt(kuka[4]);
- cook.httpOnly = kuka[1] === "TRUE";
- cook.name = kuka[5];
- cook.path = kuka[2];
- cook.secure = kuka[3] === "TRUE";
- cook.value = kuka[6];
- arrObjects.push(cook);
- }
- }
- function NetscapeToJson(cookieStr) {
- var arrObjects = [];
- var cookieStrings = cookieStr.trim().split("\n");
- for (var i = 0; i < cookieStrings.length; i++) {
- addCookieToArr(cookieStrings[i], arrObjects);
- }
- var cookieStr = JSON.stringify(arrObjects);
- return cookieStr;
- }
- // Call the function and pass the cookie strings as a single string input
- var cookieStr = `.netflix.com TRUE / FALSE 1693188644 nfvdid xxxxxxx
- .netflix.com TRUE / FALSE 1697318415 memclid xxxxxxx
- .netflix.com TRUE / FALSE 1701284757 NetflixId xxxxxxx
- .netflix.com TRUE / FALSE 1701284757 SecureNetflixId xxxxxxx`;
- var result = NetscapeToJson(cookieStr);
- console.log(result);
Add Comment
Please, Sign In to add comment