37 Commits

Author SHA1 Message Date
Alexander Graf
0aa1ec7c76 Getting locations now requires --login
Closes #376.
2019-08-18 10:48:46 +02:00
Alexander Graf
1e89ebe038 Adjust GraphQL rate control 2019-02-16 19:26:58 +01:00
Alexander Graf
26e74bad6a Download HD profile picture if logged in
Unfortunately, it is now required to be logged in to access the HD version of
profile pictures. When attempting to download profile pictures without --login,
a warning message is printed once, and the lower-quality versions are obtained.

For backwards compatibility, already-downloaded profile pictures are
overwritten if the now-obtainable version is assumed to be of better quality
than the existing one (determined by file size vs Content-Length).

The iPhone endpoint is accessed with code exhumed from
c355338010a2a94c8a75f3001d0ea879b4f42383. Also, this reverts "Profile: don't
access removed iphone info endpoint" 08327c41172e125a003b7bb6a015b04c4645ef27.

This fixes #209.
2019-01-17 17:39:29 +01:00
André Koch-Kramer
4ee867c61b Implement two-factor authentication
Closes #200.
2018-12-21 21:58:12 +01:00
Stijn Peeters
be5d02ef3b Location search (#212)
* Add %location search option

Search for posts for a given location ID using %[location id] as the query

* Document %location search

* Make pylint happy

* Use correct paths for location results

* Fix —help output

Add description of location argument and fix output error for short help.

* Add unit tests for location download

* Add extra unit test for locations
2018-12-17 21:35:31 +01:00
André Koch-Kramer
6212d22e26 Merge branch 'master' of https://github.com/sushilicious/instaloader into v4.2-dev 2018-12-13 15:53:06 +01:00
sushilicious
30555b576c Added commit mode
The commit mode ensures pictures are not corrupted when Instaloader is
unexpectedly interrupted. In the case that the last picture is corrupted
because of an interruption, Instaloader will redownload the picture.
Since the metadata is the last object saved to disk, we can consider a
post as "committed" if its json metadata file exists and is not
malformed. Instaloader should download any posts which are not
committed. Downside is commit mode requires metadata to be saved.
2018-12-09 02:12:45 -05:00
Alexander Graf
b443cc6654 Minor doc fixes and improvements 2018-08-24 11:53:14 +02:00
André Koch-Kramer
cbdd85ef07 Highlights downloadable through CLI
By using --highlights all available highlight stories of target profiles
will get downloaded.
Closes #162.
2018-08-23 23:17:48 +02:00
Alexander Graf
e388a1c966 --no-posts; Deprecate --{profile-pic,stories}-only 2018-08-20 16:29:14 +02:00
Alexander Graf
0f0ac13d72 reorder --help output 2018-08-20 14:27:58 +02:00
Alexander Graf
06b7edd6d5 --no-pictures flag to not download post pictures
Closes #131.
2018-08-20 14:27:58 +02:00
Alexander Graf
5f57345f1b "instaloader -- -SHORTCODE" to fetch single post
Closes #129.
2018-08-20 14:27:58 +02:00
AndCycle
9258b84695 Allow reading arguments from file
Squashed commit of the following (pr #161):

commit 58235a99b04a975d825f4f8f8431a6dcb7acccdc
Author: AndCycle <andcycle@andcycle.idv.tw>
Date:   Thu Aug 16 17:57:26 2018 +0800

    doc: proper fix rst syntax

commit 6620e3583c0b59e9447bcc44e5f573c61d02e6de
Author: AndCycle <andcycle@andcycle.idv.tw>
Date:   Thu Aug 16 17:29:25 2018 +0800

    doc: fix syntax

commit 7a048a3c0440ad900917eb865b72dcfb348da879
Author: AndCycle <andcycle@andcycle.idv.tw>
Date:   Thu Aug 16 17:09:26 2018 +0800

    doc: add info about read args from file.

commit c4ceaf96365422f25357c54af03aadfa7222ce44
Author: AndCycle <andcycle@andcycle.idv.tw>
Date:   Thu Aug 16 17:05:07 2018 +0800

    alter `fromfile_prefix_chars` to plus sign to avoid conflict.

commit d469b52b95de6bf86761b9315a78ecda2b033ac2
Author: AndCycle <andcycle@andcycle.idv.tw>
Date:   Mon Aug 6 19:10:23 2018 +0800

    * Allow reading arguments from file

    function referenced from instagram-scraper,
    which provide a convenient way to hide sensitive information.
2018-08-20 09:00:51 +02:00
Lars Lindqvist
e00d77c234 Basic CLI support for tagged posts.
Squashed commit of the following (pr #154):

commit 8fd56c379ff89ff634b510df8abde5a9c50218f0
Merge: 08f0ee7 a3777ca
Author: Lars Lindqvist <e5150@users.noreply.github.com>
Date:   Wed Aug 15 20:23:23 2018 +0200

    Merge branch 'master' into master

commit 08f0ee795c2273b09056031253781776c5c93bf4
Merge: 700b3a8 dcea0e9
Author: Lars Lindqvist <e5150@users.noreply.github.com>
Date:   Sun Aug 5 15:25:55 2018 +0200

    Merge branch 'master' into master

commit 700b3a8d094f552caa638a9d91f9221392a8e3f0
Author: Lars Lindqvist <lars.lindqvist@yandex.ru>
Date:   Sat Aug 4 16:26:59 2018 +0200

    Basic CLI support for tagged posts.

commit 5e3cd10cbcbec6d29abd6a56ab9c39294a8d44b3
Merge: af564f5 92653dc
Author: Lars Lindqvist <e5150@users.noreply.github.com>
Date:   Fri Aug 3 19:33:24 2018 +0200

    Merge branch 'master' into master

commit af564f5174d1ffd3af3f7e635b650651e1f7411a
Author: Lars Lindqvist <e5150@users.noreply.github.com>
Date:   Fri Aug 3 19:25:57 2018 +0200

    Fix owner_profile for Profile.get_tagged_posts()

commit 3cde1f7db4860edaca970c70543ed5bca0f97853
Author: Lars Lindqvist <e5150@users.noreply.github.com>
Date:   Thu Jul 26 19:51:33 2018 +0200

    Add meth:get_tagged_posts to Profile
2018-08-20 08:50:29 +02:00
Alexander Graf
a3777cad5d Download profile pic unless --no-profile-pic
Fixes #165.

To download (S = Stories, P = Profile Pic, p = Posts)

p	--no-profile-pic
P	--profile-pic-only
Pp	(default)
S	--no-profile-pic --stories-only
Sp	--no-profile-pic --stories
SP	--stories-only
SPp	--stories
2018-08-13 17:57:28 +02:00
Alexander Graf
c634f21dcc Fix anon-retry for profiles that blocked viewer
This was broken with 50a5330fecb1272487fdd600416354c83ef8922f.
2018-08-05 09:01:22 +02:00
André Koch-Kramer
50a5330fec Change download of stories when not using :stories
If using --stories or --stories-only the stories got donwloaded along
with the profiles one by one. Now, the stories get downloaded in a
similar aproach like when using the :stories target, i.e.
download_stories() gets only called once.
Profile.has_highlight_reels is broken and now always returns true.
This fixes #153.
2018-08-02 16:20:27 +02:00
Alexander Graf
52eb6d8e27 Fix minor issues regarding last commit
- Close session from InstaloaderContext.anonymous_copy().

- Have graphql_count_per_slidingwindow default value in one place rather than
  three.
2018-05-14 10:27:34 +02:00
André Koch-Kramer
e1228501d2 Set graphql_count_per_slidingwindow to 20
Instagram tightened their rate limits again.
Implemented hidden switch --graphql-rate-limit for easier adjustment of
graphql_count_per_slidingwindow.
Fixes #118
2018-05-13 19:09:40 +02:00
Alexander Graf
fa06e90e09 Fix anonymous retry logic 2018-05-08 19:12:42 +02:00
Alexander Graf
e7decba5ee main: Enumerate profiles separated with ' ' in log 2018-05-02 17:27:46 +02:00
Alexander Graf
7c76202f1c Update documentation regarding v4 changes
as-module.rst: List how Post and Profile is created

Describe new filename specification logic

Update filter-posts section
2018-04-29 13:33:25 +02:00
Alexander Graf
5036cc7b44 main: Ignore profile JSON files as target
It might annoy or be undesired when using Instaloader with a globbed
JSON file list, i.e. instaloader profile/*.json to just update all post
metadata.
2018-04-29 11:22:56 +02:00
Alexander Graf
8a8ea2913c Improve post/storyitem-metadata-txt behavior
If an expression evaluates to None, an empty string is yielded, rather
than 'None'.

Blanks (and newlines) are strip()ed from the formatted strings, which
also avoids creation of whitespace-only textfiles.

save_captions parameter to Instaloader constructor has been removed, as
it is equivalent to setting both {post,storyitem}_metadata_txt_pattern
to '' (empty string).

Instaloader.save_caption() now prints the '[{old}] updated [{new}]' if
the caption was updated, rather than printing the new caption twice,
which was confusing.
2018-04-29 11:17:48 +02:00
Alexander Graf
57ce51d4ef Support datetime objects in filter strings
Now --only-if="date_utc<datetime(2018,1,1,hour=12)" is possible.
2018-04-19 15:42:26 +02:00
Alexander Graf
7d2830b8b2 Have --storyitem-filter (--only-if for StoryItems) 2018-04-19 15:12:05 +02:00
Alexander Graf
2d9acd9989 Slightly improve error handling
Use raise from rather than raise where appropriate

Have a logic to reduce graphql page length if 400 Bad Request is
returned
2018-04-18 15:58:45 +02:00
Alexander Graf
066c3de113 get_followe{e,r}s yield Profiles rather than dicts 2018-04-17 15:11:50 +02:00
Alexander Graf
59152214cf Allow specification of what to write in txt files 2018-04-13 22:54:40 +02:00
Alexander Graf
df1cdb5d48 Remove now-unneeded Tristate 2018-04-13 19:07:23 +02:00
Alexander Graf
8ab7d3398f Rename Instaloader.download_story{,item}
It makes more sense since the object is called StoryItem.
2018-04-12 22:04:06 +02:00
Alexander Graf
f0bebd0d96 Saving and reimporting of JSON files
Metadata JSON files are now created by default. They can later be given
as a target to redownload Posts, StoryItems or Profiles with new
settings.
2018-04-12 22:03:02 +02:00
Alexander Graf
9b3014d5bf Fix anonymous GraphQL queries
Port of 73ec884ea49cf099570b6b2dd4c6f1f751ae4b96 to v4-dev.
2018-04-11 21:24:36 +02:00
Alexander Graf
25b8165547 Various minor fixes
* Fix Post.owner_profile in cases where initial owner struct contains id
  only

* Assert node structure is complete enough at Post creation

* Fix get_followees() call in _main()

* Prefer importing from '.' rather than '.<submodule>' in __main__

* Fix name of instaloader_unittests ('-' is illegal in module names)

* Foreport 5fe2a70374b6e81dc875ad33bf44f1001a4f2fc0
  "Fix downloading of hashtags"

* Foreport 67ac8f339716c498cddb2f1489eac6104409646c
  "Enforce being logged in for getting username by id"
2018-04-11 10:49:03 +02:00
Alexander Graf
c7f6cff15a basename(argv[0]) instead of argv[0] in usage str 2018-04-06 17:40:33 +02:00
Alexander Graf
c71be83f43 Split module into multiple files 2018-04-06 17:40:22 +02:00