Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

888sports-api

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

888sports-api - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

controllers/cookies.controller.js

29

api/base.api.js

@@ -5,5 +5,25 @@ require('dotenv').config();

const { CookieJar } = require('tough-cookie');
const Ck = [
//'_ga_T9PNVVL13N=GS1.1.1634869424.2.1.1634870608.60;',
//'_ga=GA1.1.126253252.1631309980;',
//'_gcl_au=1.1.1982248783.1631309980;',
//'888Cookie=lang%3Dpt%26OSR%3D485472%26RefType%3DNoReferrer%26TestData%3D%7B%22country%22%3A%22bra%22%2C%22last-referrer%22%3A%22https%3A%2F%2Fwww.google.com%2F%22%2C%22orig-lp%22%3A%22https%3A%2F%2Fwww.888sport.com%2Fpt%2F%22%2C%22referrer%22%3A%22https%3A%2F%2Fwww.google.com%22%7D;',
//'bbsess=eQ8kjdF0oMdf4gpamAXZK6PT64e;',
'lang=por;',
'odds_format=FRACIONAL;',
//'_gid=GA1.2.550140437.1634869424;',
//'spectate_session=56cc83f0-229d-4c98-b733-a0b8862db7f7%3Aanon;',
//'_gat_UA-125725186-7=1;'
]
function parseCookie(arr = []) {
var txt = '';
for(var ar of arr){
txt += `${ar} `
}
console.log(txt)
return txt;
}
var header = {
accept: '*/*',
//'content-type': 'multipart/form-data',
'accept-encoding': 'gzip, deflate, br',

@@ -14,3 +34,3 @@ 'accept-language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',

//'sec-ch-ua-platform': '"Linux"',
'cookie': process.env.COOKIE || '_gcl_au=1.1.1982248783.1631309980; 888Cookie=lang%3Dpt%26OSR%3D485472%26RefType%3DSearchEngine%26TestData%3D%7B%22country%22%3A%22bra%22%2C%22last-referrer%22%3A%22https%3A%2F%2Fwww.google.com%2F%22%2C%22orig-lp%22%3A%22https%3A%2F%2Fwww.888sport.com%2Fpt%2F%22%2C%22referrer%22%3A%22https%3A%2F%2Fwww.google.com%22%7D; _gid=GA1.2.550140437.1634869424; bbsess=O7cK4iDToZUSq%2CRnt193ywBqBN3; lang=por; odds_format=DECIMAL; spectate_session=859e30dc-703b-4d0b-8b70-cb3201a36629%3Aanon; _ga=GA1.2.126253252.1631309980; _gat_UA-125725186-7=1; _ga_T9PNVVL13N=GS1.1.1634869424.2.1.1634870608.60',
'cookie': process.env.COOKIE || parseCookie(Ck),
//newrelic: 'eyJ2IjpbMCwxXSwiZCI6eyJ0eSI6IkJyb3dzZXIiLCJhYyI6IjI1MDk2NzQiLCJhcCI6IjMwNzYyODM3IiwiaWQiOiIzYTg3ODBjMmU1MzY1Y2U3IiwidHIiOiI2MWI5MTJmOWNkYmU0MjI5IiwidGkiOjE2MzQ4NzA2MDkzMjd9fQ==',

@@ -27,5 +47,6 @@ origin: 'https://www.888sport.com',

const jar = new CookieJar();
const URL = process.env.BASE || 'https://spectate-web.888sport.com';
//console.log(JSON.stringify(jar))
const api = wrapper(axios.create({
baseURL: process.env.BASE || 'https://spectate-web.888sport.com',
baseURL: URL,
headers: header,

@@ -37,3 +58,3 @@ jar: jar,

module.exports = {
api, jar
api, jar, header, URL
}

5

index.js
'use strict'
const qs = require('qs');
const { api } = require("./api/base.api");
const { api, jar } = require("./api/base.api");
const { cookiesSet } = require('./controllers/cookies.controller');

@@ -174,3 +175,3 @@ class bets888 {

queryHost(url = '', method = '', query = {}){
queryHost(url = '', method = '', query = {}) {
return new Promise((resolve, reject) => {

@@ -177,0 +178,0 @@ api[method](url, qs.stringify(query)).then(rest => {

{
"name": "888sports-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "api para 888sports.com",

@@ -31,2 +31,3 @@ "main": "index.js",

"axios-cookiejar-support": "^2.0.3",
"axios-fetch-request": "^1.0.0",
"dotenv": "^10.0.0",

@@ -33,0 +34,0 @@ "qs": "^6.10.1",

@@ -5,5 +5,5 @@

// sport.webConfig().then(rest => {
// console.log(rest)
// })
sport.webConfig().then(rest => {
console.log(rest)
})

@@ -10,0 +10,0 @@ // sport.breadcrumbs().then(rest => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc