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

Allow media_likers endpoint without login #177

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions instagram_web_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<rhx_gis>[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<rhx_gis>[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):
Expand Down Expand Up @@ -592,7 +597,6 @@ def media_comments(self, short_code, **kwargs):
'edge_media_to_comment', {}).get('edges', [])]
return info

@login_required
def media_likers(self, short_code, **kwargs):
"""
Get media likers
Expand Down