Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- - name: status whatsapp saver
- - require: node [glob, cli-table, shelljs, readline, colors]
- - install: wget https://pastebin.com/raw/jTL3MRjQ -O swdL.js
- */
- const glob = require('glob')
- const table1 = require("cli-table")
- const shelljs = require('shelljs')
- const readline = require('readline')
- const fs = require('fs')
- require('colors')
- const _tableFile = new table1({
- head: ['no', 'modified', 'name', 'type'],
- colWidths: [5, 17, 40, 8]
- })
- const ask = readline.createInterface({
- input : process.stdin,
- output: process.stdout
- })
- if (!fs.existsSync('/sdcard/unduh-sw')) {
- shelljs.mkdir('/sdcard/unduh-sw')
- return
- }
- const __dir = '/sdcard/WhatsApp/Media/.Statuses/'
- console.log('\n [ STATUS WHATSAPP SAVER (swdL) by Ibnusyawall ]')
- console.log(' Black Coder Crush')
- glob('/sdcard/WhatsApp/Media/.Statuses/*.*', (err, files) => {
- const _cmp4 = [... files].toString().match(/(mp4)/gi).length
- const _cjpg = [... files].toString().match(/(jpg)/gi).length
- console.log('\n total: ', files.length, 'Files', `( mp4: ${_cmp4} | jpg: ${_cjpg} )`)
- const f = new Array({... files})
- console.log(_tableFile.toString())
- files.forEach((val, key) => {
- const stats = fs.statSync(val)
- const mstat = stats.ctime.toString()
- const mstm0 = mstat
- const mstm1 = mstat.split(' ')[1] + '/' + mstat.split(' ')[3] + ' ' + mstat.slice(15, 21)
- const no = key+1
- const nf = val.replace(__dir, '').cyan
- const nt = val.replace(__dir, '').slice(33).brightWhite
- const bb = no.toString().length == 1 ? `0${no}`.underline.brightWhite : `${no}`.underline.brightWhite
- console.log('%s', ` ${bb} ${mstm1} ${nf} ${nt}`)
- })
- ask.question('\n [?] Download [jpg/mp4] : ', (yn) => {
- if (yn != '') {
- switch (yn) {
- case 'jpg':
- glob(`${__dir}*.jpg`, (err, files) => {
- if (err) throw err
- shelljs.cp('-f', [... files], '/sdcard/unduh-sw')
- console.log(`\n [+] OK: ${_cjpg} File telah didownload.\n [+] To: /sdcard/unduh-sw\n`); process.exit()
- return
- })
- break;
- case 'mp4':
- glob(`${__dir}*.mp4`, (err, files) => {
- if (err) throw err
- shelljs.cp('-f', [... files], '/sdcard/unduh-sw')
- console.log(`\n [+] OK: ${_cmp4} File telah didownload.\n [+] To: /sdcard/unduh-sw\n`); process.exit()
- return
- })
- break;
- }
- } else {
- console.log('\n [!] Masukan pilihan! (exited)'); process.exit()
- }
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement