Skip to content

ariffb25/scraper

 
 

Repository files navigation

scraper

Install package

npm i @bochilteam/scraper

Example use

Instagram Downloader

// Instagram Downloader
const { 
    instagramdl, 
    instagramdlv2, 
    instagramStory,
    instagramStoryv2
} = require('@bochilteam/scraper')

const url = 'https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link'
instagramdl(url).then(console.log).catch(console.error)
instagramdlv2(url).then(console.log).catch(console.error)

// use both to handle error
instagramdl(url).catch(_ => instagramdlv2(url)).then(console.log)


// Use async/await 
console.log(await instagramdl(url).catch(console.error))
console.log(await instagramdlv2(url).catch(console.error))


// Instagram Story downloader
const username = 'freefirebgid'
const story = await instagramStory(username).catch(async _ => await instagramStoryv2(username))
console.log(story)

Youtube Downloader

// Youtube downloader
const { 
    youtubedl,
    youtubedlv2 
} = require('@bochilteam/scraper')

const url = 'https://youtu.be/iik25wqIuFo'
youtubedl(url).catch(_ => youtubedlv2(url)).then(({ video }) => {
    video['240p'].download().then(console.log).catch(console.error)
})

// Use async/await 
const yt = await youtubedl(url).catch(async () => await  youtubedlv2(url))
const dl_url = await yt.video['240p'].download()
console.log(dl_url)

Tiktok downloader

// Tiktok downloader
const { 
    tiktokdl,
    tiktokdlv2 
} = require('@bochilteam/scraper')
// Tiktok downloader v1
const url = 'https://www.tiktok.com/@tiktok/video/6844446901010982300'
tiktokdl(url).then(console.log).catch(console.error)
// tiktokdl v2
tiktokdlv2(url).then(console.log).catch(console.error)

// async / await 
console.log(await tiktokdl(url).catch(console.error))
console.log(await tiktokdlv2(url).catch(console.error))

Aksara Jawa

// Aksara jawa
const { 
    latinToAksara,
    aksaraToLatin
} = require('@bochilteam/scraper')

// Latin to aksara jawa
console.log(latinToAksara('hallo rek'))
// Aksara jawa to latin
console.log(aksaraToLatin('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀', { HVokal: false })) // Hvokal: false mean ꦲ will return 'ha' not vokal

Source: https://bennylin.github.io/transliterasijawa/

Primbons

// Primbons
const { 
    getZodiac,
    nomorhoki
} = require('@bochilteam/scraper')

// Get zodiac
console.log(getZodiac(1, 1))
// Get nomor hoki
console.log(await nomorhoki(6213353))

Images

// Images
const {
    googleImage,
    pinterest,
    wallpaper,
    stickerTelegram,
} = require('@bochilteam/scraper')

const keyword = 'minecraft'
// Google image
console.log(await googleImage(keyword))
// Pinterest image
console.log(await pinterest(keyword))
// Wallpaper
console.log(await wallpaper(keyword))
// Sticker telegram
console.log(await stickerTelegram(keyword))

Religions

// Religions
const {
    asmaulhusna, asmaulhusnajson,
    alquran,
    jadwalsholat, listJadwalSholat
} = require('@bochilteam/scraper')

// Asmaul Husna
console.log(await asmaulhusna())
// Asmaul Husna Json
console.log(asmaulhusnajson) // the json will empty if you never use `asmaulhusna()`

// alquran 
console.log(await alquran())
// Jadwal Sholat
console.log(await jadwalsholat('semarang'))

Games

// Games
const {
    tebakgambar, tebakgambarjson,
    asahotak, asahotakjson
} = require('@bochilteam/scraper')

// Tebak gambar
console.log(await tebakgambar())
// Tebak gambar json
console.log(tebakgambarjson) // the json will empty if you never use `tebakgambar()`

// Asahotak
console.log(await asahotak())
// Asahotak json
console.log(asahotakjson) // the json will empty if you never use `asahotak()`

News

// News
const {
    cnbindonesia,
    antaranews,
    kompas
} = require('@bochilteam/scraper')

// Cnbindonesia
console.log(await cnbindonesia())
// Antaranews
console.log(await antaranews())
// Kompas
console.log(await kompas())

Encryption

// Encryption
const {
    toBase64,
    fromBase64ToString,
    randomUUID,
    randomBytes,
    createHash
} = require('@bochilteam/scraper')

// To base64
const base64 = toBase64('Hello World!!')
console.log(base64)
// From base64 to string
console.log(fromBase64ToString(base64)) // 'Hello World!!'
// Random UUID
console.log(randomUUID())
// Random Bytes
console.log(randomBytes(16))
// Hash
console.log(createHash('sha256', 'Hello World!!'))

WARNING!

this package will deprecate to support CJS, and make this package only support ESM

About

scraper module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%