Instapy: Image upload by url?

Created on 7 Feb 2018  ·  22Comments  ·  Source: timgrossmann/InstaPy

Is there a possibility to add images to the bot's account by url? Or an upload ability from images in a folder?

feature request

Most helpful comment

@uluQulu @CharlesCCC
I just came back from a 4 days holiday. The script is a success.
Each day was posted some content on my IG account without doing anything. 👍

Here is the code :
https://www.protectedtext.com/insta-auto-post Password instapy.

Before running the script, run these following commands

pip install autoit
pip install pyperclip
pip install schedule

The folder that will contain your jpg pictures and their html comments is located with pathvariable.

Daily Posts Script naming convention

2018-04-28.jpg
2018-04-28.html

It will post a picture the 25th of april 2018.

Hourly Posts Script naming convention

2018-04-28_13-05.jpg
2018-04-28_13-05.html

It will post a picture the 25th of april 2018, at 13h 05min

Of course the script needs improvements and documentation.
For the moment, it's standalone.
I count on you guys (not only @uluQulu and @CharlesCCC) to take the next step: Integration with Instapy. Thanks to this it will be updated and improved beyond even your wildest expectations.

All 22 comments

great idea, but no API for it from Instagram yet. unless you are a marketing partner with Instagram.

There is a possibility. I use unofficial instagram API and upload images periodically

hi @BLCKPSTV
I would say, it is definitely possible for InstaPy by simply adding a few lines of emulation, without touching official or unofficial API
I will try to have a look at it some time...

Hi, anyone have idea if with Selenium it's possible to use 'Mobile mode'?
Because i think if it is possibile, wen can implement the upload!

image

As Alex asked, basically, as I said earlier, chromedriver can emulate some mobile devices natively and also by entering individual device attributes using “mobileEmulation” facility

_for example_, if you wanna emulate some blackberry,
add these 2 lines to your chrome args in instapy.py

mobile_emulation = { "deviceName": "BlackBerry Z30" }
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)

who wanna work on this should add triggers to enable/disable emulation after upload finishes
@CharlesCCC got time to do this?

by the way, it will open up coreSpriteFeedCreation (_the upload button_) in //div[2]/div/div/div[3]/div xpath

Personally, I will not use this feature, and do not recommend _browser uploads_ for any professional page (_compresses a lot during rendering_), but having it as a feature is cool since somebody may want😎 to use...

@uluQulu

Interesting, mobile emulation does bring up the upload button and we can upload images. I am currently using unofficial instagram library to upload images but will switch to this once this feature is complete

@uluQulu Awesome, @ganeshkrishnan1 I was surprisingly found that out. i guess instagram did some detection and then the Chromedrive did a good job emulate device.

I would love to implement this feature if i have the time, i'm currently neck deep into one of my company project. Hopefully when that is over, i can looking into this. If anybody want to go ahead and get this done, feel free, i'm more than love to test it out.

@ValentinMebarki,
I began working on Post Upload Automation. First issue: use chromedriver with mobile viewport I tried what you suggested in #1373, adding this to instapy.py mobile_emulation = { "deviceName": "BlackBerry Z30" } chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) But there is no upload button appearing.
Well, Valentin, it is great that you are working on this feature🎉
If you have applied it properly, then upload button is there, but possibly not _visible_. To make it visible, maximize your window. (_you might need to refresh page for once, too_)
Last time I promised to look into this feature, I checked it and there are some difficulties, if you want to hear more details, write to my personal email (_find in my profile_).

✔I succeeded in running chromedriver as mobile.
✔I succeeded in uploading a picture.
✔I succeeded in posting a picture with a comment.
✔I succeeded in scheduling multiple post at multiple dates.
✔Testing

@uluQulu Thanks. I'll write you an email.

@ValentinMebarki wow, that is awesome, Did you build on top of InstaPy or different repo, is there anyway you can PR or share it ? thank you.

@uluQulu @CharlesCCC
I just came back from a 4 days holiday. The script is a success.
Each day was posted some content on my IG account without doing anything. 👍

Here is the code :
https://www.protectedtext.com/insta-auto-post Password instapy.

Before running the script, run these following commands

pip install autoit
pip install pyperclip
pip install schedule

The folder that will contain your jpg pictures and their html comments is located with pathvariable.

Daily Posts Script naming convention

2018-04-28.jpg
2018-04-28.html

It will post a picture the 25th of april 2018.

Hourly Posts Script naming convention

2018-04-28_13-05.jpg
2018-04-28_13-05.html

It will post a picture the 25th of april 2018, at 13h 05min

Of course the script needs improvements and documentation.
For the moment, it's standalone.
I count on you guys (not only @uluQulu and @CharlesCCC) to take the next step: Integration with Instapy. Thanks to this it will be updated and improved beyond even your wildest expectations.

Tried it but stuck at installing autoit on linux, which is not possible. Anybody has any idea on how to fix this on Linux?

Awesome! @ValentinMebarki now we need to understand how swtich from desktop version to mobile version :confused:
maybe... I think we can do something like this:

import _thread
_thread.start_new_thread( uploadImage, (image="images/img1.png", caption="Hi!", ) )

def uploadImage(image, caption):
    [...]
    [ Load cookies ]
    @ValentinMebarki code.

I'm very excited to implement post scheduling also on my telegram bot! :)

@Tkd-Alex What do you mean by

swtich from desktop version to mobile version

?

@ValentinMebarki InstaPy currently is working on desktop version of Instagram. During like, comment and post I think we need to upload photo and go back to activity.

I spotted an issue with the script:
When it posts with hashtags, it doesn't seem to appear in the corresponding feed. (my #foodporn content doesn't appear in the #foodporn feed).
Before using the script I had 50 likes in 30 minutes. With the script I have 5 likes in 30 minutes.
I bet that only my followers see the content I just posted.

Do you have any feedback guys ? @BLCKPSTV @uluQulu @CharlesCCC

@ValentinMebarki I'm wondering if Instagram has set certain flag from web post to not show up under the "recently post" for the tag.

@CharlesCCC I doubt it. 92% of my posts are web ones. If there was a change, it's a new one. I'll give you an update this evening after a try.

@ganeshkrishnan1 what api do you use to autopost ?

@ghost Instagram is notorious for "shadow-banning" and blacklisting hashtags that don't promote "additive" engagement. This isn't the place to discuss how Instagram's servers / algorithms filter activity and distribute content to users, but if you want to share some more detailed information about your scheduled post we can commune and get to the bottom of it there. Share a link to a discussion thread on a discourse or Reddit post . I personally am working on adding your insta-auto-post feature to my package, but with integration of the new quota_supervisor methods for scheduling. I'd hate to continue further development knowing IG has "shadow-banned" a key benefit of posting from desktops. (perhaps your auto-post are too frequent or as previously stated promote "additive"? If using smart_hashtags check your logs for which hashtags are being generated and cross-compare your content, descriptions, and, engagements, with others from those hashtags)

I ugess we were discussing scheduling uploads and direct message on this thread too https://github.com/timgrossmann/InstaPy/issues/3886
I have proposed using selenium equivalent fromework for mobile apps to do this, which @uluQulu seemed open to explore. Guys let us know your thoughts as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deronsizemore picture deronsizemore  ·  3Comments

harrypython picture harrypython  ·  3Comments

wyvers picture wyvers  ·  3Comments

ghost picture ghost  ·  3Comments

rahulkapoor90 picture rahulkapoor90  ·  3Comments