chris-greening / instascrape

Powerful and flexible Instagram scraping library for Python, providing easy-to-use and expressive tools for accessing data programmatically
https://chris-greening.github.io/instascrape/
MIT License
633 stars 109 forks source link

Profile.scrape is_private keeps return True #121

Open yemregundogmus opened 3 years ago

yemregundogmus commented 3 years ago

To find out if an Instagram profile is private, I send a simple query. However, I am facing a problem like this. Even non-private accounts return as Private.

from instascrape import Profile

session_id = 'instert_your_session_id'
P = Profile('apple')
P.scrape(headers={"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36 Edg/87.0.664.57",
           "cookie": f"sessionid={session_id}"})
P.to_dict()

i got this

{'logging_page_id': 'profilePage_5821462185',
 'show_suggested_profiles': False,
 'show_follow_dialog': False,
 'biography': 'Watch Everyday Experiments: Full Bloom',
 'blocked_by_viewer': False,
 'restricted_by_viewer': False,
 'country_block': False,
 'external_url': None,
 'external_url_linkshimmed': 'https://l.instagram.com/?u=http%3A%2F%2Fapple.co%2FExperimentsFullBloom&e=ATPrFOnj3r3pyI0LqqF-0AxOTV4XgEMSED-lagmTlXcIOHV5a7EfARVN62SyvVwFkm6B9embC5NkrJgG_1Ossg&s=1',
 'followers': 25623357,
 'followed_by_viewer': False,
 'following': 6,
 'follows_viewer': False,
 'full_name': 'apple',
 'has_ar_effects': False,
 'has_clips': True,
 'has_guides': False,
 'has_channel': False,
 'has_blocked_viewer': False,
 'highlight_reel_count': 65,
 'has_requested_viewer': False,
 'id': '1187692491',
 'is_business_account': True,
 'is_joined_recently': False,
 'business_category_name': 'Personal Goods & General Merchandise Stores',
 'overall_category_name': None,
 'category_enum': 'PRODUCT_SERVICE',
 **'is_private': True,**
 'is_verified': True,
 'mutual_followers': 11,
 'profile_pic_url': 'https://instagram.fist10-1.fna.fbcdn.net/v/t51.2885-19/s150x150/20635165_1942203892713915_5464937638928580608_a.jpg?tp=1&_nc_ht=instagram.fist10-1.fna.fbcdn.net&_nc_ohc=HiqQD4hS4d0AX_NTWGE&edm=ABfd0MgBAAAA&ccb=7-4&oh=f9aaf2c7ce13f79d2c69211a3241b194&oe=60BDCE24&_nc_sid=7bff83',
 'profile_pic_url_hd': 'https://instagram.fist10-1.fna.fbcdn.net/v/t51.2885-19/s320x320/20635165_1942203892713915_5464937638928580608_a.jpg?tp=1&_nc_ht=instagram.fist10-1.fna.fbcdn.net&_nc_ohc=HiqQD4hS4d0AX_NTWGE&edm=ABfd0MgBAAAA&ccb=7-4&oh=68657cec88e63faf8014396365eb1214&oe=60BBFB5C&_nc_sid=7bff83',
 'requested_by_viewer': False,
 'username': 'apple',
 'connected_fb_page': None,
 'posts': 800}
SakPetios commented 2 years ago

Dude i get the exact oposite problem

i am getting this:

{'logging_page_id': 'profilePage_40975230168', 'show_suggested_profiles': False, 'show_follow_dialog': nan, 'biography': '', 'blocked_by_viewer': False, 'restricted_by_viewer': False, 'country_block': False, 'external_url': None, 'external_url_linkshimmed': None, 'followers': 182, 'followed_by_viewer': False, 'following': 205, 'follows_viewer': False, 'full_name': 'garga', 'has_ar_effects': False, 'has_clips': False, 'has_guides': False, 'has_channel': False, 'has_blocked_viewer': False, 'highlight_reel_count': 0, 'has_requested_viewer': False, 'id': '52632513717', 'is_business_account': False, 'is_joined_recently': True, 'business_category_name': None, 'overall_category_name': None, 'category_enum': None, 'is_private': False, <---------------------------------------------------------- 'is_verified': False, 'mutual_followers': 1, 'profile_pic_url': 'https://instagram.fath5-1.fna.fbcdn.net/v/t51.2885-19/256857767_224455963060548_6558011416242407035_n.jpg?stp=dst-jpg_s150x150&_nc_ht=instagram.fath5-1.fna.fbcdn.net&_nc_cat=100&_nc_ohc=SNQwtv1zF9QAX9IVVF7&edm=ABfd0MgBAAAA&ccb=7-4&oh=00_AT9YjPUQ5veHdZzLqc2RMxIVoQa2fHm_zBEr8uA9SB7XIg&oe=6247E319&_nc_sid=7bff83', 'profile_pic_url_hd': 'https://instagram.fath5-1.fna.fbcdn.net/v/t51.2885-19/256857767_224455963060548_6558011416242407035_n.jpg?stp=dst-jpg_s320x320&_nc_ht=instagram.fath5-1.fna.fbcdn.net&_nc_cat=100&_nc_ohc=SNQwtv1zF9QAX9IVVF7&edm=ABfd0MgBAAAA&ccb=7-4&oh=00_AT8f-6Ki0_f0gXPWBTqe2Jj108i37h__JLaOFrFi84rcnw&oe=6247E319&_nc_sid=7bff83', 'requested_by_viewer': False, 'username': 'garga_chan', 'connected_fb_page': None, 'posts': 6}