Instagram image and video downloader with URL validation and cURL integration
Instagram Photo and video download helper library.
New: Checkout TikTokOff - TikTok video online downloader (no watermarks)
Update on May 22, 2020: Due to Instagram no longer allowing anonymous users to view photos/videos, this library is currently not working. A new version 7 is in the works, but there is no ETA yet. Only IGTV videos are working now
Old and unsupported versions - Legacy 1.0 pre-composer - 2.x branch with for PHP ^7.1 - 3.x branch with for PHP ^7.2
Old and minimally supported versions - 4.x branch with for PHP ^7.3
I wrote this class mainly for my online Instagram photo, video and IGTV downloader, but I thought share this piece for your own extensions.
With composer Install the library by running the following in your project.
bash composer require ayesh/instagram-downloadWithout composer Download the zip file from Github, and configure your autoload handler to autoload PSR-4
Ayesh\InstagramDownloadnamespace from the downloaded contents
srcdirectory.
You could also manually require the file. Requires a certain amount of guilty feeling because it's 2017 and you are not using a decent autoload mechanism.
require_once 'src/InstagramDownload.php'
try { $client = new InstagramDownload($url); $url = $client->getDownloadUrl(); // Returns the download URL. $type = $client->getType(); // Returns "image" or "video" depending on the media type. } catch (\InvalidArgumentException $exception) { /*