PHP code example of rastographer / igdownloader

1. Go to this page and download the library: Download rastographer/igdownloader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rastographer / igdownloader example snippets


['story', 'profile', 'canonical', 'embed', 'graphql']

use Rastographer\IgDownloader\Contracts\Downloader;

$parsed = app(Downloader::class)->parseUrl('https://www.instagram.com/reel/ABC123XYZ90/');

[
    'shortcode' => 'ABC123XYZ90',
    'kind' => 'reel',
]

use Rastographer\IgDownloader\Contracts\Downloader;
use Rastographer\IgDownloader\DTO\ExtractionContext;

$result = app(Downloader::class)->fetch(
    'ABC123XYZ90',
    new ExtractionContext(preferredKind: 'reel', requestId: 'req-123')
);

use Rastographer\IgDownloader\Services\FetchMediaAction;

$payload = app(FetchMediaAction::class)->handle(
    'https://www.instagram.com/stories/instagramuser/xxxxxxxxxxxxxxx/',
    'req-123'
);

Rastographer\IgDownloader\Contracts\ProxyResolver
bash
composer update rastographer/igdownloader
php artisan package:discover --ansi
bash
php artisan vendor:publish --tag=igdownloader-config
text
config/igdownloader.php
bash
composer update rastographer/igdownloader
php artisan package:discover --ansi
bash
php artisan vendor:publish --tag=igdownloader-config --force