Giter VIP home page Giter VIP logo

instalooter's Introduction

InstaLooter starme

Not all treasure's silver and gold, mate.

build repo versions format coverage doc grade license keepachangelog saythanks

InstaLooter is a program that can download any picture or video associated from an Instagram profile, without any API access. It can be seen as a re-implementation of the now deprecated InstaRaider developed by @akurtovic.

v1.0.0 was completely rewrote from scratch, and as such, will probably break compatibility with your homemade scripts. Meanwhile, great care was taken to keep the CLI as consistent as possible with the previous versions, so it'll hopefully feel like home.

Requirements

coloredlogs Colored output PyPI coloredlogs Source coloredlogs License coloredlogs
dateutil Date manipulation PyPI dateutil Source dateutil License dateutil
docopt CLI arguments parsing PyPI docopt Source docopt License docopt
fs Filesystem handling PyPI fs Source fs License fs
requests HTTP handling PyPI requests Source requests License requests
six Python 2/3 compatibility PyPI six Source six License six
tenacity Retry until success PyPI tenacity Source tenacity License tenacity
tqdm Dynamic output in CLI PyPI tqdm Source tqdm License tqdm
verboselogs More detailed logs PyPI verboselogs Source verboselogs License verboselogs

Installation

InstaLooter is available on PyPI to install with pip. If you are not familiar with the package management of the Python ecosystem, please see the Installation page of the documentation. Yet, you will probably end up using the following command:

pip install --user instalooter --pre

Usage

instalooter comes with its CLI:

$ instalooter user <username> [<directory>] [options]
$ instalooter hashtag <hashtag> [<directory>] [options]
$ instalooter post <post_token> [<directory>] [options]
$ instalooter batch [<batch_file>]

See instalooter --usage for all possible uses, or instalooter --help for a complete usage guide.

Logging in and out

There are two ways to login on Instagram through instalooter:

  • use the login subcommand (instalooter login) to interactively login using your username and password.
  • give a --username (and, if you want, a --password) argument to any of the download commands.

In both cases, a session cookie will be created in a cache-specific folder. To delete it and close your session on the server, use the logout subcommand.

Examples

Download all pictures from the instagram profile in the current directory:

$ instalooter user instagram

Download the latest 20 pictures or videos tagged with python to /tmp:

$ instalooter hashtag python /tmp -n 20 --get-videos -c MYLOGIN

Download a single post from an url in the ~/Pictures directory:

$ instalooter post "https://www.instagram.com/p/BFB6znLg5s1/" ~/Pictures

Use a configuration file to download from several account using custom parameters (see Batch mode):

$ instalooter batch /path/to/a/config/file.ini

See more on the Usage page of the online documentation.

instalooter's People

Contributors

abysmalbiscuit avatar althonos avatar bmass02 avatar cebolan avatar dependabot-preview[bot] avatar dependabot[bot] avatar dlh avatar gffde3 avatar gitname avatar henning-k avatar hrxn avatar mohamedim avatar mohan3d avatar polyzen avatar pseudosky avatar rlyons avatar st2mz avatar susundberg avatar sutyrin avatar tgandor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

instalooter's Issues

[Crash] KeyError: u'media' when calling get_owner_info

My goal is to get username, thumbnail url and likes count from photos of a given hashtag.
My code used to work fine, the last few days I started to get error:

Using:
for mymedia in looter.medias(with_pbar=False, media_count=50): owner_info = looter.get_owner_info(mymedia["code"]) likes = int(mymedia['likes']['count']) username = owner_info["username"] thumb_url = mymedia["thumbnail_src"].split("?")[0] purl = mymedia['display_src'].split("?")[0]

Now I get:
owner_info = looter.get_owner_info(mymedia["code"])
File "/usr/local/lib/python2.7/dist-packages/instaLooter/core.py", line 353, in get_owner_info
return data['entry_data']['PostPage'][0]['media']['owner']
KeyError: u'media'

[Question] Reuse the API in a Python script

hi, i want to call the instaLooter API on another python script.
can you give me an example?

from instaLooter import InstaLooter, __init__
hashtagDump = "hashtag here"
DownloadPath = "dump location"

InstaLooter(hastag hashtagDump, DownloadPath, -n 10, -T "@{username}---{id}")

give me

InstaLooter(hastag hashtagDump, dump, -n 10, -T "@{username}---{id}")   
                                 ^
SyntaxError: invalid syntax

[Doc] Commenter and Tagged Error

The code examples in the documentation that describe how to get a set of all users that have commented on a profile no longer works. Same goes for getting tagged users. They no longer recognize the keys and return KeyErrors.

image

Issue downloading hashtag with metadata

Hi,

I am trying to download a hashtag with metadata added, but I keep getting the same error related to 'full_name'

my input: instaLooter hashtag fluoxetine ./Data/ --add-metadata -n 200

the output:
...
File "/Library/Python/2.7/site-packages/instaLooter.py", line 96, in _add_metadata
piexif.ImageIFD.Artist: "Image creator, {}".format(self.owner.metadata['full_name']),
KeyError: 'full_name'

[Bug] Hang with UnicodeDecodeError

Hi. Tried to download some photos and this is what I get:

/usr/local/bin/instaLooter instagram_profile Images/downloaded/inst/
Loading pages |N/A%(0 of 43)| |Elapsed Time: 0:00:00 |ETA: --:--:--Traceback (most recent call last):
File "/usr/local/bin/instaLooter", line 11, in
load_entry_point('instaLooter==0.8.2', 'console_scripts', 'instaLooter')()
File "/home/korben/.local/lib/python2.7/site-packages/instaLooter/cli.py", line 137, in main
new_only=args['--new'],
File "/home/korben/.local/lib/python2.7/site-packages/instaLooter/core.py", line 401, in download
new_only=new_only
File "/home/korben/.local/lib/python2.7/site-packages/instaLooter/core.py", line 472, in _fill_media_queue
medias_queued, stop = self._add_media_to_queue(media, condition, media_count, medias_queued, new_only)
File "/home/korben/.local/lib/python2.7/site-packages/instaLooter/core.py", line 484, in _add_media_to_queue
if not os.path.exists(os.path.join(self.directory, media_basename)):
File "/usr/lib/python2.7/posixpath.py", line 78, in join
path += b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Any suggestions?

No medias found

After running the command succesfully for some other hashtags, I get the following output and no media. Now, even for the cases for which it was running correctly, I am unable to download anything else. Am I missing something here ?

python -m instaLooter hashtag muhammadali ~/Desktop/Event_Summarization/TOMM/muhammadali/insta/3rdJune/ --add-metadata --template {id}.{likescount}--{commentscount}--{datetime} --time 2016-06-03:2016-06-03
Loading pages | 0%(488 of 60903)|# |Elapsed Time: 0:06:53 |ETA: 14:13:0313:27:18 - WARNING - No medias found.
Loading pages |N/A%(0 of N/A)|

[Feature request] Downloading photos uploaded after certain date

(Feature request)

Hi althonos, thanks for this useful project. Can we implement a feature which helps us to download images uploaded in a certain timeframe, like in the last week or so, or after a certain date (between dates, etc...)? This can be useful if one is following a popular username, or if one wants to sync local folders with online albums.

[Feature request] give a file as input to download several profiles

Got a mail request requesting to be able to provide instaLooter with a file containing a list of profiles/directories to download files from/into.

Suggested format was JSON, but I think YAML would be easier to edit from an user POV. Easiest would be a YAML list following the exact syntax you'd use if you ran individual jobs. For instance:

- user-we-dont-want-vids-from dir1
- user-we-want-vids-from dir2 --get-videos

Even better, it could be possible to give parameters you'd like to use everywhere (so you'd not have to give them back at each run):

params: 
  -c MYLOGIN --get-videos --add-metadata
jobs:
- user1 dir1
- user2 dir2 -N

[Bug] Error when using -T

instaLooter 0.8.1 | Python 3.6.0 | Windows 7 64
Some images fail to download when using -T

Instalooter instagram -T {username}_{date}_{code} -v -n 50
In my test, it downloaded 40 files.

Example of an error:

Exception in thread Thread-12:
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 522, in _make_filename
assert value is not None
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\worker.py", line 44, in run
self._download_video(media)
File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\worker.py", line 109, in _download_video
video_name = os.path.join(self.directory, self.owner._make_filename(data))
File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 524, in _make_filename
media = self.get_post_info(media['code'])
KeyError: 'code'

Instalooter instagram -v -n 50 downloads 50 as expected.

Problem with regular expression

C:\Users\User\Documents>instaLooter -n franiothepug
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Python27\Scripts\instaLooter.exe_main
.py", line 5, in
File "c:\python27\lib\site-packages\instaLooter.py", line 135
_RX_CSRFTOKEN_JSON = re.compile(rb'"csrf_token": "([a-zA-Z0-9]*)"')
^
SyntaxError: invalid syntax

Even with correct parameters for the command, this error still seems to come up even when specifying the directory

[Feature request] Download Videos only

From my understanding there is still no such option/feature built in to instalooter:
Would it be possible to skip downloading the pictures of a given user or hashhtag but only download the videos? That would be amazing. Something like:

--videos-only or shortly: -vo

Errors after setup

Previously had Instraider working on the machine, had issues after upgrading to newer Firefox and upgraded to Ubuntu 16.04:

~/InstaLooter$ ./instaLooter.py -j 8-v -n 4000 test /home/user1/Pictures/intra/test/
./instaLooter.py: line 3: author: command not found
./instaLooter.py: line 4: author_email: command not found
./instaLooter.py: line 5: version: command not found
from: can't read /var/mail/contextlib
from: can't read /var/mail/bs4
./instaLooter.py: line 25: try:: command not found
./instaLooter.py: line 28: except: command not found
./instaLooter.py: line 29: PIL: command not found
./instaLooter.py: line 31: try:: command not found
./instaLooter.py: line 33: PARSER: command not found
./instaLooter.py: line 34: except: command not found
./instaLooter.py: line 35: PARSER: command not found
./instaLooter.py: line 37: syntax error near unexpected token (' ./instaLooter.py: line 37: class InstaDownloader(threading.Thread):'

How to get random user name, etc?

  1. Is there any way to get random user name or full list of instagram users?
  2. Is there any way to get user subscribers or users that current user subscribed to?
  3. Is there any way to get also photos from other users on those current user is marked?
  4. Is there any way to get list of users from comments of current user?

[Bug] warn_windows raises exception

Reported by @bangaio in #42, traceback:

I found some weird exception in the new version, but I'm not sure what causes it. Seems to happen randomly.

Traceback (most recent call last): File "c:\program files (x86)\python36-32\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\program files (x86)\python36-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files (x86)\Python36-32\Scripts\instaLooter.exe\__main__.py", line 9, in <module> File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\__main__.py", line 130, in main new_only=args['--new'], File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 388, in download new_only=new_only) File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 445, in _fill_media_queue for media in self.medias(media_count=media_count, with_pbar=with_pbar, timeframe=timeframe): File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 286, in _timeless_medias for page in self.pages(media_count=media_count, with_pbar=with_pbar): File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 258, in pages warnings.warn("Profile {} is private, retry after logging in.".format(self.target)) File "c:\program files (x86)\python36-32\lib\warnings.py", line 99, in _showwarnmsg msg.file, msg.line) File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\utils.py", line 64, in warn_windows "{msg}").format(t=time.localtime(), msg=message), file=sys.stderr) NameError: name 'time' is not defined```

Probably caused by a missing import statement.

OriginalDateTime not being written in EXIF metadata?

As I mentioned earlier here, earlier, I was unable to use exif metadata to rename existing downloaded files. Now I can do so, thanks to exiftool, but (and this is one of the reasons why I couldn't get exiftool working earlier) I saw that for all recently downloaded images, the DateTimeOriginal and UserComment (along with some other) tags are missing in the metadata, meaning that they are not being written. Is it a problem with Instagram? I'm curious since the template system works fine. And this problem holds for only recently downloaded images.

Also, could you let me know how video tags are being added? Tags are not added in downloaded videos. That's fine.

Thanks a lot.

Got mistake since yesterday.

It can not work since yesterday night and I tried three accounts, all got same error, hope you can update it.The error message is shown as bellow:

15:41:55 - SUCCESS - Logged in.
Loading pages |N/A%(0 of 4167)| |Elapsed Time: 0:00:00 |ETA: --:--:--Traceback (most recent call last):
File "/Users/channelcryster/anaconda/bin/instaLooter", line 11, in
sys.exit(main())
File "/Users/channelcryster/anaconda/lib/python2.7/site-packages/instaLooter/cli.py", line 137, in main
new_only=args['--new'],
File "/Users/channelcryster/anaconda/lib/python2.7/site-packages/instaLooter/core.py", line 401, in download
new_only=new_only
File "/Users/channelcryster/anaconda/lib/python2.7/site-packages/instaLooter/core.py", line 468, in _fill_media_queue
medias_queued, stop = self._add_media_to_queue(media, condition, media_count, medias_queued, new_only)
File "/Users/channelcryster/anaconda/lib/python2.7/site-packages/instaLooter/core.py", line 479, in _add_media_to_queue
media_basename = self._make_filename(media)
File "/Users/channelcryster/anaconda/lib/python2.7/site-packages/instaLooter/core.py", line 520, in _make_filename
media = self.get_post_info(media['code'])
File "/Users/channelcryster/anaconda/lib/python2.7/site-packages/instaLooter/core.py", line 448, in get_post_info
media = self._get_shared_data(res)['entry_data']['PostPage'][0]['media']
KeyError: u'media'

Wrong post count

When downloading from a username it shows much less post than what the user has, and once downloading finished shows the post count correct and then done.
eg. Total posts 1500
downloading: 0% (0 of 170)
then
downloading: 10% (170 of 170) -> then 1500 of 1500 done

But only 170 downloaded.

[Feature request] Download the full resolution picture

At times some pictures will have something like this /p480x480 in the direct URL so when InstaLooter downloads the picture it's at a slightly lower resolution than it could be. Here is an example

Although it's not always the same number, it is as far as I've seen always in the same location of the URL which is after the /e35 and before /15876204_370847143275022_6186941535674695680_n.jpg

I know the difference in resolution here is very minor but at times it's a bit more extreme. I'm hoping InstaLooter can possibly be made to detect and remove when something like /p480x480 is present. I'd appreciate any responses

[Bug] random crash: 'NoneType' object has no attribute 'text'

This issue happens randomly with Windows; on different profiles. Doesn't happen at all with my linux install.

Loading pages |100%(87 of 87)|##################################################################################|Elapsed Time: 0:01:47 |ETA:  0:00:00
Traceback (most recent call last):

  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)

  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals

  File "C:\Python27\Scripts\instaLooter.exe\__main__.py", line 9, in <module>

  File "c:\python27\lib\site-packages\instaLooter\cli.py", line 130, in main
    new_only=args['--new'],

  File "c:\python27\lib\site-packages\instaLooter\core.py", line 388, in download
    new_only=new_only)

  File "c:\python27\lib\site-packages\instaLooter\core.py", line 451, in _fill_media_queue
    medias_queued, stop = self._add_media_to_queue(media, condition, media_count, medias_queued, new_only)

  File "c:\python27\lib\site-packages\instaLooter\core.py", line 462, in _add_media_to_queue
    media_basename = self._make_filename(media)

  File "c:\python27\lib\site-packages\instaLooter\core.py", line 503, in _make_filename
    media = self.get_post_info(media['code'])

  File "c:\python27\lib\site-packages\instaLooter\core.py", line 431, in get_post_info
    media = self._get_shared_data(res)['entry_data']['PostPage'][0]['media']

  File "c:\python27\lib\site-packages\instaLooter\core.py", line 445, in _get_shared_data
    return json.loads(self._RX_SHARED_DATA.match(script.text).group(1))

AttributeError: 'NoneType' object has no attribute 'text'

[Bug] Cutoff by IG?

After an excellent script to mass download got run, I started getting code errors. Is there a limit to IG connections?

Edit: That was an awful issue submittal. Allow me to elaborate:

I ran this as a script. It parses a .txt file and passes the line items to the instaLooter python script:

#!/bin/bash
a="$(wc -l < /mnt/md0/list.txt)"
((a++))
# echo "$a"
counter=1
while [ $counter -le $a ]
do
	STR="$(head -$counter /mnt/md0/list.txt | tail -1)"
	python -m instaLooter $STR "/mnt/md0/"$STR -v -N -c username:password
	((counter++))

done

Works great for the first few, then starts throwing connection errors:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/__main__.py", line 122, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/__main__.py", line 96, in main
    looter.login(login, password)
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/core.py", line 178, in login
    raise SystemError("Login error: check your connection")
SystemError: Login error: check your connection

[Crash] CLI API crash on non existing user name

When I try to run app via CLI inteface with username that is not exist it gives me an error:

Traceback (most recent call last):
  File "/usr/local/bin/instaLooter", line 9, in <module>
    load_entry_point('instaLooter==0.4.0', 'console_scripts', 'instaLooter')()
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/__main__.py", line 82, in main
    new_only=args['--new'],
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/core.py", line 355, in download
    new_only=new_only)
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/core.py", line 401, in _fill_media_queue
    for media in self.medias(media_count=media_count, with_pbar=with_pbar, timeframe=timeframe):
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/core.py", line 246, in _timeless_medias
    for page in self.pages(media_count=media_count, with_pbar=with_pbar):
  File "/usr/local/lib/python2.7/dist-packages/instaLooter/core.py", line 200, in pages
    media_count = data['entry_data'][self._page_name][0][self._section_name]['media']['count']
KeyError: u'ProfilePage'

maybe better way is to print warning?

p.s. Users frequently change their names, but I guess their internal ID remains unchanged, is there any way to match user names and user ID and get new user name by ID?

new feature - downlo multiple accounts with one login

The idea is that instead of logging in multiple times, you could login once.

format:

username:directory,username2:directory2,username3:directory3

you could test to see if it is a multiple user string by looking for the colon...

internally then,
{account1: directory1, account2: directory2}
and then loop through them....

error: unrecognized arguments: -c

I can't get the login method using the --credentials / -c argument to work. I have used the format instaLooter some_channel folder -c my_username:my_pw but it always throws an error message unrecognized arguments: -c at me. what am I doing wrong here?

[Bug] Hashtag not working without credentials

Hello,

Thanks for this app.

When I use : instaLooter hashtag sunset

I get following error message
12:33:01 - WARNING - Could not find page of user: hashtag
12:33:01 - WARNING - No medias found.

It seems that I cannot get pictures based on a specific hashtag.

Do I do something wrong?

[Bug] Fail to retrieve caption for videos

On most recent version 0.9.3 using a metadata -m switch it fails to retrieve caption attribute and throw errors.

Can be reproduced by this command:
instalooter -v -m awwwwshoot_ob

Traceback (most recent call last):
File "...\lib\threading.py", line 911, in _bootstrap_innerself.run()
File "...\lib\site-packages\instaLooter\worker.py", line 47, in runself._download_photo(media)
File "...\lib\site-packages\instaLooter\worker.py", line 97, in _download_photoself._add_metadata(photo_name, media)
File "...\lib\site-packages\instaLooter\worker.py", line 81, in _add_metadatapiexif.ExifIFD.UserComment: metadata.get('caption', '').encode('utf-8'),
AttributeError: 'NoneType' object has no attribute 'encode'

This part of code (worker.py, line 81) has also brought to light some weird refactoring bug. The idea of the statement was obviously to return '' if there was no caption in metadata dictionary but for some reason the caption key was associated with None value already. It should test it for None and not rely on get method default return value. Or the caption key shouldn't be added to the metadata dictionary (or set to '' ) in _sidecar_to_media method of core.py if no caption was found in media.

[Bug] Time parameter not working?

Python 3.6.0 on Windows 7 x64

>Instalooter nintendo --time 2017-02-05:2017-02-09 -q
←[35m23:14:38←[0m - ←[33mWARNING←[0m - ←[39mNo medias found.←[0m

But thisweek works correctly.

[Bug] Exception when downloading Multi Video Post

An exception is thrown when downloading multi video post

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/site-packages/instaLooter/worker.py", line 44, in run
    self._download_video(media)
  File "/usr/lib/python3.6/site-packages/instaLooter/worker.py", line 120, in _download_video
    video_url = data["video_url"]
KeyError: 'video_url'

[Bug] Script hangs on error

Python 3.6.0 on Windows 7 x64

If the profile name doesn't exist, I get the following error and then the scripts hangs. I have to kill python.exe from the Task Manager.

Traceback (most recent call last):
  File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 229, in pages
    media_info = data['entry_data'][self._page_name][0][self._section_name]['media']
KeyError: 'ProfilePage'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files (x86)\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files (x86)\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python36-32\Scripts\instaLooter.exe\__main__.py", line 9, in <module>
  File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\__main__.py", line 113, in main
    new_only=args['--new'],
  File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 388, in download
    new_only=new_only)
  File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 437, in _fill_media_queue
    for media in self.medias(media_count=media_count, with_pbar=with_pbar, timeframe=timeframe):
  File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 286, in _timeless_medias
    for page in self.pages(media_count=media_count, with_pbar=with_pbar):
  File "c:\program files (x86)\python36-32\lib\site-packages\instaLooter\core.py", line 231, in pages
    warnings.warn("Could not find page of user: {}".format(self.target), stacklevel=1)
  File "c:\program files (x86)\python36-32\lib\warnings.py", line 99, in _showwarnmsg
    msg.file, msg.line)
TypeError: warn_with_hues() takes from 4 to 5 positional arguments but 6 were given

Same issue happens if it's a private profile and credentials aren't entered, and if the time option is given and there's no new pictures to download.

Not sure if this is a problem on my end since I don't have much experience with python. I did try it from an elevated command prompt just in case and the same thing occured.

[Bug] Massive date conversion bug after recent site updates

instaLooter-0.8.2-py2

{date} filename template cause error:

instalooter -v -T {date}_{id} -m ...

File "...\site-packages\instaLooter\core.py", line 48, in
'date': lambda m: datetime.date.fromtimestamp(m['date']) if 'date' in m else None,
TypeError: an integer is required (got type NoneType)

It also throw errors without the {date} template (still download files though):

instalooter -v -T {id} -m

File "...\lib\threading.py", line 911, in _bootstrap_innerself.run()
File "...\lib\site-packages\instaLooter\worker.py", line 46, in runself._download_photo(media)
File "...\lib\site-packages\instaLooter\worker.py", line 94, in _download_photoself._add_metadata(photo_name, media)
File "...\lib\site-packages\instaLooter\worker.py", line 77, in _add_metadatapiexif.ExifIFD.DateTimeOriginal: datetime.datetime.fromtimestamp(metadata['date']).isoformat(),
TypeError: a float is required

[Bug] --new / -N no longer working?

instalooter --version

instaLooter 0.4.0

There doesn't seem to be an option to grab just the new files anymore -N and --new results in instalooter showing usage.

[feature-request] Download hashtag

Hello, thanks for this great project.
Is it possible to modify it to download photos of a given hashtag?
Or better yet, just output the direct urls, usernames, like counts...

[Bug] AttributeError raised when no directory is provided

Traceback (most recent call last):
File "/usr/local/bin/instaLooter", line 11, in
load_entry_point('instaLooter==0.4.0', 'console_scripts', 'instaLooter')()
File "/usr/local/lib/python3.5/dist-packages/instaLooter-0.4.0-py3.5.egg/instaLooter/main.py", line 58, in main
directory=os.path.expanduser(args.get('', os.getcwd())),
File "/usr/lib/python3.5/posixpath.py", line 229, in expanduser
if not path.startswith(tilde):
AttributeError: 'NoneType' object has no attribute 'startswith'

[Feature request] Allow customizing filenames of downloaded files

Great program, works as intended, but i have some feature suggestions.

  1. Integrate Instagram username into filename.
  2. The original upload date is displayed on Instagram. Is there a way to put that date into the images EXIF data? That makes it possible to sort the images on the date it was "taken" (uploaded)

Reg.
JFLarsen

[Bug] Including {datetime} in template on Windows results in OSError

Since the {datetime} template option puts the date and time in the format YYYY-MM-DD hh:mm:ss, any attempt to open a file for writing with that option on Windows will invariably fail because the colon is a reserved character in Windows filenames. Here's an example traceback from a command line invocation run with -T {datetime}:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "c:\python35-32\lib\threading.py", line 914, in _bootstrap_inner
    self.run()
  File "c:\python35-32\lib\site-packages\instaLooter\worker.py", line 41, in run
    self._download_photo(media)
  File "c:\python35-32\lib\site-packages\instaLooter\worker.py", line 85, in _download_photo
    self._dl(photo_url, photo_name)
  File "c:\python35-32\lib\site-packages\instaLooter\worker.py", line 108, in _dl
    with open(dest, 'wb') as dest_file:
OSError: [Errno 22] Invalid argument: '.\\2017-01-12 16:14:41.jpg'

(there are similar exceptions in the other threads)

I did a hacky fix so I could use the program as desired by simply appending .replace(':', '.') to the calls to _make_filename() in worker.py. I've had no issues since, so I'm fairly confident this was the only problem.

I'm a novice, so I'm not quite sure what the proper fix ought to be (adding another template option that explicitly doesn't use colons or changing the current template, detecting the OS and silently swapping the colons for an alternate character, something else entirely).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.