instalooter.looters
)¶Instagram looters implementations.
instalooter.looters.
InstaLooter
(add_metadata=False, get_videos=False, videos_only=False, jobs=16, template='{id}', dump_json=False, dump_only=False, extended_dump=False, session=None)[source]¶Bases: object
A brutal Instagram looter that raids without API tokens.
Create a new looter instance.
Parameters: |
|
---|
download
(destination, condition=None, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)[source]¶Download all medias passing condition
to destination.
Parameters: |
|
---|---|
Returns: | the number of queued medias. May not be equal to the number of downloaded medias if some errors occurred during background download. |
Return type: |
download_pictures
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)[source]¶Download all the pictures to the provided destination.
Actually a shortcut for download
with condition
set
to accept only images.
download_videos
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)[source]¶Download all videos to the provided destination.
Actually a shortcut for download
with condition
set
to accept only videos.
get_post_info
(code)[source]¶Get media information from a given post code.
Parameters: | code (str) – the code of the post (can be obtained either
from the shortcode attribute of media dictionaries, or
from a post URL: https://www.instagram.com/p/<code>/ ) |
---|---|
Returns: | a media dictionaries, in the format used by Instagram. |
Return type: | dict |
medias
(timeframe=None)[source]¶Obtain an iterator over the Instagram medias.
Wraps the iterator returned by InstaLooter.pages
to seamlessly
iterate over the medias of all the pages.
Returns: | an iterator over the medias in every pages. |
---|---|
Return type: | MediasIterator |
pages
()[source]¶Obtain an iterator over Instagram post pages.
Returns: | an iterator over the instagram post pages. |
---|---|
Return type: | PageIterator |
instalooter.looters.
ProfileLooter
(username, **kwargs)[source]¶Bases: instalooter.looters.InstaLooter
A looter targeting medias on a user profile.
Create a new profile looter.
Parameters: | username (str) – the username of the profile. |
---|
See InstaLooter.__init__
for more details about accepted
keyword arguments.
download
(destination, condition=None, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all medias passing condition
to destination.
Parameters: |
|
---|---|
Returns: | the number of queued medias. May not be equal to the number of downloaded medias if some errors occurred during background download. |
Return type: |
download_pictures
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all the pictures to the provided destination.
Actually a shortcut for download
with condition
set
to accept only images.
download_videos
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all videos to the provided destination.
Actually a shortcut for download
with condition
set
to accept only videos.
get_post_info
(code)¶Get media information from a given post code.
Parameters: | code (str) – the code of the post (can be obtained either
from the shortcode attribute of media dictionaries, or
from a post URL: https://www.instagram.com/p/<code>/ ) |
---|---|
Returns: | a media dictionaries, in the format used by Instagram. |
Return type: | dict |
logged_in
()¶Check if there’s an open Instagram session.
login
(username, password)¶Log the instance in using the given credentials.
Parameters: |
---|
logout
()¶Log the instance out from the currently opened session.
medias
(timeframe=None)¶Obtain an iterator over the Instagram medias.
Wraps the iterator returned by InstaLooter.pages
to seamlessly
iterate over the medias of all the pages.
Returns: | an iterator over the medias in every pages. |
---|---|
Return type: | MediasIterator |
pages
()[source]¶Obtain an iterator over Instagram post pages.
Returns: | an iterator over the instagram post pages. |
---|---|
Return type: | |
Raises: |
|
instalooter.looters.
HashtagLooter
(hashtag, **kwargs)[source]¶Bases: instalooter.looters.InstaLooter
A looter targeting medias tagged with a hashtag.
Create a new hashtag looter.
Parameters: | username (str) – the hashtag to search for. |
---|
See InstaLooter.__init__
for more details about accepted
keyword arguments.
download
(destination, condition=None, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all medias passing condition
to destination.
Parameters: |
|
---|---|
Returns: | the number of queued medias. May not be equal to the number of downloaded medias if some errors occurred during background download. |
Return type: |
download_pictures
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all the pictures to the provided destination.
Actually a shortcut for download
with condition
set
to accept only images.
download_videos
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all videos to the provided destination.
Actually a shortcut for download
with condition
set
to accept only videos.
get_post_info
(code)¶Get media information from a given post code.
Parameters: | code (str) – the code of the post (can be obtained either
from the shortcode attribute of media dictionaries, or
from a post URL: https://www.instagram.com/p/<code>/ ) |
---|---|
Returns: | a media dictionaries, in the format used by Instagram. |
Return type: | dict |
logged_in
()¶Check if there’s an open Instagram session.
login
(username, password)¶Log the instance in using the given credentials.
Parameters: |
---|
logout
()¶Log the instance out from the currently opened session.
medias
(timeframe=None)¶Obtain an iterator over the Instagram medias.
Wraps the iterator returned by InstaLooter.pages
to seamlessly
iterate over the medias of all the pages.
Returns: | an iterator over the medias in every pages. |
---|---|
Return type: | MediasIterator |
pages
()[source]¶Obtain an iterator over Instagram post pages.
Returns: | an iterator over the instagram post pages. |
---|---|
Return type: | PageIterator |
instalooter.looters.
PostLooter
(code, **kwargs)[source]¶Bases: instalooter.looters.InstaLooter
A looter targeting a specific post.
Create a new hashtag looter.
Parameters: | code (str) – the code of the post to get. |
---|
See InstaLooter.__init__
for more details about accepted
keyword arguments.
download
(destination, condition=None, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)[source]¶Download the refered post to the destination.
See InstaLooter.download
for argument reference.
Note
This function, opposed to other looter implementations, will not spawn new threads, but simply use the main thread to download the files.
Since a worker is in charge of downloading a media at a time (and not a file), there would be no point in spawning more.
download_pictures
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all the pictures to the provided destination.
Actually a shortcut for download
with condition
set
to accept only images.
download_videos
(destination, media_count=None, timeframe=None, new_only=False, pgpbar_cls=None, dlpbar_cls=None)¶Download all videos to the provided destination.
Actually a shortcut for download
with condition
set
to accept only videos.
get_post_info
(code)¶Get media information from a given post code.
Parameters: | code (str) – the code of the post (can be obtained either
from the shortcode attribute of media dictionaries, or
from a post URL: https://www.instagram.com/p/<code>/ ) |
---|---|
Returns: | a media dictionaries, in the format used by Instagram. |
Return type: | dict |
logged_in
()¶Check if there’s an open Instagram session.
login
(username, password)¶Log the instance in using the given credentials.
Parameters: |
---|
logout
()¶Log the instance out from the currently opened session.
medias
(timeframe=None)[source]¶Return a generator that yields only the refered post.
Yields: | dict – a media dictionary obtained from the given post. |
---|---|
Raises: | StopIteration – if the post does not fit the timeframe. |