TufayelLUS / Instagram-Reels-Downloader-Scripts

Instagram Reels Downloader Scripts that allows you to download Instagram reels on to your computer/phone easily
GNU General Public License v3.0
5 stars 1 forks source link

login true issue #3

Closed tek-kryzetech closed 1 month ago

tek-kryzetech commented 7 months ago

array:3 [ // app\Http\Controllers\API\ReelsVideoController.php:86 "message" => "Please wait a few minutes before you try again." "require_login" => true "status" => "fail" ]

this code give me this issue how i can resolve it sir

TufayelLUS commented 7 months ago

As per my understanding, it seems like the page that you're trying to access is a login-protected page. Due to that, it's asking for you to start a logged-in session first.

tek-kryzetech commented 7 months ago

As per my understanding, it seems like the page that you're trying to access is a login-protected page. Due to that, it's asking for you to start a logged-in session first.

I am using your code to download instagram reel sir sometime its working download reel but suddenly from yesterday its showing this error

tek-kryzetech commented 7 months ago

sir first time video will download but if i send request again then its give me this error

TufayelLUS commented 7 months ago

Probably they have rate limit applied to prevent too many requests from taking place within a short timeframe.

tek-kryzetech commented 7 months ago

sir how i can resolve this rate limit issue

tek-kryzetech commented 7 months ago

$link = "https://www.instagram.com/graphql/query/"; $headers = array( 'User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36' ); $variables = '{"child_comment_count":3,"fetch_comment_count":40,"has_threaded_comments":true,"parent_comment_count":24,"shortcode":"' . $reel_id . '"}'; $params = array( 'hl' => 'en', 'query_hash' => 'b3055c01b4b222b8a47dc12b090e4e64', 'variables' => $variables ); $url = $link . '?' . http_build_query($params); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

try {
    $resp = curl_exec($ch);
    $data = json_decode($resp, true);
    $video_link = $data['data']['shortcode_media']['video_url'];
    $image_preview = $data['data']['shortcode_media']['display_url'];
    return array($video_link, $image_preview);
} catch (Exception $e) {
    return array("", "");
} finally {
    curl_close($ch);
}

when i hit generated url in browser then it return me json data but when i hit using curl its show me error

TufayelLUS commented 7 months ago

Maybe you can try adding more header data to the header array to convince the API that the request is coming from a legitimate source and not from an automated web app. Another option you may try is adding proxies to the request to mimic different locations for every call to their API endpoint.