2.1.0 • Published 3 years ago

reddit-grabber v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

reddit-grabber, a simple tool to get images and videos from Reddit

Libraries.io dependency status for latest release, scoped npm package GitHub issues GitHub package.json version GitHub code size in bytes

import { get } from 'reddit-grabber'

async function (
	type: 'Image' | 'Video',
	subreddit: string,
	isOver18?: boolean
) {
	return await get(type, subreddit, isOver18).catch((e) => {
		console.error(
			`An error has occured, it's probably because the grabber can't find anything. ${e.message}`
		)
	})
}
// the catch here, is because the grabber will error if it can't find a post
import { validMedia } from 'reddit-grabber'
validMedia.ImageExtensions.push('png')
validMedia.VideoExtensions.push('mp4')
validMedia.VideoUrls.push('youtu.be')

Don't add any dots to extensions, and don't add http/https to urls.

Got any issues? Be sure to report them on GitHub/Issues!

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago