mirror of
https://github.com/instaloader/instaloader.git
synced 2026-10-16 21:52:17 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf2f4f16ed | ||
|
|
1a3712d112 | ||
|
|
65462b01ec | ||
|
|
9857c5fa24 | ||
|
|
83f013f6ca | ||
|
|
e7437310ea | ||
|
|
dcba25a40e |
@@ -1,7 +1,7 @@
|
||||
"""Download pictures (or videos) along with their captions and other metadata from Instagram."""
|
||||
|
||||
|
||||
__version__ = '4.4b1'
|
||||
__version__ = '4.4.2'
|
||||
|
||||
|
||||
try:
|
||||
|
||||
@@ -143,7 +143,7 @@ def _main(instaloader: Instaloader, targetlist: List[str],
|
||||
for followee in profile.get_followees():
|
||||
instaloader.save_profile_id(followee)
|
||||
profiles.add(followee)
|
||||
elif re.match(r"^#[A-Za-z0-9]+$", target):
|
||||
elif re.match(r"^#\w+$", target):
|
||||
instaloader.download_hashtag(hashtag=target[1:], max_count=max_count, fast_update=fast_update,
|
||||
post_filter=post_filter,
|
||||
profile_pic=download_profile_pic, posts=download_posts)
|
||||
|
||||
@@ -215,8 +215,11 @@ class InstaloaderContext:
|
||||
session.headers.update({'X-CSRFToken': csrf_token})
|
||||
# Not using self.get_json() here, because we need to access csrftoken cookie
|
||||
self.do_sleep()
|
||||
# Workaround credits to pgrimaud.
|
||||
# See: https://github.com/pgrimaud/instagram-user-feed/commit/96ad4cf54d1ad331b337f325c73e664999a6d066
|
||||
enc_password = '#PWD_INSTAGRAM_BROWSER:0:{}:{}'.format(int(datetime.now().timestamp()), passwd)
|
||||
login = session.post('https://www.instagram.com/accounts/login/ajax/',
|
||||
data={'password': passwd, 'username': user}, allow_redirects=True)
|
||||
data={'enc_password': enc_password, 'username': user}, allow_redirects=True)
|
||||
try:
|
||||
resp_json = login.json()
|
||||
except json.decoder.JSONDecodeError:
|
||||
|
||||
@@ -654,6 +654,16 @@ class Profile:
|
||||
def external_url(self) -> Optional[str]:
|
||||
return self._metadata('external_url')
|
||||
|
||||
@property
|
||||
def is_business_account(self) -> bool:
|
||||
""".. versionadded:: 4.4"""
|
||||
return self._metadata('is_business_account')
|
||||
|
||||
@property
|
||||
def business_category_name(self) -> str:
|
||||
""".. versionadded:: 4.4"""
|
||||
return self._metadata('business_category_name')
|
||||
|
||||
@property
|
||||
def biography(self) -> str:
|
||||
return self._metadata('biography')
|
||||
|
||||
Reference in New Issue
Block a user