redditube
v1.1.5
Reddit帖子和评论中的视频生成器。
观看此视频用Redditube制作。
npm install redditube
有安装错误?安装以下软件包,然后重试。
sudo apt install build-essential libpixman-1-dev libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
您需要在计算机上安装FFMPEG。
您还需要Reddit凭据。
稍后,我们将需要客户ID(在应用程序名称下的随机字符串)和客户端秘密。
const Redditube = require ( "redditube" ) ;
// Configure access to Reddit
Redditube . config ( {
"userAgent" : "Redditube" ,
"clientId" : "" , // Your Client ID
"clientSecret" : "" , // Your Client secret
"username" : "" , // Your Reddit username
"password" : "" // Your Reddit password
} ) ;
// Log start, status, errors and end events (optional)
Redditube . on ( "start" , ( ) => console . log ( "Start event!" ) ) ;
Redditube . on ( "status" , status => console . log ( status ) ) ;
Redditube . on ( "error" , error => console . error ( error ) ) ;
Redditube . on ( "end" , ( ) => console . log ( "End event!" ) ) ;
// Option 1
// Use .then() and .catch()
Redditube . make ( "f9cufu" , 3 ) . then ( videoPath => {
console . log ( videoPath ) ;
} ) . catch ( error => {
console . log ( error ) ;
} ) ;
// Option 2
// Await a promise (inside an asynchronous function)
const videoPath = await Redditube . make ( "f9cufu" , 3 ) ;上面的示例从这篇文章中制作了一个视频(请参见URL中的F9CUFU )和3个评论。
可以随意饰演存储库,创建问题并在Github上提出拉动请求。
根据MIT许可发布。