From 01506224fca4e7f7ccfce701f6299851df63f21a Mon Sep 17 00:00:00 2001 From: Matthcw Date: Thu, 30 May 2019 18:39:31 +0100 Subject: [PATCH 1/3] login is NOT required on media_likers endpoint --- instagram_web_api/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instagram_web_api/client.py b/instagram_web_api/client.py index 0a2eaf27..90b1b302 100644 --- a/instagram_web_api/client.py +++ b/instagram_web_api/client.py @@ -591,8 +591,7 @@ def media_comments(self, short_code, **kwargs): return [c['node'] for c in info.get('data', {}).get('shortcode_media', {}).get( 'edge_media_to_comment', {}).get('edges', [])] return info - - @login_required + def media_likers(self, short_code, **kwargs): """ Get media likers From a71c7163130152967c1821c849ab74cf0e42e7ca Mon Sep 17 00:00:00 2001 From: Matthcw Date: Thu, 30 May 2019 18:53:09 +0100 Subject: [PATCH 2/3] login is NOT required on media_likers endpoint And removed whitespace causing Travis CI test to fail --- instagram_web_api/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instagram_web_api/client.py b/instagram_web_api/client.py index 90b1b302..3bd6b49c 100644 --- a/instagram_web_api/client.py +++ b/instagram_web_api/client.py @@ -591,7 +591,7 @@ def media_comments(self, short_code, **kwargs): return [c['node'] for c in info.get('data', {}).get('shortcode_media', {}).get( 'edge_media_to_comment', {}).get('edges', [])] return info - + def media_likers(self, short_code, **kwargs): """ Get media likers From 96649371d612763407d6c5db0ffb10171eb41dbf Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 31 May 2019 15:25:08 +0000 Subject: [PATCH 3/3] initial commit w/ rhx error error --- instagram_web_api/client.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/instagram_web_api/client.py b/instagram_web_api/client.py index 3bd6b49c..476d8e85 100644 --- a/instagram_web_api/client.py +++ b/instagram_web_api/client.py @@ -307,13 +307,18 @@ def _sanitise_media_id(media_id): media_id = media_id.split('_')[0] return media_id + # @staticmethod + # def _extract_rhx_gis(html): + # mobj = re.search( + # r'"rhx_gis":"(?P[a-f0-9]{32})"', html, re.MULTILINE) + # if mobj: + # return mobj.group('rhx_gis') + # return None + @staticmethod def _extract_rhx_gis(html): - mobj = re.search( - r'"rhx_gis":"(?P[a-f0-9]{32})"', html, re.MULTILINE) - if mobj: - return mobj.group('rhx_gis') - return None + tmp_str = ':{"id":"'+f'{random.randint(10000000,99999999)}'+'"}' + return hashlib.md5(b'tmp_str') @staticmethod def _extract_csrftoken(html):