From 610756d3424b4ef1916bff01115a39dc1dcba41a Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Fri, 4 Dec 2020 17:08:42 +0100 Subject: [PATCH 1/3] Improvements to docs/contributing.rst --- .github/ISSUE_TEMPLATE/bug_report.md | 7 +++- .github/ISSUE_TEMPLATE/question.md | 10 ++++-- docs/contributing.rst | 52 +++++++++++++++++++++------- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e2aa9a0..736d45c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -24,4 +24,9 @@ If applicable, add error messages and tracebacks to help explain your problem. **Additional context** Add any other context about the problem here. - + diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 3ee1f53..1b318c2 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -7,6 +7,12 @@ labels: question Your question here... - + + - has a concise and meaningful title, + - is not covered by the documentation: https://instaloader.github.io/, + - is actually related to Instaloader (this is not a Python help forum), + - has not already been answered here or on other sites such as Stack Overflow: https://stackoverflow.com/questions/tagged/instaloader, + - is written in a polite and welcoming tone. +--> diff --git a/docs/contributing.rst b/docs/contributing.rst index f27b70a..074af63 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -11,6 +11,15 @@ Instaloader's development is organized on `GitHub `__, where Issues and Pull Requests are discussed. +Answering Questions +------------------- + +The easiest way to help out is to answer questions. If you are interested in +answering questions regarding Instaloader, good places to start are + +- `Questions tagged 'instaloader' on Stack Overflow `__, +- `Instaloader Issues labeled 'question' `__. + Reporting Bugs -------------- @@ -41,22 +50,39 @@ reporting a problem, please keep the following in mind: Writing Code or Improving the Documentation ------------------------------------------- -Changes of the Instaloader source can be proposed as a -`Pull Request `__. There are only -few things to consider: +Improvements of the Instaloader source or its documentation can be proposed as a +`Pull Request `__. -- Base your Pull Request on the ``master`` branch if it fixes a bug, - or the ``upcoming/v4.X`` branch (if it exists at the moment of submitting the PR) - otherwise. +- Please base your Pull Request on -- We use `Pylint `__ for error and syntax checking of - the source and `MyPy `__ for type checking. - Beware that sometimes it might be better to disable a warning rather than - adapting the code to a tool's desires. + - ``master``, which will be released with the next minor release, if it is -- The documentation source is located in the ``docs`` folder. The file - ``cli-options.rst`` is merely an RST-formatted copy of ``instaloader --help`` - output, of which the source is in ``instaloader/__main__.py``. + - a bug fix that does not require extensive testing, + - an improvement to the documentation, + + - ``upcoming/v4.X``, if it is + + - a new feature, + - a bug fix that does require thorough testing before being released to a + final version. + +- All Pull Requests are analyzed by `Pylint `__ for + error and syntax checking of the source and + `Mypy `__ for type checking. You can run them + locally with:: + + pylint instaloader + mypy -m instaloader + +- Improvements to the documentation are very welcome. The documentation is + created with `Sphinx `__, version 2, + and can be build locally using:: + + make -C docs html + +- Feel free to create an issue to make sure someone from the Instaloader team + agrees that the change might be an improvement, and is happy with your basic + proposal, before working on a pull request. Proposing Features ------------------ From dcc7ab89c18a58b810ea7a519b0754abc3cabb74 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Sun, 6 Dec 2020 08:43:04 +0100 Subject: [PATCH 2/3] 615_import_firefox_session.py: Open database with immutable=1 Allows to open the firefox cookie database even though Firefox is holding a lock. Fixes the "Cookie import failed: database is locked" message when using the script while Firefox was running. This has been reported in #877. --- docs/codesnippets/615_import_firefox_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codesnippets/615_import_firefox_session.py b/docs/codesnippets/615_import_firefox_session.py index d0c05a4..bfa1e8d 100644 --- a/docs/codesnippets/615_import_firefox_session.py +++ b/docs/codesnippets/615_import_firefox_session.py @@ -23,7 +23,7 @@ def get_cookiefile(): def import_session(cookiefile, sessionfile): print("Using cookies from {}.".format(cookiefile)) - conn = connect(cookiefile) + conn = connect(f"file:{cookiefile}?immutable=1", uri=True) try: cookie_data = conn.execute( "SELECT name, value FROM moz_cookies WHERE baseDomain='instagram.com'" From ed55ce140df608b972419b3fb351560aba299f3a Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Sat, 12 Dec 2020 16:49:38 +0100 Subject: [PATCH 3/3] Fix efficiency bug in download_profiles() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes efficiency of the download_profiles() function when called with --no-posts --no-profile-pic by reordering an if statement. This inefficiency has been reported in #724. Co-authored-by: André Koch-Kramer --- instaloader/instaloader.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/instaloader/instaloader.py b/instaloader/instaloader.py index 6022d3e..d89b37a 100644 --- a/instaloader/instaloader.py +++ b/instaloader/instaloader.py @@ -1129,10 +1129,13 @@ class Instaloader: self.save_metadata_json(json_filename, profile) # Catch some errors - if profile.is_private and (tagged or igtv or highlights or posts): - if not self.context.is_logged_in: + if tagged or igtv or highlights or posts: + if (not self.context.is_logged_in and + profile.is_private): raise LoginRequiredException("--login=USERNAME required.") - if not profile.followed_by_viewer and self.context.username != profile.username: + if (self.context.username != profile.username and + profile.is_private and + not profile.followed_by_viewer): raise PrivateProfileNotFollowedException("Private but not followed.") # Download tagged, if requested