888sports-api
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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 | ||
} |
'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 => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
380518
8
251
6
+ Addedaxios-fetch-request@^1.0.0
+ Addedagent-base@7.1.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.8(transitive)
+ Addedaxios-cookiejar-support@4.0.7(transitive)
+ Addedaxios-fetch-request@1.0.1(transitive)
+ Addedbiskviit@1.0.1(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedencoding@0.1.12(transitive)
+ Addedfetch@1.1.0(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedhttp-cookie-agent@5.0.4(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)