@fatsoap/telegraph-downloader

1.1.0 • Public • Published

Teleghaph Image Downloader

Telegraph

Version

version Description
v1.1.0 add callback & seperate request function
v1.0.0 first version

Introduce Project

This is a web spider which can download images in telegraph. Simply input url of telegraph, then it will download all images in that web page. Have fun 🚀

How 2 use

  1. Install modules
yarn add @fatsoap/telegraph-downloader
// or
npm install @fatsoap/telegraph-downloader
  1. Require function
const { downloadAlbum, downloadImage } from require('@fatsoap/telegraph-downloader');
  1. Run function

Get All Pictures' URL

downloadAlbum(yourURL, dest_folder, (title, pictures) => {
	// do something with 'title' & 'pictures'
});

type Title: string  //album name
type Pictures: {
	src: string // picture url
	path: string  // save folder
	title: string //album name
}[]

Download All Images

const len = pictures.length;
pictures.map((img, index) => {
	downloadImage(img.src, img.path, () => {
		console.log(`${img.title} --- download ${index+1}/${len} done.`);
	});
});
  1. Done ! 😎 You can find images in dest folder 💪

Readme

Keywords

none

Package Sidebar

Install

npm i @fatsoap/telegraph-downloader

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

36.4 kB

Total Files

5

Last publish

Collaborators

  • fatsoap