Git Product home page Git Product logo

instacron's Introduction

instacron Instagram for the lazy

Automatically upload a photo to Instagram

Takes a random photo from the folder photos and adds a caption with a random quote. For example:

Just as treasures are uncovered from the earth, so virtue appears from good deeds, and wisdom appears from a pure and peaceful mind. To walk safely through the maze of human life, one needs the light of wisdom and the guidance of virtue. 🌬🌱 Taken in Colombia, Villavieja πŸ‡¨πŸ‡΄ on 13 January 2016. #instacron 🐍 instacron.nijho.lt

Luck is what happens when preparation meets opportunity. ⚽🚌 Taken in Colombia, Cali πŸ‡¨πŸ‡΄ on 25 October 2015. #instacron 🐍 instacron.nijho.lt

I think and that is all that I am. πŸ’”πŸ€· Taken in Peru, Cusco πŸ‡΅πŸ‡ͺ on 21 November 2015. #instacron 🐍 instacron.nijho.lt

When all photos in the photos folder have been uploaded, it starts to upload the least frequently uploaded photos first.

Why does this exist?

I like to take pictures that I would like to share with the world but I am way too lazy to upload them using the app.

Installation

You need Pythonβ‰₯3.6

Clone the repo with

git clone [email protected]:basnijholt/instacron.git

and install the requirements with

cd instacron
pip install -r requirements.txt

Usage

  • Put photos in photos (see the expected filename structuce here.)
  • run python instacron.py and follow the instructions to have it set up a config file.

Alternatively setup a cronjob to periodically post a photo, see cronjob.py for instructions.

Troubleshooting

See the FAQ: Understanding Responses from Instagram in the mgp25/Instagram-API repository for information about the error codes the Instagram API might return.

instacron's People

Contributors

basnijholt avatar sbalk avatar

Stargazers

 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

instacron's Issues

Upload caption from .txt

Hey I love your work. I wanted to upload pictures and caption to be retreated from a .txt file
For instance upload random picture with name xxx.jpg get caption from file name xxx.txt
then next random pic is xxz.jpg and next caption get from xxz.txt

You get what I am saying? Thanks would love if you could help me

Adding new photos when all have been posted gives problems

Adding a new photo to the folder when all photos have been uploaded several times leads to consecutive reposts of the new picture.

This can be fixed by requiring a minimal time after which the image is reposted. This can easily be done by looking at uploaded.txt which is ordered.

extract more from exif data

Wow, your tool was exactly what I was working for!

I only miss 2 features, please tell me that you can add those πŸ‘

  • extract date from EXIF data, like this no need to define date manually in the filename
  • extract GPS position from EXIF data and get place via google places API, like this no need to define in the filename.

If this would work that filename would not be relevant anymore.

Thanks

challenge_required

Hello, im trying to use it but im getting this error

Request return 400 error!
{u'status': u'fail', u'message': u'challenge_required', u'error_type': u'checkpoint_challenge_required', u'challenge': {u'api_path': u'/challenge///', u'native_flow': True, u'url': u'https://i.instagram.com/challenge///', u'lock': True, u'logout': False, u'hide_webview_header': True}}

KeyError: 'urlgen' when rerunning instacron

I have to delete config folder every time to circumvent this error. Python 3.8, no warnings for urllib3 or other packages. Console output:

Traceback (most recent call last):
File "instacron.py", line 390, in
main()
File "instacron.py", line 375, in main
bot.login(**read_config())
File "/home/$USER/.local/lib/python3.8/site-packages/instabot/bot/bot.py", line 443, in login
if self.api.login(**args) is False:
File "/home/$USER/.local/lib/python3.8/site-packages/instabot/api/api.py", line 240, in login
self.load_uuid_and_cookie(load_cookie=use_cookie, load_uuid=use_uuid)
File "/home/$USER/.local/lib/python3.8/site-packages/instabot/api/api.py", line 199, in load_uuid_and_cookie
return load_uuid_and_cookie(self, load_uuid=load_uuid, load_cookie=load_cookie)
File "/home/$USER/.local/lib/python3.8/site-packages/instabot/api/api_login.py", line 354, in load_uuid_and_cookie
self.cookie_dict["urlgen"]
KeyError: 'urlgen'

pic upload

can I set the bot to automatically repost best pics from selected profiles ?

Duplicated infos

Hi,

All the infos are printing duplicated in my screen. For example:
" 2018-12-13 00:08:59,811 - INFO - Instabot Started
2018-12-13 00:08:59,811 INFO Instabot Started "

How can I fix that?

Key error 'image make'

Hello I got this error while trying to run Instagram.py

root@host:~/instacron# python3.6 instacron.py
Didn't find a matching template.
Getting info from EXIF data.
Traceback (most recent call last):
  File "instacron.py", line 155, in get_photo_info
    raise Exception("Didn't find a matching template.")
Exception: Didn't find a matching template.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "instacron.py", line 374, in <module>
    main()
  File "instacron.py", line 353, in main
    caption += get_caption(photo)
  File "instacron.py", line 207, in get_caption
    city, country, date = get_photo_info(fname)
  File "instacron.py", line 159, in get_photo_info
    return get_info_from_exif(photo)
  File "instacron.py", line 139, in get_info_from_exif
    date = dateutil.parser.parse(tags['Image DateTime'].printable)
KeyError: 'Image DateTime'
root@host:~/instacron# python3.6 instacron.py
Traceback (most recent call last):
  File "instacron.py", line 374, in <module>
    main()
  File "instacron.py", line 353, in main
    caption += get_caption(photo)
  File "instacron.py", line 220, in get_caption
    caption += spacer + get_camera_settings(fname) + spacer
  File "instacron.py", line 195, in get_camera_settings
    brand = tags['Image Make'].printable
KeyError: 'Image Make'
root@host:~/instacron# python3.6 instacron.py
Traceback (most recent call last):
  File "instacron.py", line 374, in <module>
    main()
  File "instacron.py", line 353, in main
    caption += get_caption(photo)
  File "instacron.py", line 220, in get_caption
    caption += spacer + get_camera_settings(fname) + spacer
  File "instacron.py", line 195, in get_camera_settings
    brand = tags['Image Make'].printable
KeyError: 'Image Make'

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.