Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login true issue #3

Closed
tek-kryzetech opened this issue Apr 4, 2024 · 7 comments
Closed

login true issue #3

tek-kryzetech opened this issue Apr 4, 2024 · 7 comments

Comments

@tek-kryzetech
Copy link

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
Copy link
Owner

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
Copy link
Author

tek-kryzetech commented Apr 4, 2024

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
Copy link
Author

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

@TufayelLUS
Copy link
Owner

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

@tek-kryzetech
Copy link
Author

sir how i can resolve this rate limit issue

@tek-kryzetech
Copy link
Author

tek-kryzetech commented Apr 4, 2024

$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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants