* 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.".
- Keep documentation in sync with master branch
- Run PyLint and MyPy on Github Actions
- Update Issue templates, enforce usage of issue templates, add links to
resources in Instaloader Documentation
- Update contributing.rst
If logged-in, Post.url and Post.get_sidecar_nodes() now use the iPhone API
endpoint to obtain the highest-resolution image version. Resolves #630.
A notice "Warning: Use --login to download higher-quality versions of pictures"
is issued if the user tries to download posts without being logged-in.
Further, the message "Errors occurred:", which is displayed when the
InstaloaderContext is closed, has been changed to "Errors or warnings
occurred:".
The presence of a sessionfile avoids the usage of the failure-prone login
mechanism. This commit addresses a suggestion in #615 to store the sessionfile
in a persistent path rather than a path within a temporary directory if no
--sessionfile parameter is given.
The default path is now:
$XDG_CONFIG_HOME/instaloader/session-USERNAME or
~/.config/instaloader/session-USERNAME on Unix,
%LOCALAPPDATA%\Instaloader\session-USERNAME on Windows.
If no file exists in the new path, Instaloader tries loading from the path
where the sessionfile was stored before this commit, hence it automatically
migrates to the new sessionfile path.
Only substitute characters from auto generated fields in _PostPathFormatter
This fixes issues of path problem on Windows such as #304, #529, etc.
Also made the following changes:
1. Changes substitution of colon to full-width colon (U+FF1A) instead of MODIFIER LETTER COLON (U+A789) to be consistent with others (we use full-width backslash, pipe, etc. already).
2. Also replaces `\r` on Windows with space, just like `\n`.
Without passing re.ASCII, \w matches non-ascii letter, such as ö, π
and я, which to my knowledge isn't allowed in usernames. Now it's
explicit which character ranges are expected in each target.