Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Client = require('ftp');
- var fs = require('fs');
- var request = require('request');
- var cheerio = require('cheerio');
- var basicData = "# ALLOW TELNETINFO : no\n" +
- "ALLOW WEBINFO : yes\n" +
- "WEBINFO USERNAME : dusnoki\n" +
- "WEBINFO PASSWORD : iPhoneguru88\n" +
- "# TELNETINFO USERNAME : <username>\n" +
- "# TELNETINFO PASSWORD : <password>\n" +
- "# TELNETINFO LISTEN PORT : 16000\n" +
- "WEBINFO LISTEN PORT : 16001\n" +
- "# ZAP OSD TIME : 3\n" +
- "# OSD USERNAME : root\n" +
- "# OSD PASSWORD : dreambox\n" +
- "# OSD PORT : 80\n" +
- "# SERIAL READER : <device> <type>\n" +
- "# SERIAL READER : /dev/tts/0\n" +
- "# SMARTCARD WRITE DELAY : <device> <delay>\n" +
- "# SMARTCARD WRITE DELAY : /dev/ttyUSB0 10000\n" +
- "# SMARTCARD WRITE DELAY : /dev/tts/0_7 8000\n" +
- "# SMARTCARD CLOCK FREQUENCY : <device> <freq>\n" +
- "# SMARTCARD CLOCK FREQUENCY : /dev/ttyUSB0 5500000\n" +
- "# SHOW TIMING : yes\n" +
- "# MINI OSD : yes\n" +
- "# DEBUG : yes\n" +
- "# NEWCAMD CONF : yes\n" +
- "# B : /dev/sci0 01\n" +
- "# B : /dev/tts/0 07\n" +
- "# B : /dev/sci0 01\n" +
- "# DISABLE EMM : yes\n" +
- "# GLOBAL EMM : 1\n" +
- "# EXTRA EMM LEVEL : yes\n" +
- "# EMM THREADS : 1\n" +
- "# BOXKEY : <device> <byte1> <byte2> <byte3> <byte4>\n" +
- "# BOXKEY : /dev/sci0 00 11 22 33\n" +
- "# PIN : <device> <pin>\n" +
- "# PIN : /dev/sci0 1234\n" +
- "# CAMKEY : <device> <byte1> <byte2> <byte3> <byte4> <byte5> <byte6> <byte7> <byte8>\n" +
- "# CAMKEY : /dev/sci0 11 22 33 44 55 66 77 88\n" +
- "# CAMDATA : <device> <byte1> <byte2> <byte3> <byte4> <byte5> <byte6> ... <byte64>\n" +
- "# CAMDATA : /dev/sci0 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff\n" +
- "# BEEF ID : <ident1> <ident2> <ident3> <ident4> <ident5> <ident6> <ident7> <ident8> <device>\n" +
- "# BEEF ID : 4101 0 0 0 0 0 0 0 /dev/sci0\n" +
- "# SOFTKEY FILE : /var/keys/SoftCam.Key\n" +
- "# AUTOROLL FILE : /var/keys/AutoRoll.Key\n" +
- "# STATIC CW FILE : /var/keys/constant.cw\n" +
- "# CAID PRIO FILE : /var/etc/CCcam.prio\n" +
- "# PROVIDERINFO FILE : /var/etc/CCcam.providers\n" +
- "# CHANNELINFO FILE : /var/etc/CCcam.channelinfo\n" +
- "# LOG WARNINGS : /tmp/warnings.txt\n" +
- "# NEWCAMD STEALTH : 0\n" +
- "# LOADBALANCE : <device1> <device2> .. <devicen> { <exceptsid1>, <exceptsid2> .. , <exceptsidn> }\n" +
- "# LOADBALANCE : /dev/ttyS0 /dev/ttyS1 /dev/ttyS2\n" +
- "# LOADBALANCE : /dev/ttyS5 /dev/ttyS6 { 0df3,0de1 }\n" +
- "# MINIMUM CLIENT VERSION : 1.3.0\n" +
- "# MINIMUM CLIENT VERSION : 2.2.0\n" +
- "# MINIMUM CLIENT VERSION : 1.7.0\n" +
- "# TRY ALL CHIDS : <device>\n" +
- "# TRY ALL CHIDS : /dev/ttyUSB0\n" +
- "# DVB API : <value>\n" +
- "# DVB API : -1\n" +
- "# GLOBAL LIMITS : { caid:id(:downhops), caid:id(:downhops), ... }\n" +
- "# GLOBAL LIMITS : { 0100:000080, 0622:000000:1, 0500:000000:2 }\n" +
- "# MINIMUM DOWNHOPS : <value>\n" +
- "# MINIMUM DOWNHOPS : 1\n" +
- "# IGNORE NODE : <nodeid>\n" +
- "# IGNORE NODE : ccd536ab515767ad\n" +
- "# IGNORE NODE : aad536ab515761af\n" +
- "# SECA HANDLER : <value>\n" +
- "# SECA HANDLER : 1\n" +
- "# SECA HANDLER : 2\n" +
- "# SECA HANDLER : 3\n" +
- "# SECA HANDLER : 4\n" +
- "# SMARTCARD SID ASSIGN : <device> <maxnumberofsids> { <sid1>, <sid2>, ... <sidn> }\n" +
- "# SMARTCARD SID ASSIGN : /dev/ttyUSB0 0 { 0df3,0df4,0df5 }\n" +
- "# SMARTCARD SID ASSIGN : /dev/ttyUSB0 5\n" +
- "# SMARTCARD SID ASSIGN : /dev/ttyUSB0 5 { 0df3,0df4,0df5 }\n" +
- "# SMARTCARD SID REJECT : <device> { <sid1>, <sid2>, ... <sidn> }\n" +
- "# SMARTCARD SID ASSIGN : /dev/ttyUSB0 { 0df3,0df4,0df5 }\n" +
- "# SCIDEVICES : <number>\n" +
- "# SCIDEVICES : 0\n" +
- "# SCIDEVICES : 2"
- var newData = "";
- var c = new Client();
- c.on('ready', function() {
- c.cwd('etc', function(error) {
- // c.list(function(err, list) {
- // if (err) throw err;
- // console.dir(list);
- // c.end();
- // });
- if (error) throw error;
- c.get('CCcam.cfg', function(err, stream) {
- if (err) throw err;
- stream.pipe(fs.createWriteStream('temp/CCcam.cfg'));
- var url = 'http://www.boss-cccam.com/Test.php';
- // The structure of our request call
- // The first parameter is our URL
- // The callback function takes 3 parameters, an error, response status code and the html
- request(url, function(error, response, html){
- // First we'll check to make sure no errors occurred when making the request
- if(!error){
- // Next, we'll utilize the cheerio library on the returned html which will essentially give us jQuery functionality
- var $ = cheerio.load(html);
- // Finally, we'll define the variables we're going to capture
- var cline;
- $('.alert.alert-info').filter(function(){
- // Let's store the data we filter into a variable so we can easily see what's going on.
- var data = $(this);
- // console.log("data", data.children().children().last().text);
- // In examining the DOM we notice that the title rests within the first child element of the header tag.
- // Utilizing jQuery we can easily navigate and get the text by writing the following code:
- cline = data.children().first().children().first().text();
- newData += cline + '\n';
- console.log('newData', newData);
- request("http://www.cccamlux.com/Free-CCcam.php", function(error1, response1, html1) {
- if (!error1) {
- var $1 = cheerio.load(html1);
- // Finally, we'll define the variables we're going to capture
- var cline2;
- $1('.alert.alert-warning').filter(function(){
- // Let's store the data we filter into a variable so we can easily see what's going on.
- var data1 = $(this);
- // console.log("data", data.children().children().last().text);
- // In examining the DOM we notice that the title rests within the first child element of the header tag.
- // Utilizing jQuery we can easily navigate and get the text by writing the following code:
- cline2 = data1.children().first().children().first().text();
- var array = cline2.split(" ");
- var server = array[1];
- var port = array[3];
- var user = array[5];
- var pass = array[7];
- var newCline = "C: " + server + " " + port + " " + user + " " + pass +"\n";
- newData += newCline;
- request("http://cccam-full.com/freecccam.php", function(error3, response3, html3){
- // First we'll check to make sure no errors occurred when making the request
- if(!error3){
- // Next, we'll utilize the cheerio library on the returned html which will essentially give us jQuery functionality
- var $3 = cheerio.load(html3);
- // Finally, we'll define the variables we're going to capture
- var cline3;
- $3('.alert.alert-info').filter(function(){
- // Let's store the data we filter into a variable so we can easily see what's going on.
- var data3 = $3(this);
- // console.log("data", data.children().children().last().text);
- // In examining the DOM we notice that the title rests within the first child element of the header tag.
- // Utilizing jQuery we can easily navigate and get the text by writing the following code:
- cline3 = data3.children().first().children().first().text();
- newData += cline3 + '\n';
- // Once we have our title, we'll store it to the our json object.
- console.log(newData);
- fs.writeFile('temp/CCcam.cfg', newData+basicData, function (err) {
- console.log("written data");
- if (err) throw err;
- c.put('temp/CCcam.cfg', 'CCcam.cfg', function(err) {
- if (err) throw err;
- console.log('Uploaded data');
- c.end();
- });
- })
- });
- }});
- })
- }
- });
- })
- }
- });
- });
- });
- });
- // connect to localhost:21 as anonymous
- c.connect({host: '192.168.1.2', user: 'root', password: 'reamboxDguru88'});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement