1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-11-09 03:42:31 +01:00

Targets :feed-all and :feed-liked to load feed

Closes #14.
This commit is contained in:
Alexander Graf 2016-09-17 20:51:17 +02:00
parent 9cd93c9414
commit 70c91e000e
2 changed files with 20 additions and 2 deletions

View File

@ -38,6 +38,11 @@ If you want to **download all followees of a given profile**, call
./instaloader.py --login=your_username @profile ./instaloader.py --login=your_username @profile
``` ```
To **download all the pictures which you have liked**, call
```
./instaloader.py --login=your_username :feed-liked
```
The `--quiet` option makes it also **suitable as a cron job**. The `--quiet` option makes it also **suitable as a cron job**.
To get a list of other helpful flags, run `./instaloader.py --help`. To get a list of other helpful flags, run `./instaloader.py --help`.

View File

@ -563,6 +563,17 @@ def download_profiles(profilelist, username=None, password=None, sessionfile=Non
log("Retrieving followees of %s..." % pentry[1:], quiet=quiet) log("Retrieving followees of %s..." % pentry[1:], quiet=quiet)
followees = get_followees(pentry[1:], session) followees = get_followees(pentry[1:], session)
targets.update([followee['username'] for followee in followees]) targets.update([followee['username'] for followee in followees])
elif pentry == ":feed-all" and username is not None:
log("Retrieving pictures from your feed...", quiet=quiet)
download_feed_pics(session, fast_update=fast_update,
download_videos=download_videos, shorter_output=shorter_output,
sleep=sleep, quiet=quiet)
elif pentry == ":feed-liked" and username is not None:
log("Retrieving pictures you liked from your feed...", quiet=quiet)
download_feed_pics(session, fast_update=fast_update,
filter_func=lambda node: not node["likes"]["viewer_has_liked"],
download_videos=download_videos, shorter_output=shorter_output,
sleep=sleep, quiet=quiet)
else: else:
targets.add(pentry) targets.add(pentry)
if len(targets) == 0: if len(targets) == 0:
@ -590,8 +601,10 @@ def main():
parser = ArgumentParser(description='Simple downloader to fetch all Instagram pics and '\ parser = ArgumentParser(description='Simple downloader to fetch all Instagram pics and '\
'captions from a given profile') 'captions from a given profile')
parser.add_argument('profile', nargs='*', parser.add_argument('profile', nargs='*',
help='Name of profile to download, or @<profile> to download all followees of '\ help='Name of profile to download; @<profile> to download all followees of '
'<profile>') '<profile>; or the special targets :feed-all or :feed-liked to '
'download pictures from your feed if --login is given (using '
'--fast-update is recommended).')
parser.add_argument('--version', action='version', parser.add_argument('--version', action='version',
version='1.0.1') version='1.0.1')
parser.add_argument('-l', '--login', metavar='YOUR-USERNAME', parser.add_argument('-l', '--login', metavar='YOUR-USERNAME',