mirror of
https://github.com/instaloader/instaloader.git
synced 2026-10-16 21:52:17 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ae7b23939 | ||
|
|
9dc7456edb | ||
|
|
12d34143c2 |
+2
-10
@@ -83,7 +83,7 @@ may specify the following targets:
|
||||
|
||||
- ``:feed``: Your **feed** (requires ``--login``),
|
||||
|
||||
- ``@profile``: All profiles which are followed by ``profile``, i.e. the
|
||||
- ``@profile``: All profiles that are followed by ``profile``, i.e. the
|
||||
*followees* of ``profile`` (requires ``--login``).
|
||||
|
||||
Instaloader goes through all media matching the specified targets and
|
||||
@@ -332,7 +332,7 @@ a certain source.
|
||||
|
||||
for post in loader.get_hashtag_posts('cat'):
|
||||
# post is an instance of instaloader.Post
|
||||
self.download_post(post, target='#cat')
|
||||
loader.download_post(post, target='#cat')
|
||||
|
||||
Each Instagram profile has its own unique ID which stays unmodified even
|
||||
if a user changes his/her username. To get said ID, given the profile's
|
||||
@@ -342,14 +342,6 @@ name, you may call
|
||||
|
||||
loader.get_id_by_username(PROFILE_NAME)
|
||||
|
||||
``get_followees()`` also returns unique IDs for all loaded followees. To
|
||||
get the current username of a profile, given this unique ID
|
||||
``get_username_by_id()`` can be used. For example:
|
||||
|
||||
.. code:: python
|
||||
|
||||
loader.get_username_by_id(loader.get_followees()[0]['id'])
|
||||
|
||||
.. as-module-intro-end
|
||||
|
||||
Refer to the
|
||||
|
||||
+5
-5
@@ -29,7 +29,7 @@ import requests.utils
|
||||
import urllib3
|
||||
|
||||
|
||||
__version__ = '3.0rc1'
|
||||
__version__ = '3.0'
|
||||
|
||||
|
||||
try:
|
||||
@@ -277,13 +277,13 @@ class Post:
|
||||
|
||||
@property
|
||||
def caption_hashtags(self) -> List[str]:
|
||||
"""List of all hashtags (without preceeding #) which occur in the Post's caption."""
|
||||
"""List of all lowercased hashtags (without preceeding #) that occur in the Post's caption."""
|
||||
if not self.caption:
|
||||
return []
|
||||
# This regular expression is from jStassen, adjusted to use Python's \w to support Unicode
|
||||
# http://blog.jstassen.com/2016/03/code-regex-for-instagram-username-and-hashtags/
|
||||
hashtag_regex = re.compile(r"(?:#)(\w(?:(?:\w|(?:\.(?!\.))){0,28}(?:\w))?)")
|
||||
return re.findall(hashtag_regex, self.caption)
|
||||
return re.findall(hashtag_regex, self.caption.lower())
|
||||
|
||||
@property
|
||||
def is_video(self) -> bool:
|
||||
@@ -461,7 +461,7 @@ class Instaloader:
|
||||
session: Optional[requests.Session] = None, tries: int = 3) -> Dict[str, Any]:
|
||||
"""JSON request to Instagram.
|
||||
|
||||
:param url: URL, relative to https://www.instagram.com/
|
||||
:param url: URL, relative to www.instagram.com/
|
||||
:param params: GET parameters
|
||||
:param session: Session to use, or None to use self.session
|
||||
:param tries: Maximum number of attempts until an exception is raised
|
||||
@@ -770,7 +770,7 @@ class Instaloader:
|
||||
|
||||
If filename is None, the file with the default session path is loaded.
|
||||
|
||||
:raises FileNotFoundError; If the file does not exist.
|
||||
:raises FileNotFoundError: If the file does not exist.
|
||||
"""
|
||||
if filename is None:
|
||||
filename = get_default_session_filename(username)
|
||||
|
||||
Reference in New Issue
Block a user