Fixes wrong "Profile does not exist" error.
Co-authored-by: André Koch-Kramer <koch-kramer@web.de>
Co-authored-by: Alexander Graf <17130992+aandergr@users.noreply.github.com>
Adds a method Profile.own_profile() which uses the test_login() query for
obtaining the own profile. This method is used for accesssing saved posts
(Profile.get_saved_posts() on own profile).
Also removes the now-unneeded self._obtain_metadata() call in
Profile.get_saved_posts(), and changes the NodeIterator such that data is never
None and the count property is more likely available.
Fixes #563.
With this change, Instaloader is capable of resuming a previously-aborted download loop. To do so, it creates a JSON file within the target directory when interrupted, that contains all the necessary information to later resume that operation.
Resuming an interrupted download is supported for most, but not all targets. It is supported for:
- Regular profile posts,
- IGTV posts
- Saved posts,
- Tagged posts,
- Explore posts.
* Bypass IP-based redirects to /accounts/login
There are two main changes made:
For users, we request /{username}/feed/ instead of /{username}/. For some
reason, this completely bypasses the login redirect. This page doesn't
work in browser while blocked, but fortunately all the data we need is
just present in the HTML page.
For posts, we change from using the /p/ page to using the graphql
endpoint for the same data, which is still subject to graphql rate
limits, but is not subject to login redirects. The data is identical
between the two pages, apart from the object keys being sorted
differently and rhx_gis being missing on graphql.
Yes, this now unblocks access from VPNs, Tor, cloud servers, etc.
* Apply requested patch to fix comments
* Remove rhx_gis from Post and Profile
Co-authored-by: Alexander Graf <17130992+aandergr@users.noreply.github.com>
Move InstaloaderContext's rate controlling logic into a class
RateController with fine-grained methods to enable easily changing
Instaloader's behavior regarding rate limits.
Such as for downloading hashtag feeds, as discussed in #666 and contributed by
@e2tovar.
Also change comment color to grey in codesnippets in documentation.
Rather than checking the json file to make sure posts have been
successfully downloaded, data is stored in a temporary file which
is renamed when downloading has finished, as suggested in #257.
Use os.path.join() for joining paths rather than +'/'+.
os.path.join() uses '/' on Unix-ish and '\' on Windows. On Windows, this makes
the following improvements:
- Visual consistency with / and \ not being mixed-up in one path (os.path.join()
has already been used in many places).
- Allow using the \\?\ bypass method, e.g. with
--dirname-pattern=\\?\D:\{target}
The \\?\ bypass method fails when '/' is used as path separator. With the \\?\
bypass method, we can create directories whose name would otherwise be
considered invalid, such as directories starting with "aux.".