This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint esversion: 6*/ | |
const assert = require('assert'); | |
const async = require('async'); | |
const fs = require('fs'); | |
let request = require('request'); | |
const FileCookieStore = require('tough-cookie-filestore'); | |
if (!fs.existsSync('cookies.json')) { fs.writeFileSync('cookies.json', '{}'); } | |
let j = request.jar(new FileCookieStore('cookies.json')); | |
request = request.defaults({ jar : j }); |