Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
WGif is a command line tool for creating animated GIFs from YouTube videos.
##TL;DR
Usage: wgif [YouTube URL] [output file] [options]
-f, --frames N Number of frames in the final gif. (Default 20)
-s, --start HH:MM:SS Start creating gif from input video at this timestamp. (Default 00:00:00)
-d, --duration seconds Number of seconds of input video to capture. (Default 1)
-w, --width pixels Width of the gif in pixels. (Default 480px)
-u, --upload Upload finished gif to Imgur
-p, --preview Preview finished gif with Quick Look
-i, --info Displays info about finished gif (currently just file size)
-h, --help Print help information.
Example:
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif -s 00:03:30 -d 2 -w 400 -i --upload
Update 2014/04/23: One of WGif's dependencies requires ImageMagick to compile. Before installing, make sure you:
$ brew install imagemagick
using Homebrew, or install it with your favorite package manager.
Then, to install from Rubygems:
$ gem install wgif
To install from source, run
$ gem build wgif.gemspec
and
$ gem install wgif-0.3.0.gem
to install the executable.
WGif uses FFmpeg for video transcoding and ImageMagick to optimize GIFs. To install dependencies with Homebrew, just run
$ wgif install
WGif expects two arguments: a YouTube video URL and a name for the GIF it creates. So,
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif
Is enough to create a GIF of Bjork explaining her television. Without any extra parameters, WGif starts at the beginning of the video, and creates a 20-frame, 480px GIF of the first second. Since GIFs are more art than science, you'll probably want to tweak the size, duration, and number of frames.
Start by isolating the section of the video you'd like to GIF. Bjork starts her advice about dishonest
Icelandic poets around 3 minutes 30 seconds, and it lasts about two seconds. Pass the start timestamp with
-s
or --start
and the duration with -d
or --duration
:
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif --start 00:03:30 -d 2
A good start, but the GIF is way too big: around 5.6 megabytes. We can pass -f
or --frames
to specify the
total number of frames in the finished GIF. This defaults to 20, so let's drop a few to reduce the file size:
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif --start 00:03:30 -d 2 -f 18
To preview the output in a Quick Look window, add the --preview
flag:
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif --start 00:03:30 -d 2 -f 18 --preview
You'll see a preview pop up in a Quick Look window like this one:
Dropping frames shrunk the file to 2.2 megabytes, but it's still not small enough to post on my Sugarcubes fan-Tumblr.
Let's scale it down a little with the -w
or --width
flag:
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif --start 00:03:30 -d 2 -f 18 --width 350
And finally, now that everything's completed, let's add the --upload
flag to automatically post it to Imgur:
$ wgif https://www.youtube.com/watch?v=1A78yTvIY1k bjork.gif --start 00:03:30 -d 2 -f 18 --width 350 --upload
Finished. GIF uploaded to Imgur at http://i.imgur.com/iA28DuR.gif
And here it is:
--version
flag. Upgrade viddl-rb and rmagick./usr/bin/env ruby
in binary.--start
and --duration
flags (Issue #13).--info
flag. (Thanks, justalisteningman!)--preview
flag.--upload
flag.Thanks to arlandism and ellie007 for pairing on Imgur uploads. Thanks to justalisteningman for adding file size info. Thanks to aparrish for diagnosing an Ubuntu frame ordering bug.
Are welcome via pull request.
This project is MIT licensed. See LICENSE.txt for details.
FAQs
Unknown package
We found that wgif demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.