Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.8.2
- * @ Author : DeZender
- * @ Release on : 02.01.2019
- * @ Official site : http://DeZender.Net
- *
- */
- class AntiFlood
- {
- const OPTION_COUNTER_RESET_SECONDS = 'COUNTER_RESET_SECONDS';
- const OPTION_BAN_REMOVE_SECONDS = 'BAN_REMOVE_SECONDS';
- const OPTION_MAX_REQUESTS = 'MAX_REQUESTS';
- const OPTION_DATA_PATH = 'DATA_PATH';
- private $options;
- private $ip;
- public function __construct($overrideOptions = [])
- {
- $this->options = array_merge(['COUNTER_RESET_SECONDS' => 2, 'MAX_REQUESTS' => 5, 'BAN_REMOVE_SECONDS' => 60, 'DATA_PATH' => '/tmp/antiflood_' . str_replace(['www.', '.'], ['', '_'], $_SERVER['SERVER_NAME'])], $overrideOptions);
- @mkdir($this->options['DATA_PATH']);
- $this->ip = $_SERVER['REMOTE_ADDR'];
- }
- public function isBanned()
- {
- $controlLockFile = $this->options['DATA_PATH'] . '/' . str_replace('.', '_', $this->ip);
- if (file_exists($controlLockFile)) {
- if ($this->options['BAN_REMOVE_SECONDS'] < (time() - filemtime($controlLockFile))) {
- unlink($controlLockFile);
- }
- else {
- touch($controlLockFile);
- return true;
- }
- }
- $controlFile = $this->options['DATA_PATH'] . '/ctrl';
- $control = [];
- if (file_exists($controlFile)) {
- $fh = fopen($controlFile, 'r');
- $fileContentsArr = (0 < filesize($controlFile) ? json_decode(fread($fh, filesize($controlFile)), true) : []);
- $control = array_merge($control, $fileContentsArr);
- fclose($fh);
- }
- if (isset($control[$this->ip])) {
- if ((time() - $control[$this->ip]['t']) < $this->options['COUNTER_RESET_SECONDS']) {
- $control[$this->ip]['c']++;
- }
- else {
- $control[$this->ip]['c'] = 1;
- }
- }
- else {
- $control[$this->ip]['c'] = 1;
- }
- $control[$this->ip]['t'] = time();
- if ($this->options['MAX_REQUESTS'] < $control[$this->ip]['c']) {
- $fh = fopen($controlLockFile, 'w');
- fwrite($fh, '');
- fclose($fh);
- }
- $fh = fopen($controlFile, 'w');
- fwrite($fh, json_encode($control));
- fclose($fh);
- return false;
- }
- }
- class Signatures
- {
- static public function generateSignature($data)
- {
- return hash_hmac('sha256', $data, Constants::IG_SIG_KEY);
- }
- static public function signData($data, $exclude = [])
- {
- $result = [];
- foreach ($exclude as $key) {
- if (isset($data[$key])) {
- $result[$key] = $data[$key];
- unset($data[$key]);
- }
- }
- foreach ($data as &$value) {
- if (is_scalar($value)) {
- $value = (string) $value;
- }
- }
- unset($value);
- $data = json_encode((object) Utils::reorderByHashCode($data));
- $result['ig_sig_key_version'] = Constants::SIG_KEY_VERSION;
- $result['signed_body'] = '1.' . $data;
- return Utils::reorderByHashCode($result);
- }
- static public function generateDeviceId()
- {
- $megaRandomHash = md5(number_format(microtime(true), 7, '', ''));
- return 'android-' . substr($megaRandomHash, 16);
- }
- static public function generateUUID($keepDashes = true)
- {
- $uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 4095) | 16384, mt_rand(0, 16383) | 32768, mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
- return $keepDashes ? $uuid : str_replace('-', '', $uuid);
- }
- }
- class Utils
- {
- const BOUNDARY_CHARS = '-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- const BOUNDARY_LENGTH = 30;
- /**
- * Last uploadId generated with microtime().
- *
- * @var string|null
- */
- static protected $_lastUploadId;
- static public function generateMultipartBoundary()
- {
- $result = '';
- $max = strlen('-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') - 1;
- for ($i = 0; $i < 30; ++$i) {
- $result .= '-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'[mt_rand(0, $max)];
- }
- return $result;
- }
- static public function hashCode($string)
- {
- $result = 0;
- $len = strlen($string);
- for ($i = 0; $i < $len; ++$i) {
- $result = ((-1 * $result) + ($result << 5) + ord($string[$i])) & 4294967295.0;
- }
- if (4 < PHP_INT_SIZE) {
- if (2147483647 < $result) {
- $result -= 4294967296.0;
- }
- else if ($result < -2147483648.0) {
- $result += 4294967296.0;
- }
- }
- return $result;
- }
- static public function reorderByHashCode($data)
- {
- $hashCodes = [];
- foreach ($data as $key => $value) {
- $hashCodes[$key] = self::hashCode($key);
- }
- uksort($data, function($a, $b) use($hashCodes) {
- $a = $hashCodes[$a];
- $b = $hashCodes[$b];
- if ($a < $b) {
- return -1;
- }
- else if ($b < $a) {
- return 1;
- }
- else {
- return 0;
- }
- });
- return $data;
- }
- static public function generateUploadId($useNano = false)
- {
- $result = NULL;
- if (!$useNano) {
- while (true) {
- $result = number_format(round(microtime(true) * 1000), 0, '', '');
- if ((self::$_lastUploadId !== NULL) && ($result === self::$_lastUploadId)) {
- usleep(1000);
- continue;
- }
- self::$_lastUploadId = $result;
- break;
- }
- }
- else {
- $result = number_format(microtime(true) - strtotime('Last Monday'), 6, '', '');
- $result .= str_pad((string) mt_rand(1, 999), 3, '0', STR_PAD_LEFT);
- }
- return $result;
- }
- static public function generateUserBreadcrumb($size)
- {
- $key = 'iN4$aGr0m';
- $date = (int) microtime(true) * 1000;
- $term = (rand(2, 3) * 1000) + ($size * rand(15, 20) * 100);
- $text_change_event_count = round($size / rand(2, 3));
- if ($text_change_event_count == 0) {
- $text_change_event_count = 1;
- }
- $data = $size . ' ' . $term . ' ' . $text_change_event_count . ' ' . $date;
- return base64_encode(hash_hmac('sha256', $data, $key, true)) . "\n" . base64_encode($data) . "\n";
- }
- static public function cookieToArray($string, $domain)
- {
- $arrCookies = [];
- $fileVals = self::extractCookies($string);
- foreach ($fileVals as $cookie) {
- if ($cookie['domain'] == $domain) {
- $arrCookies[$cookie['name']] = $cookie['value'];
- }
- }
- return $arrCookies;
- }
- static public function generateAsns($asnsNumber)
- {
- $asnsNumber = intval($asnsNumber);
- if (($asnsNumber == 0) || (intval(Wow::get('ayar/proxyStatus')) == 0)) {
- return [NULL, NULL];
- }
- if (Wow::get('ayar/proxyStatus') == 3) {
- $byPassServerCode = trim(Wow::get('ayar/proxyList'));
- $byPassServerUA = (strpos($byPassServerCode, '@') !== false ? explode('@', $byPassServerCode)[0] : NULL);
- $byPassServerRange = (strpos($byPassServerCode, '@') !== false ? explode(':', explode('@', $byPassServerCode)[1]) : explode(':', $byPassServerCode));
- return [$byPassServerRange[0] . ':' . (intval($byPassServerRange[1]) + $asnsNumber), $byPassServerUA];
- }
- $asnsNumber--;
- $proxyList = explode("\r\n", Wow::get('ayar/proxyList'));
- $proxyString = (isset($proxyList[$asnsNumber]) ? $proxyList[$asnsNumber] : NULL);
- if (empty($proxyString)) {
- return [NULL, NULL];
- }
- if (Wow::get('ayar/proxyStatus') == 4) {
- $ipType = (strpos($proxyString, ':') !== false ? CURL_IPRESOLVE_V6 : NULL);
- return [$proxyString, $ipType];
- }
- $proxyUserPwd = (strpos($proxyString, '@') !== false ? explode('@', $proxyString)[0] : NULL);
- $proxyHostPort = (strpos($proxyString, '@') !== false ? explode('@', $proxyString)[1] : $proxyString);
- return [$proxyHostPort, $proxyUserPwd];
- }
- static public function extractCookies($string)
- {
- $lines = explode(PHP_EOL, $string);
- $cookies = [];
- foreach ($lines as $line) {
- $cookie = [];
- if (substr($line, 0, 10) == '#HttpOnly_') {
- $line = substr($line, 10);
- $cookie['httponly'] = true;
- }
- else {
- $cookie['httponly'] = false;
- }
- if ((substr($line, 0, 1) != '#') && (substr_count($line, '\\' . "\t") == 6)) {
- $tokens = explode('\\' . "\t", $line);
- $tokens = array_map('trim', $tokens);
- $cookie['domain'] = $tokens[0];
- $cookie['flag'] = $tokens[1];
- $cookie['path'] = $tokens[2];
- $cookie['secure'] = $tokens[3];
- $cookie['expiration-epoch'] = $tokens[4];
- $cookie['name'] = urldecode($tokens[5]);
- $cookie['value'] = urldecode($tokens[6]);
- $cookie['expiration'] = date('Y-m-d h:i:s', $tokens[4]);
- $cookies[] = $cookie;
- }
- }
- return $cookies;
- }
- static public function cookieConverter($cookie, $cnf, $c)
- {
- $confData = [];
- if (!empty($cnf)) {
- $separator = "\r\n";
- $line = strtok($cnf, $separator);
- while ($line !== false) {
- if ($line[0] == '#') {
- continue;
- }
- $kv = explode('=', $line, 2);
- $confData[$kv[0]] = trim($kv[1], "\r\n" . ' ');
- $line = strtok($separator);
- }
- }
- if (!isset($confData['username_id'])) {
- $confData['username_id'] = $c['username_id'];
- }
- if (isset($confData['user_agent'])) {
- unset($confData['user_agent']);
- }
- if (isset($confData['manufacturer'])) {
- unset($confData['manufacturer']);
- }
- if (isset($confData['device'])) {
- unset($confData['device']);
- }
- if (isset($confData['model'])) {
- unset($confData['model']);
- }
- $cookieData = self::cookieToArray($cookie, $c['isWebCookie'] == 1 ? 'www.instagram.com' : 'i.instagram.com');
- $cookie_all = [];
- foreach ($cookieData as $k => $v) {
- $cookie_all[] = $k . '=' . urlencode($v);
- if ($k == 'csrftoken') {
- $confData['token'] = $v;
- }
- }
- $v3Data = $confData;
- $v3CookieName = ($c['isWebCookie'] == 1 ? 'web_cookie' : 'cookie');
- $v3Data[$v3CookieName] = implode(';', $cookie_all);
- return json_encode($v3Data);
- }
- }
- class Settings
- {
- private $path;
- private $sets;
- public function __construct($path)
- {
- $this->path = $path;
- $this->sets = [];
- if (file_exists($path)) {
- $sets = json_decode(file_get_contents($path), true);
- $this->sets = (is_array($sets) ? $sets : []);
- }
- }
- public function get($key, $default = NULL)
- {
- if ($key == 'sets') {
- return $this->sets;
- }
- if (isset($this->sets[$key])) {
- return $this->sets[$key];
- }
- return $default;
- }
- public function set($key, $value)
- {
- if ($key == 'sets') {
- return NULL;
- }
- $this->sets[$key] = $value;
- }
- public function save()
- {
- file_put_contents($this->path, json_encode($this->sets));
- }
- public function setPath($path)
- {
- $this->path = $path;
- }
- public function __set($prop, $value)
- {
- $this->set($prop, $value);
- }
- public function __get($prop)
- {
- return $this->get($prop);
- }
- }
- class Constants
- {
- const API_URL = 'https://i.instagram.com/api/v1/';
- const API_URLb = 'https://b.i.instagram.com/api/v1/';
- const API_URLV2 = 'https://i.instagram.com/api/v2/';
- const IG_VERSION = '42.0.0.19.95';
- const VERSION_CODE = '104766893';
- const IG_SIG_KEY = 'f372b2a5f14d1bebedaaa4ac6f8d506db30ffdd6185b8e0cdfa7dab42f5a9cc6';
- const EXPERIMENTS = 'ig_android_universe_video_production,ig_search_client_h1_2017_holdout,ig_android_carousel_non_square_creation,ig_android_live_analytics,ig_android_realtime_mqtt_logging,ig_branded_content_show_settings_universe,ig_android_stories_server_coverframe,ig_android_live_dash_predictive_streaming,ig_android_video_captions_universe,ig_business_growth_acquisition_holdout_17h2,ig_android_ontact_invite_universe,ig_android_ad_async_ads_universe,ig_android_shopping_tag_creation_carousel_universe,ig_feed_engagement_holdout_universe,ig_direct_pending_inbox_memcache,ig_promote_guided_budget_duration_options_universe,ig_android_verified_comments_universe,ig_feed_lockdown,android_instagram_prefetch_suggestions_universe,ig_android_gallery_order_by_date_taken,ig_shopping_viewer_intent_actions,ig_android_startup_prefetch,ig_android_business_post_insights_v3_universe,ig_android_custom_story_import_intent,ig_video_copyright_whitelist,ig_explore_holdout_universe,ig_android_device_language_reset,ig_android_videocall_consumption_universe,ig_android_live_fault_tolerance_universe,ig_android_main_feed_seen_state_dont_send_info_on_tail_load,ig_android_face_filter_glyph_nux_animation_universe,ig_android_direct_allow_consecutive_likes,ig_android_livewith_guest_adaptive_camera_universe,ig_android_business_new_ads_payment_universe,ig_android_audience_control,ig_promotion_insights_sticky_tab_universe,ig_android_unified_bindergroup_in_staticandpagedadapter,ig_android_ad_new_viewability_logging_universe,ig_android_ad_impression_backtest,ig_android_log_account_switch_usable,ig_android_mas_viewer_list_megaphone_universe,ig_android_photo_fbupload_universe,ig_android_carousel_drafts,ig_android_bug_report_version_warning,ig_fbns_push,ig_android_carousel_no_buffer_10_30,ig_android_sso_family_key,ig_android_profile_tabs_redesign_universe,ig_android_user_url_deeplink_fbpage_endpoint,ig_android_fix_slow_rendering,ig_android_hide_post_in_feed,ig_android_shopping_thumbnail_icon,ig_android_ad_watchbrowse_universe,ig_android_search_people_tag_universe,ig_android_codec_high_profile,ig_android_long_impression_tracking,ig_android_inline_appeal,ig_android_log_mediacodec_info,ig_android_direct_expiring_media_loading_errors,ig_android_camera_face_filter_api_retry,ig_video_use_sve_universe,ig_android_low_data_mode,ig_android_enable_zero_rating,ig_android_sample_ppr,ig_android_force_logout_user_with_mismatched_cookie,ig_android_smartisan_app_badging,ig_android_direct_expiring_media_fix_duplicate_thread,ig_android_reverse_audio,ig_android_branded_content_three_line_ui_universe,ig_android_comments_impression_logger,ig_android_live_encore_production_universe,ig_promote_independent_ctas_universe,ig_android_http_stack_experiment_2017,ig_android_pending_request_search_bar,ig_android_main_feed_carousel_bumping_animation,ig_android_live_thread_delay_for_mute_universe,ig_android_fb_topsearch_sgp_fork_request,ig_android_heap_uploads,ig_android_stories_archive_universe,ig_android_business_ix_fb_autofill_universe,ig_lockdown_feed_shrink_universe,ig_android_stories_create_flow_favorites_tooltip,ig_android_direct_ephemeral_replies_with_context,ig_android_live_viewer_invite_universe,ig_android_promotion_feedback_channel,ig_profile_holdout_2017_universe,ig_android_executor_null_queue,ig_android_stories_video_loading_spinner_improvements,ig_android_direct_share_intent,ig_android_live_capture_translucent_navigation_bar,ig_stories_camera_blur_drawable,ig_android_stories_drawing_sticker,ig_android_facebook_twitter_profile_photos,ig_android_shopping_tag_creation_universe,ig_android_story_decor_image_fbupload_universe,ig_android_comments_ranking_kill_switch_universe,ig_promote_profile_visit_cta_universe,ig_android_story_reactions,ig_android_ppr_main_feed_enhancements,ig_android_used_jpeg_library,ig_carousel_draft_multiselect,ig_android_stories_close_to_left_head,ig_android_video_delay_auto_start,ig_android_live_with_invite_sheet_search_universe,ig_android_stories_archive_calendar,ig_android_ad_watchbrowse_cta_universe,ig_android_ads_manager_pause_resume_ads_universe,ig_android_main_feed_carousel_bumping,ig_stories_in_feed_unit_design_universe,ig_android_explore_iteminfo_universe_exp,ig_android_me_only_universe,ig_android_live_video_reactions_consumption_universe,ig_android_stories_hashtag_text,ig_android_live_reply_to_comments_universe,ig_android_live_save_to_camera_roll_universe,ig_android_sticker_region_tracking,ig_android_unified_inbox,ig_android_realtime_iris,ig_android_search_client_matching_2,ig_lockdown_notifications_universe,ig_android_feed_seen_state_with_view_info,ig_android_media_rows_prepare_10_31,ig_family_bridges_holdout_universe,ig_android_background_explore_fetch,ig_android_following_follower_social_context,ig_android_live_auto_collapse_comments_view_universe,ig_android_insta_video_consumption_infra,ig_android_ad_watchlead_universe,ig_android_direct_prefetch_direct_story_json,ig_android_cache_logger_10_34,ig_android_stories_weblink_creation,ig_android_histogram_reporter,ig_android_network_cancellation,ig_android_shopping_show_shop_tooltip,ig_android_video_delay_auto_start_threshold,ig_android_comment_category_filter_setting_universe,ig_promote_daily_budget_universe,ig_android_stories_camera_enhancements,ig_android_video_use_new_logging_arch,ig_android_ad_add_per_event_counter_to_logging_event,ig_android_feed_stale_check_interval,ig_android_crop_from_inline_gallery_universe,ig_android_direct_reel_options_entry_point,ig_android_stories_gallery_improvements,ig_android_live_broadcaster_invite_universe,ig_android_inline_photos_of_you_universe,ig_android_prefetch_notification_data,ig_android_direct_full_size_gallery_upload_universe_v2,ig_android_direct_app_deeplinking,ig_promotions_unit_in_insights_landing_page,ig_android_reactive_feed_like_count,ig_android_camera_ff_story_open_tray,ig_android_stories_asset_search,ig_android_constrain_image_size_universe,ig_rn_top_posts_stories_nux_universe,ig_ranking_following,ig_android_camera_retain_face_filter,ig_android_direct_inbox_presence,ig_android_live_skin_smooth,ig_android_stories_posting_offline_ui,ig_android_sidecar_video_upload_universe,ig_android_canvas_swipe_to_open_universe,ig_android_qp_features,android_ig_stories_without_storage_permission_universe2,ig_android_reel_raven_video_segmented_upload_universe,ig_android_swipe_navigation_x_angle_universe,ig_android_invite_xout_universe,ig_android_offline_mode_holdout,ig_android_live_send_user_location,ig_android_live_encore_go_live_button_universe,ig_android_analytics_logger_running_background_universe,ig_android_save_all,ig_android_live_report_watch_time_when_update,ig_android_family_bridge_discover,ig_android_startup_manager,instagram_search_and_coefficient_holdout,ig_android_high_res_upload_2,ig_android_dynamic_background_prefetch,ig_android_http_service_same_thread,ig_android_scroll_to_dismiss_keyboard,ig_android_remove_followers_universe,ig_android_skip_video_render,ig_android_crash_native_core_dumping,ig_android_one_tap_nux_upsell,ig_android_segmentation,ig_profile_holdout_universe,ig_dextricks_module_loading_experiment,ig_android_comments_composer_avatar_universe,ig_android_direct_open_thread_with_expiring_media,ig_android_post_capture_filter,ig_android_rendering_controls,ig_android_os_version_blocking,ig_android_no_prefetch_video_bandwidth_threshold,ig_android_encoder_width_safe_multiple_16,ig_android_warm_like_text,ig_android_request_feed_on_back,ig_comments_team_holdout_universe,ig_android_e2e_optimization_universe,ig_shopping_insights,ig_android_direct_async_message_row_building_universe,ig_android_fb_connect_follow_invite_flow,ig_android_direct_24h_replays,ig_android_video_stitch_after_segmenting_universe,ig_android_instavideo_periodic_notif,ig_android_enable_swipe_to_dismiss_for_all_dialogs,ig_android_stories_camera_support_image_keyboard,ig_android_warm_start_fetch_universe,ig_android_marauder_update_frequency,ig_camera_android_aml_face_tracker_model_version_universe,ig_android_ad_connection_manager_universe,ig_android_ad_watchbrowse_carousel_universe,ig_android_branded_content_edit_flow_universe,ig_android_video_feed_universe,ig_android_upload_reliability_universe,ig_android_direct_mutation_manager_universe,ig_android_ad_show_new_bakeoff,ig_heart_with_keyboad_exposed_universe,ig_android_react_native_universe_kill_switch,ig_android_comments_composer_callout_universe,ig_android_search_hash_tag_and_username_universe,ig_android_live_disable_speed_test_ui_timeout_universe,ig_android_miui_notification_badging,ig_android_qp_kill_switch,ig_android_ad_switch_fragment_logging_v2_universe,ig_android_ad_leadgen_single_screen_universe,ig_android_share_to_whatsapp,ig_android_live_snapshot_universe,ig_branded_content_share_to_facebook,ig_android_react_native_email_sms_settings_universe,ig_android_live_join_comment_ui_change,ig_android_camera_tap_smile_icon_to_selfie_universe,ig_android_feed_surface_universe,ig_android_biz_choose_category,ig_android_prominent_live_button_in_camera_universe,ig_android_video_cover_frame_from_original_as_fallback,ig_android_camera_leak_detector_universe,ig_android_live_hide_countdown_universe,ig_android_story_viewer_linear_preloading_count,ig_android_threaded_comments_universe,ig_android_stories_search_reel_mentions_universe,ig_promote_reach_destinations_universe,ig_android_progressive_jpeg_partial_download,ig_fbns_shared,ig_android_capture_slowmo_mode,ig_android_live_ff_fill_gap,ig_promote_clicks_estimate_universe,ig_android_video_single_surface,ig_android_video_download_logging,ig_android_foreground_location_collection,ig_android_last_edits,ig_android_pending_actions_serialization,ig_android_post_live_viewer_count_privacy_universe,ig_stories_engagement_2017_h2_holdout_universe,ig_android_image_cache_tweak_for_n,ig_android_direct_increased_notification_priority,ig_android_search_top_search_surface_universe,ig_android_live_dash_latency_manager,instagram_interests_holdout,ig_android_user_detail_endpoint,ig_android_videocall_production_universe,ig_android_ad_watchmore_entry_point_universe,ig_android_video_detail,ig_save_insights,ig_camera_android_new_face_effects_api_universe,ig_comments_typing_universe,ig_android_exoplayer_settings,ig_android_progressive_jpeg,ig_android_offline_story_stickers,ig_android_live_webrtc_audience_expansion_universe,ig_explore_android_universe,ig_android_video_prefetch_for_connectivity_type,ig_android_ad_holdout_watchandmore_universe,ig_promote_default_cta,ig_direct_stories_recipient_picker_button,ig_android_direct_notification_lights,ig_android_insights_relay_modern,ig_android_insta_video_abr_resize,ig_android_insta_video_sound_always_on,ig_android_fb_content_provider_anr_fix,ig_android_in_app_notifications_queue,ig_android_live_follow_from_comments_universe,ig_android_comments_new_like_button_position_universe,ig_android_hyperzoom,ig_android_live_broadcast_blacklist,ig_android_camera_perceived_perf_universe,ig_android_search_clear_layout_universe,ig_promote_reachbar_universe,ig_android_ad_one_pixel_logging_for_reel_universe,ig_android_stories_surface_universe,ig_android_stories_highlights_universe,ig_android_reel_viewer_fetch_missing_reels_universe,ig_android_arengine_separate_prepare,ig_android_direct_video_segmented_upload_universe,ig_android_direct_search_share_sheet_universe,ig_android_business_promote_tooltip,ig_android_direct_blue_tab,ig_android_instavideo_remove_nux_comments,ig_android_draw_rainbow_client_universe,ig_android_use_simple_video_player,ig_android_rtc_reshare,ig_android_enable_swipe_to_dismiss_for_favorites_dialogs,ig_android_auto_retry_post_mode,ig_fbns_preload_default,ig_android_emoji_sprite_sheet,ig_android_cover_frame_blacklist,ig_android_gesture_dismiss_reel_viewer,ig_android_gallery_grid_column_count_universe,ig_android_ad_logger_funnel_logging_universe,ig_android_live_encore_consumption_settings_universe,ig_perf_android_holdout,ig_android_list_redesign,ig_android_stories_separate_overlay_creation,ig_android_ad_show_new_interest_survey,ig_android_live_encore_reel_chaining_universe,ig_android_vod_abr_universe,ig_android_audience_profile_icon_badge,ig_android_immersive_viewer,ig_android_analytics_use_a2,ig_android_react_native_universe,ig_android_direct_thread_name_as_notification,ig_android_su_rows_preparer,ig_android_leak_detector_universe,ig_android_video_loopcount_int,ig_android_qp_sticky_exposure_universe,ig_android_enable_main_feed_reel_tray_preloading,ig_android_camera_upsell_dialog,ig_android_live_time_adjustment_universe,ig_android_internal_research_settings,ig_android_prod_lockout_universe,ig_android_react_native_ota,ig_android_main_camera_share_to_direct,ig_android_cold_start_feed_request,ig_android_fb_family_navigation_badging_user,ig_stories_music_sticker,ig_android_send_impression_via_real_time,ig_android_sc_ru_ig,ig_android_animation_perf_reporter_timeout,ig_android_warm_headline_text,ig_android_post_live_expanded_comments_view_universe,ig_android_new_block_flow,ig_android_long_form_video,ig_android_sign_video_url,ig_android_image_task_cancel_logic_fix,ig_android_stories_video_prefetch_kb,ig_android_video_render_prevent_cancellation_feed_universe,ig_android_live_stop_broadcast_on_404,android_face_filter_universe,ig_android_render_iframe_interval,ig_business_claim_page_universe,ig_android_live_move_video_with_keyboard_universe,ig_stories_vertical_list,ig_android_stories_server_brushes,ig_android_live_viewers_canned_comments_universe,ig_android_collections_cache,ig_android_payment_settings_universe,ig_android_live_face_filter,ig_android_canvas_preview_universe,ig_android_screen_recording_bugreport_universe,ig_story_camera_reverse_video_experiment,ig_downloadable_modules_experiment,ig_direct_core_holdout_q4_2017,ig_promote_updated_copy_universe,ig_android_search,ig_android_logging_metric_universe,ig_promote_budget_duration_slider_universe,ig_android_insta_video_consumption_titles,ig_android_video_proxy,ig_android_find_loaded_classes,ig_android_direct_expiring_media_replayable,ig_android_reduce_rect_allocation,ig_android_camera_universe,ig_android_post_live_badge_universe,ig_stories_holdout_h2_2017,ig_android_video_server_coverframe,ig_promote_relay_modern,ig_android_search_users_universe,ig_android_video_controls_universe,ig_creation_growth_holdout,android_segmentation_filter_universe,ig_qp_tooltip,ig_android_live_encore_consumption_universe,ig_android_experimental_filters,ig_android_shopping_profile_shoppable_feed,ig_android_save_collection_pivots,ig_android_business_conversion_value_prop_v2,ig_android_ad_browser_warm_up_improvement_universe,ig_promote_guided_ad_preview_newscreen,ig_android_livewith_universe,ig_android_whatsapp_invite_option,ig_android_video_keep_screen_on,ig_promote_automatic_audience_universe,ig_android_direct_remove_animations,ig_android_live_align_by_2_universe,ig_android_friend_code,ig_android_top_live_profile_pics_universe,ig_android_async_network_tweak_universe_15,ig_android_direct_init_post_launch,ig_android_camera_new_early_show_smile_icon_universe,ig_android_live_go_live_at_viewer_end_screen_universe,ig_android_live_bg_download_face_filter_assets_universe,ig_android_background_reel_fetch,ig_android_insta_video_audio_encoder,ig_android_video_segmented_media_needs_reupload_universe,ig_promote_budget_duration_split_universe,ig_android_upload_prevent_upscale,ig_android_business_ix_universe,ig_android_ad_browser_new_tti_universe,ig_android_self_story_layout,ig_android_business_choose_page_ui_universe,ig_android_camera_face_filter_animation_on_capture,ig_android_rtl,ig_android_comment_inline_expansion_universe,ig_android_live_request_to_join_production_universe,ig_android_share_spinner,ig_android_video_resize_operation,ig_android_stories_eyedropper_color_picker,ig_android_disable_explore_prefetch,ig_android_universe_reel_video_production,ig_android_react_native_push_settings_refactor_universe,ig_android_power_metrics,ig_android_sfplt,ig_android_story_resharing_universe,ig_android_direct_inbox_search,ig_android_direct_share_story_to_facebook,ig_android_exoplayer_creation_flow,ig_android_non_square_first,ig_android_insta_video_drawing,ig_android_swipeablefilters_universe,ig_android_direct_visual_replies_fifty_fifty,ig_android_reel_viewer_data_buffer_size,ig_android_video_segmented_upload_multi_thread_universe,ig_android_react_native_restart_after_error_universe,ig_android_direct_notification_actions,ig_android_profile,ig_android_additional_contact_in_nux,ig_stories_selfie_sticker,ig_android_live_use_rtc_upload_universe,ig_android_story_reactions_producer_holdout,ig_android_stories_reply_composer_redesign,ig_android_story_viewer_segments_bar_universe,ig_explore_netego,ig_android_audience_control_sharecut_universe,ig_android_direct_fix_top_of_thread_scrolling,ig_video_holdout_h2_2017,ig_android_insights_metrics_graph_universe,ig_android_ad_swipe_up_threshold_universe,ig_android_one_tap_send_sheet_universe,ig_android_international_add_payment_flow_universe,ig_android_live_see_fewer_videos_like_this_universe,ig_android_live_view_profile_from_comments_universe,ig_fbns_blocked,ig_android_direct_inbox_suggestions,ig_android_video_segmented_upload_universe,ig_carousel_post_creation_tag_universe,ig_android_mqtt_region_hint_universe,ig_android_suggest_password_reset_on_oneclick_login,ig_android_live_special_codec_size_list,ig_android_continuous_contact_uploading,ig_android_story_viewer_item_duration_universe,ig_promote_budget_duration_client_server_switch,ig_android_enable_share_to_messenger,ig_android_background_main_feed_fetch,promote_media_picker,ig_android_live_video_reactions_creation_universe,ig_android_sidecar_gallery_universe,ig_android_business_id,ig_android_story_import_intent,ig_android_feed_follow_button_redesign,ig_android_section_based_recipient_list_universe,ig_android_insta_video_broadcaster_infra_perf,ig_android_live_webrtc_livewith_params,ig_android_comment_audience_control_group_selection_universe,android_ig_fbns_kill_switch,ig_android_su_card_view_preparer_qe,ig_android_unified_camera_universe,ig_android_all_videoplayback_persisting_sound,ig_android_live_pause_upload,ig_android_branded_content_brand_remove_self,ig_android_direct_search_recipients_controller_universe,ig_android_ad_show_full_name_universe,ig_android_anrwatchdog,ig_android_camera_video_universe,ig_android_2fac,ig_android_audio_segment_report_info,ig_android_scroll_main_feed,ig_direct_bypass_group_size_limit_universe,ig_android_story_captured_media_recovery,ig_android_skywalker_live_event_start_end,ig_android_comment_hint_text_universe,ig_android_direct_search_story_recipients_universe,ig_android_ad_browser_gesture_control,ig_android_grid_cell_count,ig_promote_marketing_funnel_universe,ig_android_immersive_viewer_ufi_footer,ig_android_ad_watchinstall_universe,ig_android_comments_notifications_universe,ig_android_shortcuts,ig_android_new_optic,ig_android_audience_control_nux,favorites_home_inline_adding,ig_android_canvas_tilt_to_pan_universe,ig_internal_ui_for_lazy_loaded_modules_experiment,ig_android_direct_expiring_media_from_notification_behavior_universe,ig_android_fbupload_check_status_code_universe,ig_android_offline_reel_feed,ig_android_stories_viewer_modal_activity,ig_android_shopping_creation_flow_onboarding_entry_point,ig_android_activity_feed_click_state,ig_android_direct_expiring_image_quality_universe,ig_android_gl_drawing_marks_after_undo_backing,ig_android_story_gallery_behavior,ig_android_mark_seen_state_on_viewed_impression,ig_android_configurable_retry,ig_android_live_monotonic_pts,ig_android_live_webrtc_livewith_h264_supported_decoders,ig_story_ptr_timeout,ig_android_comment_tweaks_universe,ig_android_location_media_count_exp_ig,ig_android_image_cache_log_mismatch_fetch,ig_android_personalized_feed_universe,ig_android_direct_double_tap_to_like_messages,ig_android_comment_activity_feed_deeplink_to_comments_universe,ig_android_insights_holdout,ig_android_video_render_prevent_cancellation,ig_android_blue_token_conversion_universe,ig_android_tabbed_hashtags_locations_universe,ig_android_sfplt_tombstone,ig_android_live_with_guest_viewer_list_universe,ig_android_explore_chaining_universe,ig_android_gqls_typing_indicator,ig_android_comment_audience_control_universe,ig_android_direct_show_inbox_loading_banner_universe,ig_android_near_bottom_fetch,ig_promote_guided_creation_flow,ig_ads_increase_connection_step2_v2,ig_android_draw_chalk_client_universe';
- const LOGIN_EXPERIMENTS = 'ig_growth_android_profile_pic_prefill_with_fb_pic_2,ig_android_icon_perf2,ig_android_autosubmit_password_recovery_universe,ig_android_background_voice_phone_confirmation_prefilled_phone_number_only,ig_android_report_nux_completed_device,ig_account_recovery_via_whatsapp_universe,ig_android_stories_reels_tray_media_count_check,ig_android_background_voice_confirmation_block_argentinian_numbers,ig_android_device_verification_fb_signup,ig_android_reg_nux_headers_cleanup_universe,ig_android_reg_omnibox,ig_android_background_voice_phone_confirmation,ig_android_gmail_autocomplete_account_over_one_tap,ig_android_phone_reg_redesign_universe,ig_android_skip_signup_from_one_tap_if_no_fb_sso,ig_android_reg_login_profile_photo_universe,ig_android_access_flow_prefill,ig_android_email_suggestions_universe,ig_android_contact_import_placement_universe,ig_android_ask_for_permissions_on_reg,ig_android_onboarding_skip_fb_connect,ig_account_identity_logged_out_signals_global_holdout_universe,ig_android_hide_fb_connect_for_signup,ig_android_account_switch_infra_universe,ig_restore_focus_on_reg_textbox_universe,ig_android_login_identifier_fuzzy_match,ig_android_suma_biz_account,ig_android_session_scoping_facebook_account,ig_android_security_intent_switchoff,ig_android_do_not_show_back_button_in_nux_user_list,ig_android_aymh_signal_collecting_kill_switch,ig_android_persistent_duplicate_notif_checker,ig_android_multi_tap_login_new,ig_android_nux_add_email_device,ig_android_login_safetynet,ig_android_fci_onboarding_friend_search,ig_android_editable_username_in_reg,ig_android_phone_auto_login_during_reg,ig_android_one_tap_fallback_auto_login,ig_android_device_detection_info_upload,ig_android_updated_copy_user_lookup_failed,ig_fb_invite_entry_points,ig_android_hsite_prefill_new_carrier,ig_android_gmail_oauth_in_reg,ig_two_fac_login_screen,ig_android_reg_modularization_universe,ig_android_passwordless_auth,ig_android_sim_info_upload,ig_android_universe_noticiation_channels,ig_android_realtime_manager_cleanup_universe,ig_android_analytics_accessibility_event,ig_android_direct_main_tab_universe,ig_android_email_one_tap_auto_login_during_reg,ig_android_prefill_full_name_from_fb,ig_android_directapp_camera_open_and_reset_universe,ig_challenge_kill_switch,ig_android_video_bug_report_universe,ig_account_recovery_with_code_android_universe,ig_prioritize_user_input_on_switch_to_signup,ig_android_modularized_nux_universe_device,ig_android_account_recovery_auto_login,ig_android_hide_typeahead_for_logged_users,ig_android_targeted_one_tap_upsell_universe,ig_android_caption_typeahead_fix_on_o_universe,ig_android_crosshare_feed_post,ig_android_retry_create_account_universe,ig_android_abandoned_reg_flow,ig_android_remember_password_at_login,ig_android_smartlock_hints_universe,ig_android_2fac_auto_fill_sms_universe,ig_android_onetaplogin_optimization,ig_type_ahead_recover_account,ig_android_family_apps_user_values_provider_universe,ig_android_direct_inbox_account_switching,ig_android_smart_prefill_killswitch,ig_android_exoplayer_settings,ig_android_bottom_sheet,ig_android_publisher_integration,ig_sem_resurrection_logging,ig_android_login_forgot_password_universe,ig_android_hindi,ig_android_hide_fb_flow_in_add_account_flow,ig_android_dialog_email_reg_error_universe,ig_android_low_priority_notifications_universe,ig_android_device_sms_retriever_plugin_universe,ig_android_device_verification_separate_endpoint';
- const SIG_KEY_VERSION = '4';
- const USER_AGENT_LOCALE = 'tr_TR';
- const ACCEPT_LANGUAGE = 'tr-TR';
- const CONTENT_TYPE = 'application/x-www-form-urlencoded; charset=UTF-8';
- const X_FB_HTTP_Engine = 'Liger';
- const X_IG_Connection_Type = 'WIFI';
- const X_IG_Capabilities = '3brTBw==';
- const FACEBOOK_OTA_FIELDS = 'update%7Bdownload_uri%2Cdownload_uri_delta_base%2Cversion_code_delta_base%2Cdownload_uri_delta%2Cfallback_to_full_update%2Cfile_size_delta%2Cversion_code%2Cpublished_date%2Cfile_size%2Cota_bundle_type%2Cresources_checksum%7D';
- const FACEBOOK_ORCA_PROTOCOL_VERSION = 20150314;
- const FACEBOOK_ORCA_APPLICATION_ID = '124024574287414';
- const FACEBOOK_ANALYTICS_APPLICATION_ID = '567067343352427';
- const PLATFORM = 'android';
- const FBNS_APPLICATION_NAME = 'MQTT';
- const INSTAGRAM_APPLICATION_NAME = 'InstagramForAndroid';
- const PACKAGE_NAME = 'com.instagram.android';
- const SURFACE_PARAM = 4715;
- const WEB_URL = 'https://www.instagram.com/';
- }
- class GoodDevices
- {
- const DEVICES = ['24/7.0; 380dpi; 1080x1920; OnePlus; ONEPLUS A3010; OnePlus3T; qcom', '23/6.0.1; 640dpi; 1440x2392; LGE/lge; RS988; h1; h1', '24/7.0; 640dpi; 1440x2560; HUAWEI; LON-L29; HWLON; hi3660', '23/6.0.1; 640dpi; 1440x2560; ZTE; ZTE A2017U; ailsa_ii; qcom', '23/6.0.1; 640dpi; 1440x2560; samsung; SM-G935F; hero2lte; samsungexynos8890', '23/6.0.1; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890'];
- static public function getRandomGoodDevice()
- {
- $randomIdx = array_rand(['24/7.0; 380dpi; 1080x1920; OnePlus; ONEPLUS A3010; OnePlus3T; qcom', '23/6.0.1; 640dpi; 1440x2392; LGE/lge; RS988; h1; h1', '24/7.0; 640dpi; 1440x2560; HUAWEI; LON-L29; HWLON; hi3660', '23/6.0.1; 640dpi; 1440x2560; ZTE; ZTE A2017U; ailsa_ii; qcom', '23/6.0.1; 640dpi; 1440x2560; samsung; SM-G935F; hero2lte; samsungexynos8890', '23/6.0.1; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890'], 1);
- return ['24/7.0; 380dpi; 1080x1920; OnePlus; ONEPLUS A3010; OnePlus3T; qcom', '23/6.0.1; 640dpi; 1440x2392; LGE/lge; RS988; h1; h1', '24/7.0; 640dpi; 1440x2560; HUAWEI; LON-L29; HWLON; hi3660', '23/6.0.1; 640dpi; 1440x2560; ZTE; ZTE A2017U; ailsa_ii; qcom', '23/6.0.1; 640dpi; 1440x2560; samsung; SM-G935F; hero2lte; samsungexynos8890', '23/6.0.1; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890'][$randomIdx];
- }
- }
- class Device
- {
- const REQUIRED_ANDROID_VERSION = '2.2';
- protected $_appVersion;
- protected $_userLocale;
- protected $_deviceString;
- protected $_userAgent;
- protected $_androidVersion;
- protected $_androidRelease;
- protected $_dpi;
- protected $_resolution;
- protected $_manufacturer;
- protected $_brand;
- protected $_model;
- protected $_device;
- protected $_cpu;
- public function __construct($appVersion, $userLocale, $deviceString = NULL, $autoFallback = true)
- {
- $this->_appVersion = $appVersion;
- $this->_userLocale = $userLocale;
- if ($autoFallback && !is_string($deviceString)) {
- $deviceString = GoodDevices::getRandomGoodDevice();
- }
- $this->_initFromDeviceString($deviceString);
- }
- protected function _initFromDeviceString($deviceString)
- {
- if (!is_string($deviceString) || empty($deviceString)) {
- throw new RuntimeException('Device string is empty.');
- }
- $parts = explode('; ', $deviceString);
- if (count($parts) !== 7) {
- throw new RuntimeException(sprintf('Device string "%s" does not conform to the required device format.', $deviceString));
- }
- $androidOS = explode('/', $parts[0], 2);
- if (version_compare($androidOS[1], '2.2', '<')) {
- throw new RuntimeException(sprintf('Device string "%s" does not meet the minimum required Android version "%s" for Instagram.', $deviceString, '2.2'));
- }
- $manufacturerAndBrand = explode('/', $parts[3], 2);
- $this->_deviceString = $deviceString;
- $this->_androidVersion = $androidOS[0];
- $this->_androidRelease = $androidOS[1];
- $this->_dpi = $parts[1];
- $this->_resolution = $parts[2];
- $this->_manufacturer = $manufacturerAndBrand[0];
- $this->_brand = (isset($manufacturerAndBrand[1]) ? $manufacturerAndBrand[1] : NULL);
- $this->_model = $parts[4];
- $this->_device = $parts[5];
- $this->_cpu = $parts[6];
- $this->_userAgent = UserAgent::buildUserAgent($this->_appVersion, $this->_userLocale, $this);
- }
- public function getDeviceString()
- {
- return $this->_deviceString;
- }
- public function getUserAgent()
- {
- return $this->_userAgent;
- }
- public function getAndroidVersion()
- {
- return $this->_androidVersion;
- }
- public function getAndroidRelease()
- {
- return $this->_androidRelease;
- }
- public function getDPI()
- {
- return $this->_dpi;
- }
- public function getResolution()
- {
- return $this->_resolution;
- }
- public function getManufacturer()
- {
- return $this->_manufacturer;
- }
- public function getBrand()
- {
- return $this->_brand;
- }
- public function getModel()
- {
- return $this->_model;
- }
- public function getDevice()
- {
- return $this->_device;
- }
- public function getCPU()
- {
- return $this->_cpu;
- }
- }
- class UserAgent
- {
- const USER_AGENT_FORMAT = 'Instagram %s Android (%s/%s; %s; %s; %s; %s; %s; %s; %s; 104766893)';
- static public function buildUserAgent($appVersion, $userLocale, Device $device)
- {
- if (!($device instanceof Device)) {
- throw new InvalidArgumentException('The device parameter must be a Device class instance.');
- }
- $manufacturerWithBrand = $device->getManufacturer();
- if ($device->getBrand() !== NULL) {
- $manufacturerWithBrand .= '/' . $device->getBrand();
- }
- return sprintf('Instagram %s Android (%s/%s; %s; %s; %s; %s; %s; %s; %s; 104766893)', $appVersion, $device->getAndroidVersion(), $device->getAndroidRelease(), $device->getDPI(), $device->getResolution(), $manufacturerWithBrand, $device->getModel(), $device->getDevice(), $device->getCPU(), $userLocale);
- }
- }
- class ApiService
- {
- private $db;
- private $data;
- public function __construct()
- {
- }
- public function addData($data)
- {
- $this->data = $data;
- $this->db = \Wow\Database\Database::getInstance();
- if ($this->data['islemTip'] == 'follow') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,userID,userName,imageUrl,krediTotal,krediLeft,excludedInstaIDs,start_count,talepPrice,isApi) VALUES(:bayiID,:islemTip,:userID,:userName,:imageUrl,:krediTotal,:krediLeft,:excludedInstaIDs,:start_count,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'imageUrl' => $this->data['imageUrl'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'excludedInstaIDs' => $this->data['excludedInstaIDs'], 'start_count' => $this->data['start_count'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'like') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,mediaID,mediaCode,userID,userName,imageUrl,krediTotal,krediLeft, excludedInstaIDs,start_count,talepPrice,isApi) VALUES(:bayiID,:islemTip,:mediaID,:mediaCode,:userID,:userName,:imageUrl,:krediTotal,:krediLeft, :excludedInstaIDs,:start_count,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'mediaID' => $this->data['mediaID'], 'mediaCode' => $this->data['mediaCode'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'imageUrl' => $this->data['imageUrl'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'excludedInstaIDs' => $this->data['excludedInstaIDs'], 'start_count' => $this->data['start_count'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'comment') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,mediaID,mediaCode,userID,userName,imageUrl,krediTotal,krediLeft, excludedInstaIDs,allComments,start_count,talepPrice,isApi) VALUES(:bayiID,:islemTip,:mediaID,:mediaCode,:userID,:userName,:imageUrl,:krediTotal,:krediLeft, :excludedInstaIDs,:allComments,:start_count,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'mediaID' => $this->data['mediaID'], 'mediaCode' => $this->data['mediaCode'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'imageUrl' => $this->data['imageUrl'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'excludedInstaIDs' => $this->data['excludedInstaIDs'], 'allComments' => $this->data['comments'], 'start_count' => $this->data['start_count'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'story') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,userID,userName,imageUrl,krediTotal,krediLeft,allStories,start_count,talepPrice,isApi) VALUES(:bayiID,:islemTip,:userID,:userName,:imageUrl,:krediTotal,:krediLeft,:allStories,:start_count,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'imageUrl' => $this->data['imageUrl'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'allStories' => $this->data['allStories'], 'start_count' => $this->data['start_count'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'videoview') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,mediaID,mediaCode,userID,userName,imageUrl,krediTotal,krediLeft,start_count,talepPrice,isApi) VALUES(:bayiID,:islemTip,:mediaID,:mediaCode,:userID,:userName,:imageUrl,:krediTotal,:krediLeft,:start_count,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'mediaID' => $this->data['mediaID'], 'mediaCode' => $this->data['mediaCode'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'imageUrl' => $this->data['imageUrl'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'start_count' => $this->data['start_count'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'save') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,mediaID,mediaCode,userID,userName,imageUrl,krediTotal,krediLeft,start_count,talepPrice,isApi) VALUES(:bayiID,:islemTip,:mediaID,:mediaCode,:userID,:userName,:imageUrl,:krediTotal,:krediLeft,:start_count,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'mediaID' => $this->data['mediaID'], 'mediaCode' => $this->data['mediaCode'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'imageUrl' => $this->data['imageUrl'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'start_count' => $this->data['start_count'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'commentlike') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,mediaID,likedComment,likedCommentID,userName,krediTotal,krediLeft,talepPrice,isApi) VALUES(:bayiID,:islemTip,:mediaID,:likedComment,:likedCommentID,:userName,:krediTotal,:krediLeft,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'mediaID' => $this->data['media_id'], 'likedComment' => $this->data['likedComment'], 'likedCommentID' => $this->data['likedCommentID'], 'userName' => $this->data['username'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- else if ($this->data['islemTip'] == 'canliyayin') {
- $this->db->query('INSERT INTO bayi_islem (bayiID,islemTip,userID,userName,broadcastID,krediTotal,krediLeft,talepPrice,isApi) VALUES(:bayiID,:islemTip,:userID,:userName,:broadcastID,:krediTotal,:krediLeft,:talepPrice,:isapi)', ['bayiID' => $this->data['bayiID'], 'islemTip' => $this->data['islemTip'], 'userID' => $this->data['userID'], 'userName' => $this->data['userName'], 'broadcastID' => $this->data['broadcastID'], 'krediTotal' => $this->data['krediTotal'], 'krediLeft' => $this->data['krediLeft'], 'talepPrice' => $this->data['tutar'], 'isapi' => 1]);
- $orderID = $this->db->lastInsertId();
- }
- if (!empty($orderID)) {
- $this->db->query('UPDATE bayi SET bakiye = bakiye - :tutar WHERE bayiID=:bayiID', ['bayiID' => $this->data['bayiID'], 'tutar' => $this->data['tutar']]);
- }
- return $orderID;
- }
- }
- class BulkReaction
- {
- protected $users = [];
- protected $simultanepostsize;
- protected $IGDataPath;
- public function __construct($users, $simultanepostsize = 100)
- {
- if (!is_array($users) || empty($users)) {
- throw new Exception('Invalid user array!');
- }
- $this->simultanepostsize = $simultanepostsize;
- $this->IGDataPath = Wow::get('project/cookiePath') . 'instagramv3/';
- $userIndex = 0;
- foreach ($users as $user) {
- $this->users[] = ['data' => array_merge($user, ['index' => $userIndex]), 'object' => new Instagram($user['kullaniciAdi'], $user['sifre'], $user['instaID'])];
- $userIndex++;
- }
- }
- public function DeviceId()
- {
- return 'E' . rand(0, 9) . 'CD' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '-' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '-' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '-' . rand(0, 9) . 'A' . rand(0, 9) . '' . rand(0, 9) . '-C' . rand(0, 9) . 'F' . rand(0, 9) . '' . rand(0, 9) . 'D' . rand(0, 9) . 'F' . rand(0, 9) . 'AEE';
- }
- public function SessionId()
- {
- return 'DC' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . 'C-' . rand(0, 9) . '' . rand(0, 9) . 'A' . rand(0, 9) . '-' . rand(0, 9) . 'F' . rand(0, 9) . '' . rand(0, 9) . '-B' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '-' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . 'A' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . 'FB' . rand(0, 9) . '';
- }
- public function izlenme($mediaCode)
- {
- $totalSuccessCount = 0;
- $triedUsers = [];
- $postlar = [];
- $rollingCurl = new \RollingCurl\RollingCurl();
- $DeviceId = $this->DeviceId();
- $SessionId = $this->SessionId();
- foreach ($this->users as $user) {
- $headers = ['Connection: keep-alive', 'Proxy-Connection: keep-alive', 'X-IG-Connection-Type: WiFi', 'X-IG-Capabilities: Fw==', 'Accept-Language:tr'];
- $objInstagram = $user['object'];
- $objData = $objInstagram->getData();
- $userAsns = Utils::generateAsns($objData[INSTAWEB_ASNS_KEY]);
- $options = [CURLOPT_USERAGENT => 'Instagram 9.4.0 Android (24/7.0; 380dpi; 1080x1920; OnePlus; ONEPLUS A3010; OnePlus3T; qcom; tr_TR)', CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_COOKIE => $objData['cookie']];
- if ($userAsns[0]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_INTERFACE : CURLOPT_PROXY);
- $options[$optionKey] = $userAsns[0];
- if ($userAsns[1]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_IPRESOLVE : CURLOPT_PROXYUSERPWD);
- $options[$optionKey] = $userAsns[1];
- }
- }
- $rollingCurl->get('https://www.instagram.com/p/' . $mediaCode . '/?__a=1', $headers, $options, $user['data']);
- $rollingCurl->get('https://www.instagram.com/p/' . $mediaCode . '/?__a=1', $headers, $options, $user['data']);
- }
- $rollingCurl->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) use(&$triedUsers, &$totalSuccessCount, &$logData, &$DeviceId, &$SessionId, &$postlar) {
- $triedUser = ['userID' => $request->identifierParams['uyeID'], 'instaID' => $request->identifierParams['instaID'], 'userNick' => $request->identifierParams['kullaniciAdi'], 'status' => 'na'];
- $postveri = ['post' => ''];
- $isErrored = $request->getResponseError();
- if (empty($isErrored)) {
- $responseInfo = $request->getResponseInfo();
- if ($responseInfo['http_code'] == 200) {
- $donenSonuc = json_decode($request->getResponseText(), true);
- if (isset($donenSonuc['graphql']) && ($donenSonuc['graphql']['shortcode_media']['__typename'] == 'GraphVideo')) {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- $insta_id = $triedUser['instaID'];
- $tracking_token = $donenSonuc['graphql']['shortcode_media']['tracking_token'];
- $Ts = $donenSonuc['graphql']['shortcode_media']['taken_at_timestamp'];
- $ResimUserId = $donenSonuc['graphql']['shortcode_media']['owner']['id'];
- $ResimUsername = $donenSonuc['graphql']['shortcode_media']['owner']['username'];
- $MediaId = '' . $donenSonuc['graphql']['shortcode_media']['id'] . '_' . $insta_id . '';
- $TimeHack = time() * 86400;
- $CookieId = $insta_id;
- $RusMasajYapanlar = "\n" . '{' . "\n" . '"seq":0,' . "\n" . '"app_id":"567067343352427",' . "\n" . '"app_ver":"9.0.1",' . "\n" . '"build_num":"35440032",' . "\n" . '"device_id":"' . $DeviceId . '",' . "\n" . '"session_id":"' . $SessionId . '",' . "\n" . '"uid":"0","data":[' . "\n" . '{"name":"navigation","time":"' . $TimeHack . '.178","module":"profile","extra":{"click_point":"video_thumbnail","nav_depth":2,"grid_index":"10","media_id":"' . $MediaId . '","dest_module":"video_view","seq":4,"nav_time_taken":2,"user_id":"' . $ResimUserId . '","username":"chnknz","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"navigation","time":"' . $TimeHack . '.178","module":"profile","extra":{"click_point":"video_thumbnail","nav_depth":2,"grid_index":"10","media_id":"' . $MediaId . '","dest_module":"video_view","seq":4,"nav_time_taken":2,"user_id":"' . $ResimUserId . '","username":"chnknz","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"instagram_organic_impression","time":"' . $TimeHack . '.201","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"m_t":2,"tracking_token":"' . $tracking_token . '","source_of_action":"video_view","follow_status":"following","m_ix":0,"pk":"' . $CookieId . '"}},' . "\n" . '{"name":"video_displayed","time":"' . $TimeHack . '.201","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"tracking_token":"' . $tracking_token . '","follow_status":"following","m_ix":0,"initial":"1","a_i":"organic","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"video_should_start","time":"' . $TimeHack . '.201","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":1500707308,"tracking_token":"' . $tracking_token . '","follow_status":"following","reason":"start","a_i":"organic","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"video_download_completed","time":"' . $TimeHack . '.568","extra":{"url":"https://scontent-frt3-2.cdninstagram.com/vp/8f4c306c142f5859dc4a6a14d2126f76/5A1C1BCC/t50.2886-16/20248700_1381451691971906_8775822576162177024_n.mp4","bytes_downloaded":644944,"bytes_full_content":644944,"total_request_time_ms":362,"connection_type":"WIFI","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"video_started_playing","time":"' . $TimeHack . '.641","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"tracking_token":"' . $tracking_token . '","follow_status":"following","m_ix":0,"playing_audio":"0","reason":"autoplay","start_delay":1439,"cached":false,"system_volume":"0.5","streaming":true,"prefetch_size":512,"a_i":"organic","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"video_paused","time":"' . $TimeHack . '.756","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"tracking_token":"' . $tracking_token . '","follow_status":"following","m_ix":0,"time":5.7330000400543213,"duration":10.355000019073486,"timeAsPercent":1.6971055088702147,"playing_audio":"0","original_start_reason":"autoplay","reason":"fragment_paused","lsp":0.0,"system_volume":"0.5","loop_count":1.6971055269241333,"a_i":"organic","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"instagram_organic_viewed_impression","time":"' . $TimeHack . '.757","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"m_t":2,"tracking_token":"' . $tracking_token . '","source_of_action":"video_view","follow_status":"following","m_ix":0,"pk":"' . $CookieId . '"}},' . "\n" . '{"name":"instagram_organic_time_spent","time":"' . $TimeHack . '.757","module":"video_view","extra":{"m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"m_t":2,"tracking_token":"' . $tracking_token . '","source_of_action":"video_view","follow_status":"following","m_ix":0,"timespent":10556,"avgViewPercent":1.0,"maxViewPercent":1.0,"pk":"' . $CookieId . '"}},' . "\n" . '{"name":"app_state","time":"' . $TimeHack . '.764","module":"video_view","extra":{"state":"background","pk":"' . $CookieId . '"}},' . "\n" . '{"name":"time_spent_bit_array","time":"' . $TimeHack . '.764","extra":{"tos_id":"hb58md","start_time":' . $TimeHack . ',"tos_array":"[1, 0]","tos_len":16,"tos_seq":1,"tos_cum":5,"pk":"' . $CookieId . '"}},{"name":"video_started_playing","time":"' . $TimeHack . '.780","module":"video_view_profile","extra":{"video_type":"feed","m_pk":"' . $MediaId . '","a_pk":"' . $ResimUserId . '","m_ts":' . $TimeHack . ',"tracking_token":"' . $tracking_token . '","follow_status":"following","m_ix":0,"playing_audio":"0","reason":"autoplay","start_delay":45,"cached":false,"system_volume":"1.0","streaming":true,"prefetch_size":512,"video_width":0,"video_height":0,"is_dash_eligible":1,"playback_format":"dash","a_i":"organic","pk":"' . $CookieId . '","release_channel":"beta","radio_type":"wifi-none"}}],"log_type":"client_event"}';
- $postveri['post'] = $RusMasajYapanlar;
- }
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- $triedUsers[] = $triedUser;
- $postlar[] = $postveri;
- $rollingCurl->clearCompleted();
- $rollingCurl->prunePendingRequestQueue();
- });
- $rollingCurl->setSimultaneousLimit($this->simultanepostsize);
- $rollingCurl->execute();
- foreach ($postlar as $user) {
- $headers = ['Accept: ', 'X-IG-Connection-Type: WiFi', 'X-IG-Capabilities: 36oD', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'Accept-Language: tr;q=1', 'Connection: keep-alive', 'User-Agent: Instagram 9.0.1 (iPad2,5; iPhone OS 8_3; tr_TR; tr; scale=' . rand(0, 9) . '.' . rand(0, 9) . '' . rand(0, 9) . '; gamut=normal; ' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . 'x9' . rand(0, 9) . '' . rand(0, 9) . ') AppleWebKit/' . rand(0, 9) . '' . rand(0, 9) . '' . rand(0, 9) . '+'];
- $options = [CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => ''];
- $post = 'message=' . $user['post'] . '&format=json';
- if ($userAsns[0]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_INTERFACE : CURLOPT_PROXY);
- $options[$optionKey] = $userAsns[0];
- if ($userAsns[1]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_IPRESOLVE : CURLOPT_PROXYUSERPWD);
- $options[$optionKey] = $userAsns[1];
- }
- }
- $rollingCurl->post('https://graph.instagram.com/logging_client_events', $post, $headers, $options, '');
- }
- $rollingCurl->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) use(&$veriler) {
- $rollingCurl->clearCompleted();
- $rollingCurl->prunePendingRequestQueue();
- });
- $rollingCurl->setSimultaneousLimit($this->simultanepostsize);
- $rollingCurl->execute();
- return ['totalSuccessCount' => intval($totalSuccessCount) / 2, 'users' => $triedUsers];
- }
- public function playLive($broadcastID)
- {
- $totalSuccessCount = 0;
- $triedUsers = [];
- $rollingCurl = new \RollingCurl\RollingCurl();
- foreach ($this->users as $user) {
- $objInstagram = $user['object'];
- $objData = $objInstagram->getData();
- $requestPosts = ['_uuid' => $objData['uuid'], '_uid' => $objData['username_id'], '_csrftoken' => $objData['token'], 'radio_type' => 'wifi-none'];
- $requestPosts = Signatures::signData($requestPosts);
- $postData = http_build_query(Utils::reorderByHashCode($requestPosts));
- $headers = ['Connection: close', 'Accept: */*', 'X-IG-Capabilities: 3brTBw==', 'X-IG-Connection-Type: WIFI', 'X-IG-Connection-Speed: ' . mt_rand(1000, 3700) . 'kbps', 'X-FB-HTTP-Engine: Liger', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'Accept-Language: tr-TR'];
- $options = [CURLOPT_USERAGENT => $objData['user_agent'], CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_COOKIE => $objData['cookie']];
- $rollingCurl->post('https://i.instagram.com/api/v1/live/' . $broadcastID . '/heartbeat_and_get_viewer_count/', $postData, $headers, $options, $user['data']);
- }
- $rollingCurl->setSimultaneousLimit(500);
- $rollingCurl->execute();
- return ['totalSuccessCount' => $totalSuccessCount, 'users' => $triedUsers];
- }
- public function save($mediaID, $mediaCode)
- {
- $totalSuccessCount = 0;
- $triedUsers = [];
- $rollingCurl = new \RollingCurl\RollingCurl();
- $arrMediaID = explode('_', $mediaID);
- $mediaIDBeforer = $arrMediaID[0];
- foreach ($this->users as $user) {
- $objInstagram = $user['object'];
- $objData = $objInstagram->getData();
- $userAsns = Utils::generateAsns($objData[INSTAWEB_ASNS_KEY]);
- $requestPosts = ['_uuid' => $objData['uuid'], '_uid' => $objData['username_id'], '_csrftoken' => $objData['token'], 'media_id' => $mediaID];
- $requestPosts = Signatures::signData($requestPosts);
- $postData = http_build_query(Utils::reorderByHashCode($requestPosts));
- $headers = ['Connection: close', 'Accept: */*', 'X-IG-Capabilities: 3brTBw==', 'X-IG-App-ID: 567067343352427', 'X-IG-Connection-Type: WIFI', 'X-IG-Connection-Speed: ' . mt_rand(1000, 3700) . 'kbps', 'X-IG-Bandwidth-Speed-KBPS: -1.000', 'X-IG-Bandwidth-TotalBytes-B: 0', 'X-IG-Bandwidth-TotalTime-MS: 0', 'X-FB-HTTP-Engine: Liger', 'Accept-Language: tr-TR'];
- $options = [CURLOPT_USERAGENT => $objData['user_agent'], CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_COOKIE => $objData['cookie']];
- if ($userAsns[0]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_INTERFACE : CURLOPT_PROXY);
- $options[$optionKey] = $userAsns[0];
- if ($userAsns[1]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_IPRESOLVE : CURLOPT_PROXYUSERPWD);
- $options[$optionKey] = $userAsns[1];
- }
- }
- $rollingCurl->post('https://i.instagram.com/api/v1/media/' . $mediaID . '/save/', $postData, $headers, $options, $user['data']);
- }
- $rollingCurl->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) use(&$triedUsers, &$totalSuccessCount, &$logData) {
- $triedUser = ['userID' => $request->identifierParams['uyeID'], 'instaID' => $request->identifierParams['instaID'], 'userNick' => $request->identifierParams['kullaniciAdi'], 'status' => 'na'];
- $isErrored = $request->getResponseError();
- if (empty($isErrored)) {
- $responseInfo = $request->getResponseInfo();
- if ($responseInfo['http_code'] == 200) {
- $donenSonuc = json_decode($request->getResponseText(), true);
- if ($donenSonuc) {
- if (strpos($request->getResponseHeaders(), 'Set-Cookie') !== false) {
- $obj = $this->users[$request->identifierParams['index']]['object'];
- $obj->organizeCookies($request->getResponseHeaders());
- }
- if ($request->identifierParams['isWebCookie'] == 1) {
- if ($donenSonuc['status'] == 'ok') {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- else if ($donenSonuc['status'] == 'ok') {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- $triedUser['info'] = $donenSonuc;
- $triedUser['total'] = $totalSuccessCount;
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- $triedUsers[] = $triedUser;
- $rollingCurl->clearCompleted();
- $rollingCurl->prunePendingRequestQueue();
- });
- $rollingCurl->setSimultaneousLimit($this->simultanepostsize);
- $rollingCurl->execute();
- return ['totalSuccessCount' => $totalSuccessCount, 'users' => $triedUsers];
- }
- public function like($mediaID, $mediaUsername, $mediaUserID)
- {
- $totalSuccessCount = 0;
- $triedUsers = [];
- $rollingCurl = new \RollingCurl\RollingCurl();
- foreach ($this->users as $user) {
- $objInstagram = $user['object'];
- $objData = $objInstagram->getData();
- $userAsns = Utils::generateAsns($objData[INSTAWEB_ASNS_KEY]);
- $objInstagram->getLoginTimelineFeed();
- $requestPosts = ['module_name' => 'profile', 'media_id' => $mediaID, '_csrftoken' => $objData['token'], 'username' => $mediaUsername, 'user_id' => $mediaUserID, 'radio_type' => 'wifi-none', '_uid' => $objData['username_id'], '_uuid' => $objData['uuid'], 'd' => 0];
- $requestPosts = Signatures::signData($requestPosts, ['d']);
- $postData = http_build_query(Utils::reorderByHashCode($requestPosts));
- $headers = ['Connection: close', 'Accept: */*', 'X-IG-Capabilities: 3brTBw==', 'X-IG-App-ID: 567067343352427', 'X-IG-Connection-Type: WIFI', 'X-IG-Connection-Speed: ' . mt_rand(1000, 3700) . 'kbps', 'X-IG-Bandwidth-Speed-KBPS: 514.297', 'X-IG-Bandwidth-TotalBytes-B: 15502891', 'X-IG-Bandwidth-TotalTime-MS: 25064', 'X-IG-ABR-Connection-Speed-KBPS: 162', 'X-FB-HTTP-Engine: Liger', 'Accept-Language: tr-TR'];
- $options = [CURLOPT_USERAGENT => $objData['user_agent'], CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_COOKIE => $objData['cookie']];
- if ($userAsns[0]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_INTERFACE : CURLOPT_PROXY);
- $options[$optionKey] = $userAsns[0];
- if ($userAsns[1]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_IPRESOLVE : CURLOPT_PROXYUSERPWD);
- $options[$optionKey] = $userAsns[1];
- }
- }
- $rollingCurl->post('https://i.instagram.com/api/v1/media/' . $mediaID . '/like/', $postData, $headers, $options, $user['data']);
- $rollingCurl->get('https://i.instagram.com/api/v1/users/' . $mediaUsername . '/usernameinfo/', $headers, $options, $user['data']);
- }
- $rollingCurl->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) use(&$triedUsers, &$totalSuccessCount, &$logData) {
- $triedUser = ['userID' => $request->identifierParams['uyeID'], 'instaID' => $request->identifierParams['instaID'], 'userNick' => $request->identifierParams['kullaniciAdi'], 'status' => 'na'];
- $isErrored = $request->getResponseError();
- if (empty($isErrored) && stristr($request->getUrl(), '/like/')) {
- $responseInfo = $request->getResponseInfo();
- if ($responseInfo['http_code'] == 200) {
- $donenSonuc = json_decode($request->getResponseText(), true);
- if ($donenSonuc) {
- if (strpos($request->getResponseHeaders(), 'Set-Cookie') !== false) {
- $obj = $this->users[$request->identifierParams['index']]['object'];
- $obj->organizeCookies($request->getResponseHeaders());
- }
- if ($donenSonuc['status'] == 'ok') {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- $triedUser['info'] = $donenSonuc;
- }
- else {
- $triedUser['status'] = 'fail';
- $triedUser['info'] = $responseInfo;
- $triedUser['text'] = $request->getResponseText();
- $kontrol = json_decode($request->getResponseText(), true);
- if (($kontrol['message'] == 'login_required') || ($kontrol['message'] == 'challenge_required')) {
- $triedUser['durum'] = 0;
- }
- }
- }
- $triedUsers[] = $triedUser;
- $rollingCurl->clearCompleted();
- $rollingCurl->prunePendingRequestQueue();
- });
- $rollingCurl->setSimultaneousLimit($this->simultanepostsize);
- $rollingCurl->execute();
- return ['totalSuccessCount' => $totalSuccessCount, 'users' => $triedUsers];
- }
- public function commentlike($mediaID, $commentID)
- {
- $totalSuccessCount = 0;
- $triedUsers = [];
- $rollingCurl = new \RollingCurl\RollingCurl();
- $arrMediaID = explode('_', $mediaID);
- $mediaIDBeforer = $arrMediaID[0];
- foreach ($this->users as $user) {
- $objInstagram = $user['object'];
- $objData = $objInstagram->getData();
- $userAsns = Utils::generateAsns($objData[INSTAWEB_ASNS_KEY]);
- $requestPosts = ['_uuid' => $objData['uuid'], '_uid' => $objData['username_id'], '_csrftoken' => $objData['token'], 'media_id' => $mediaIDBeforer];
- $requestPosts = Signatures::signData($requestPosts);
- $postData = http_build_query(Utils::reorderByHashCode($requestPosts));
- $headers = ['Connection: close', 'Accept: */*', 'X-IG-Capabilities: 3brTBw==', 'X-IG-App-ID: 567067343352427', 'X-IG-Connection-Type: WIFI', 'X-IG-Connection-Speed: ' . mt_rand(1000, 3700) . 'kbps', 'X-IG-Bandwidth-Speed-KBPS: -1.000', 'X-IG-Bandwidth-TotalBytes-B: 0', 'X-IG-Bandwidth-TotalTime-MS: 0', 'X-IG-ABR-Connection-Speed-KBPS: 162', 'X-FB-HTTP-Engine: Liger', 'Accept-Language: tr-TR'];
- $options = [CURLOPT_USERAGENT => $objData['user_agent'], CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_COOKIE => $objData['cookie']];
- if ($userAsns[0]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_INTERFACE : CURLOPT_PROXY);
- $options[$optionKey] = $userAsns[0];
- if ($userAsns[1]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_IPRESOLVE : CURLOPT_PROXYUSERPWD);
- $options[$optionKey] = $userAsns[1];
- }
- }
- $rollingCurl->post('https://i.instagram.com/api/v1/media/' . $commentID . '/comment_like/', $postData, $headers, $options, $user['data']);
- }
- $rollingCurl->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) use(&$triedUsers, &$totalSuccessCount, &$logData) {
- $triedUser = ['userID' => $request->identifierParams['uyeID'], 'instaID' => $request->identifierParams['instaID'], 'userNick' => $request->identifierParams['kullaniciAdi'], 'status' => 'na'];
- $isErrored = $request->getResponseError();
- if (empty($isErrored)) {
- $responseInfo = $request->getResponseInfo();
- if ($responseInfo['http_code'] == 200) {
- $donenSonuc = json_decode($request->getResponseText(), true);
- if ($donenSonuc) {
- if (strpos($request->getResponseHeaders(), 'Set-Cookie') !== false) {
- $obj = $this->users[$request->identifierParams['index']]['object'];
- $obj->organizeCookies($request->getResponseHeaders());
- }
- if ($donenSonuc['status'] == 'ok') {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- }
- else {
- $triedUser['status'] = 'fail';
- $triedUser['info'] = $donenSonuc;
- }
- }
- }
- else {
- $triedUser['status'] = 'fail';
- $triedUser['info'] = $responseInfo;
- }
- }
- $triedUsers[] = $triedUser;
- $rollingCurl->clearCompleted();
- $rollingCurl->prunePendingRequestQueue();
- });
- $rollingCurl->setSimultaneousLimit($this->simultanepostsize);
- $rollingCurl->execute();
- return ['totalSuccessCount' => $totalSuccessCount, 'users' => $triedUsers];
- }
- public function storyview($items, $sourceId = NULL)
- {
- $reels = [];
- $maxSeenAt = time();
- $seenAt = $maxSeenAt - (3 * count($items));
- foreach ($items as $item) {
- $itemTakenAt = $item['getTakenAt'];
- if ($seenAt < $itemTakenAt) {
- $seenAt = $itemTakenAt + 2;
- }
- if ($maxSeenAt < $seenAt) {
- $seenAt = $maxSeenAt;
- }
- $reelId = $item['itemID'] . '_' . $item['userPK'];
- $reels[$reelId] = [$itemTakenAt . '_' . $seenAt];
- $seenAt += rand(1, 3);
- }
- $totalSuccessCount = 0;
- $triedUsers = [];
- $rollingCurl = new \RollingCurl\RollingCurl();
- foreach ($this->users as $user) {
- $objInstagram = $user['object'];
- $objData = $objInstagram->getData();
- $userAsns = Utils::generateAsns($objData[INSTAWEB_ASNS_KEY]);
- $requestPosts = [
- '_uuid' => $objData['uuid'],
- '_uid' => $objData['username_id'],
- '_csrftoken' => $objData['token'],
- 'reels' => $reels,
- 'live_vods' => [],
- 'reel' => 1,
- 'live_vod' => 0
- ];
- $requestPosts = Signatures::signData($requestPosts);
- $postData = http_build_query(Utils::reorderByHashCode($requestPosts));
- $headers = ['Connection: close', 'Accept: */*', 'X-IG-Capabilities: 3brTBw==', 'X-IG-App-ID: 567067343352427', 'X-IG-Connection-Type: WIFI', 'X-IG-Connection-Speed: ' . mt_rand(1000, 3700) . 'kbps', 'X-IG-Bandwidth-Speed-KBPS: -1.000', 'X-IG-Bandwidth-TotalBytes-B: 0', 'X-IG-Bandwidth-TotalTime-MS: 0', 'X-FB-HTTP-Engine: Liger', 'Accept-Language: tr-TR'];
- $options = [CURLOPT_USERAGENT => $objData['user_agent'], CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_VERBOSE => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_COOKIE => $objData['cookie']];
- if ($userAsns[0]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_INTERFACE : CURLOPT_PROXY);
- $options[$optionKey] = $userAsns[0];
- if ($userAsns[1]) {
- $optionKey = (Wow::get('ayar/proxyStatus') == 4 ? CURLOPT_IPRESOLVE : CURLOPT_PROXYUSERPWD);
- $options[$optionKey] = $userAsns[1];
- }
- }
- $rollingCurl->post('https://i.instagram.com/api/v2/media/seen/', $postData, $headers, $options, $user['data']);
- }
- $rollingCurl->setCallback(function(\RollingCurl\Request $request, \RollingCurl\RollingCurl $rollingCurl) use(&$triedUsers, &$totalSuccessCount, &$logData) {
- $triedUser = ['userID' => $request->identifierParams['uyeID'], 'instaID' => $request->identifierParams['instaID'], 'userNick' => $request->identifierParams['kullaniciAdi'], 'status' => 'na'];
- $isErrored = $request->getResponseError();
- if (empty($isErrored)) {
- $responseInfo = $request->getResponseInfo();
- if ($responseInfo['http_code'] == 200) {
- $donenSonuc = json_decode($request->getResponseText(), true);
- if ($donenSonuc) {
- if (strpos($request->getResponseHeaders(), 'Set-Cookie') !== false) {
- $obj = $this->users[$request->identifierParams['index']]['object'];
- $obj->organizeCookies($request->getResponseHeaders());
- }
- if ($request->identifierParams['isWebCookie'] == 1) {
- if ($donenSonuc['status'] == 'ok') {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- else if ($donenSonuc['status'] == 'ok') {
- $totalSuccessCount++;
- $triedUser['status'] = 'success';
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- }
- else {
- $triedUser['status'] = 'fail';
- }
- }
- $triedUsers[] = $triedUser;
- ...................................................................
- ......................................
- ............
Add Comment
Please, Sign In to add comment