Igbot: Like hashtags DEBUG - <Response [200]> but not doing it

Created on 10 Jan 2020  Β·  62Comments  Β·  Source: ohld/igbot

Hello after providing my credentials correctly I get:
INFO - Logged-in successfully as 'xxxxxxx'

Then it gathers the hashtags and starts liking them and i get:
DEBUG -

If I check from Instagram the post that I liked recently there is no new content being liked at all.

91%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 78/86 [14:10<01:26, 10.84s/it]2020-01-10 17:11:04,664 - DEBUG - 2020-01-10 17:11:04,972 - DEBUG - 2020-01-10 17:11:05,279 - DEBUG - 92%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 79/86 [14:21<01:16, 10.89s/it]2020-01-10 17:11:15,622 - DEBUG - 2020-01-10 17:11:15,929 - DEBUG - 2020-01-10 17:11:16,237 - DEBUG - 93%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž| 80/86 [14:32<01:05, 10.91s/it]2020-01-10 17:11:26,511 - DEBUG - 2020-01-10 17:11:26,767 - DEBUG - 2020-01-10 17:11:27,002 - DEBUG - 94%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–| 81/86 [14:43<00:54, 10.86s/it]2020-01-10 17:11:37,331 - DEBUG - 2020-01-10 17:11:37,640 - DEBUG - 2020-01-10 17:11:37,945 - DEBUG - 95%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ| 82/86 [14:54<00:43, 10.89s/it]2020-01-10 17:11:48,494 - DEBUG - 2020-01-10 17:11:48,905 - DEBUG - 2020-01-10 17:11:49,311 - DEBUG - 97%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹| 83/86 [15:05<00:33, 11.03s/it]2020-01-10 17:11:59,610 - DEBUG - 2020-01-10 17:11:59,963 - DEBUG - 2020-01-10 17:12:00,269 - DEBUG - 98%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š| 84/86 [15:16<00:22, 11.01s/it]2020-01-10 17:12:10,612 - DEBUG - 2020-01-10 17:12:11,022 - DEBUG - 2020-01-10 17:12:11,328 - DEBUG - 99%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰| 85/86 [15:27<00:11, 11.02s/it]2020-01-10 17:12:21,672 - DEBUG - 2020-01-10 17:12:21,961 - DEBUG - 2020-01-10 17:12:22,288 - DEBUG - 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 86/86 [15:38<00:00, 10.91s/it]
2020-01-10 17:12:32,332 - INFO - DONE: Total liked 0 medias.
2020-01-10 17:12:32,335 - INFO - Total requests: 416

bug more information needed

Most helpful comment

@jhumms can you run the development branch? There is a better log options to debug this issue.

All 62 comments

Hey @fabriziospadaro,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job :smile:

If not, the maintainers will get to this issue shortly.

Cheers,
Your Friendly Neighborhood ProBot

Actually it says exactly that in your log:

INFO - DONE: Total liked 0 medias.
The 200 request is probably a get request for the media before it should like medias (post requests). Actually we could improve debug logging for requests here, but I'm wondering why you don't see info/warning/error about why nothing is liked... Strange

PR #1223 will provide better debug logging. As soon as it is merged you should try again.

I'm actually getting this issue too. It never likes the photos

image

There is a new update, please run that and report back what the message is. Thanks

up +

What do you mean? Did you run the newer version and did you get the exact same error ?

nope still the same exact error

Can you confirm that you have downloaded the new version and post the script in correct Markup you're using and including the error ?

same problem .. i have updated the bot too
ok so this error is only in hashtag option ..everything else is working fine

Actually there are still no logs from the new version. The new version logs which rest route gives the 200 response code. We need this to investigate further, please provide at least 15 log lines from your execution with the newest bot version (and don't say "same error")

The .txt log file has no info in it .. So i copy pasted it from cmd
`
2020-01-16 20:11:46,294 - INFO - Going to like media with hashtag #pewdiepie.
Getting hashtag media.: 0it [00:00, ?it/s]2020-01-16 20:11:50,708 - DEBUG - 2020-01-16 20:11:51,421 - DEBUG - 2020-01-16 20:11:51,427 - INFO - Going to like 79 medias.
0%| | 0/79 [00:00 2020-01-16 20:11:54,706 - DEBUG - 2020-01-16 20:11:55,208 - DEBUG - 1%|β–ˆ | 1/79 [00:13<17:55, 13.78s/it]2020-01-16 20:12:30,577 - DEBUG - 2020-01-16 20:12:31,108 - DEBUG - 2020-01-16 20:12:31,457 - DEBUG - 3%|β–ˆβ–ˆ | 2/79 [00:50<26:20, 20.52s/it]2020-01-16 20:13:29,623 - DEBUG - 2020-01-16 20:13:30,543 - DEBUG - 2020-01-16 20:13:30,993 - DEBUG - 4%|β–ˆβ–ˆβ–ˆβ– | 3/79 [01:49<40:49, 32.23s/it]2020-01-16 20:14:39,289 - DEBUG - 2020-01-16 20:14:40,737 - DEBUG - 2020-01-16 20:14:41,200 - DEBUG - 5%|β–ˆβ–ˆβ–ˆβ–ˆβ– | 4/79 [02:59<54:31, 43.62s/it]2020-01-16 20:15:46,018 - DEBUG - 2020-01-16 20:15:46,532 - DEBUG - 2020-01-16 20:15:47,243 - DEBUG - 6%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 5/79 [04:05<1:02:05, 50.35s/it]2020-01-16 20:16:21,548 - DEBUG - 2020-01-16 20:16:21,964 - DEBUG - 2020-01-16 20:16:22,330 - DEBUG - 8%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž | 6/79 [04:40<55:41, 45.77s/it]2020-01-16 20:16:50,812 - DEBUG - 2020-01-16 20:16:51,762 - DEBUG - 2020-01-16 20:16:52,265 - DEBUG - 9%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž | 7/79 [05:10<49:13, 41.02s/it]2020-01-16 20:18:00,290 - DEBUG - 2020-01-16 20:18:03,437 - DEBUG - 2020-01-16 20:18:03,946 - DEBUG -

Blacklist hashtag found in media, skipping!
10%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 8/79 [06:22<59:25, 50.22s/it]2020-01-16 20:18:28,732 - DEBUG - 2020-01-16 20:18:29,182 - DEBUG - 2020-01-16 20:18:29,953 - DEBUG - 11%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 9/79 [06:48<50:06, 42.95s/it]2020-01-16 20:19:22,565 - DEBUG - 2020-01-16 20:19:22,947 - DEBUG - 2020-01-16 20:19:23,295 - DEBUG - 13%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 10/79 [07:41<52:58, 46.07s/it]2020-01-16 20:19:59,036 - DEBUG - 2020-01-16 20:19:59,411 - DEBUG - 2020-01-16 20:19:59,879 - DEBUG - 14%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 11/79 [08:18<48:59, 43.23s/it]2020-01-16 20:21:02,119 - DEBUG - 2020-01-16 20:21:02,526 - DEBUG - 2020-01-16 20:21:02,876 - DEBUG - 15%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 12/79 [09:21<54:53, 49.15s/it]2020-01-16 20:22:09,738 - DEBUG - 2020-01-16 20:22:10,320 - DEBUG - 2020-01-16 20:22:10,659 - DEBUG - 16%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 13/79 [10:29<1:00:13, 54.74s/it]2020-01-16 20:23:19,915 - DEBUG - 2020-01-16 20:23:20,478 - DEBUG - 2020-01-16 20:23:20,806 - DEBUG - 18%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 14/79 [11:39<1:04:18, 59.37s/it]2020-01-16 20:24:08,841 - DEBUG - 2020-01-16 20:24:09,247 - DEBUG - 2020-01-16 20:24:09,591 - DEBUG - 19%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 15/79 [12:28<59:56, 56.19s/it]2020-01-16 20:25:19,132 - DEBUG - 2020-01-16 20:25:19,678 - DEBUG - 2020-01-16 20:25:20,022 - DEBUG - 20%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 16/79 [13:38<1:03:29, 60.46s/it]2020-01-16 20:26:18,798 - DEBUG - 2020-01-16 20:26:19,158 - DEBUG - 2020-01-16 20:26:19,486 - DEBUG - 22%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 17/79 [14:38<1:02:10, 60.16s/it]2020-01-16 20:27:24,072 - DEBUG - 2020-01-16 20:27:24,447 - DEBUG - 2020-01-16 20:27:24,791 - DEBUG - 23%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ– | 18/79 [15:43<1:02:44, 61.71s/it]2020-01-16 20:27:53,542 - DEBUG - 2020-01-16 20:27:53,917 - DEBUG - 2020-01-16 20:27:54,261 - DEBUG - 24%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹ | 19/79 [16:12<52:02, 52.04s/it]2020-01-16 20:29:00,289 - DEBUG - 2020-01-16 20:29:00,833 - DEBUG - 2020-01-16 20:29:01,193 - DEBUG - 25%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 20/79 [17:19<55:33, 56.50s/it]2020-01-16 20:29:34,848 - DEBUG - 2020-01-16 20:29:35,231 - DEBUG - 2020-01-16 20:29:35,591 - DEBUG - 27%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 21/79 [17:54<48:12, 49.87s/it]2020-01-16 20:30:41,181 - DEBUG - 2020-01-16 20:30:41,762 - DEBUG - 2020-01-16 20:30:42,105 - DEBUG - 28%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 22/79 [19:00<52:07, 54.86s/it]
```

What is the output from
pip3 show instabot
Or
pip show instabot
? (More specifically: what is the version?)

Name: instabot
Version: 0.104.0
Summary: Instagram bot scripts for promotion and API python wrapper.
Home-page: https://github.com/instagrambot/instabot
Author: Daniil Okhlopkov, Evgeny Kemerov
Author-email: [email protected], [email protected]
License: Apache Software License 2.0
Location: c:users.....\local\programs\python\python38\lib\site-packages
Requires: tqdm, requests, requests-toolbelt, schedule, pysocks, responses, future, six, huepy, pytz
Required-by:

Super strange why there is still the old output even if you have the latest version and the extended logging is part of that code...

Edit: did you check out the github repo by yourself to use the examples? Examples/like_hashtags.py modifies sys.path to import the bot from this location where the example is run (not the pip installed location!) If so - is this folder up-to-date to the current master branch?

@Abdulsamipy please see my edited post

i have reinstalled the instabot-mater.zip(just to make sure everything is up-to-date) and tried to run the bot (Example/multi_script_CLI.py)... ..still the same problem

I'm having the same issue and I reinstalled it as well. I tried it on both the Like_Example.py and the Ultimate.py example scripts, the like from hashtag isn't working in either.

Yeah, i believe you that it doesn't work. But for analysis it is crucial that we have the extended logging to figure out what exactly does not work (or does not return the infos we need)...
Unfortunately I can't try it out by myself at the moment, I have to rely on someone providing logging to make at least a guess what's not working exactly.

is this enough info?

It's not the amount of failing media likes (1 or 2 will be enough), it's the content of your debug output! This does not contain the newest information. Instead of

2020-01-17 20:49:30,950 - DEBUG - <Response [200]>

There has to be something like

2020-01-17 20:49:30,950 - DEBUG - GET Request to endpoint: /example returned: <Response [200]>

so i looked into all log files and can't seem to find anything like

DEBUG - GET Request to endpoint: /example returned: <Response [200]>

Here's from my log, I let it run for a few hours.

2020-01-16 19:48:16,783 - INFO - LOGIN FLOW! Just logged-in: False
2020-01-16 19:48:21,701 - INFO - Logged-in successfully as '******!
2020-01-16 19:48:21,702 - INFO - ULTIMATE script. Safe to run 24/7!
2020-01-16 20:48:21,879 - INFO - Going to like media with hashtag #like4like.
2020-01-16 20:48:22,277 - INFO - Stats saved at 2020-01-16 20:48:22.
2020-01-16 20:48:25,037 - INFO - Going to like 29 medias.
2020-01-16 20:52:35,207 - ERROR - Request returns 400 error!
2020-01-16 20:52:35,209 - INFO - Instagram's error message: Media not found or unavailable
2020-01-16 20:52:35,210 - INFO - Instagram's error message: {}
2020-01-16 21:02:11,528 - ERROR - Request returns 400 error!

so i updated the files and its still the same not liking photos by hashtags
bot Example/multi_script_CLI.py

Name: instabot
Version: 0.105.0
Summary: Instagram bot scripts for promotion and API python wrapper.
Home-page: https://github.com/instagrambot/instabot
Author: Daniil Okhlopkov, Evgeny Kemerov
Author-email: [email protected], [email protected]
License: Apache Software License 2.0
Location: c:users\lenovoappdata\local\programs\python\python38\lib\site-packages
Requires: tqdm, requests, requests-toolbelt, schedule, pysocks, responses, future, six, huepy, pytz
Required-by:

log:


2020-01-20 18:21:28,358 - INFO - Going to like 68 medias.
0%| | 0/68 [00:00 2020-01-20 18:21:29,083 - DEBUG - GET to endpoint: media/2225551819367289294_27780149617/info/ returned response: 2020-01-20 18:21:29,450 - DEBUG - GET to endpoint: media/2225551819367289294_27780149617/comments/ returned response: 1%|β–ˆβ–‰ | 1/68 [00:11<12:23, 11.10s/it]2020-01-20 18:21:40,162 - DEBUG - GET to endpoint: media/2225551783446733573_11941534388/info/ returned response: 2020-01-20 18:21:40,776 - DEBUG - GET to endpoint: media/2225551783446733573_11941534388/info/ returned response: 2020-01-20 18:21:41,287 - DEBUG - GET to endpoint: media/2225551783446733573_11941534388/comments/ returned response: 3%|β–ˆβ–ˆβ–ˆβ–Š | 2/68 [00:22<12:27, 11.32s/it]2020-01-20 18:21:52,142 - DEBUG - GET to endpoint: media/2225551470249841273_22441164564/info/ returned response: 2020-01-20 18:21:52,856 - DEBUG - GET to endpoint: media/2225551470249841273_22441164564/info/ returned response: 2020-01-20 18:21:53,627 - DEBUG - GET to endpoint: media/2225551470249841273_22441164564/comments/ returned response: 4%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š | 3/68 [00:35<12:35, 11.63s/it]2020-01-20 18:22:04,328 - DEBUG - GET to endpoint: media/2225551411521252818_11941534388/info/ returned response: 2020-01-20 18:22:05,250 - DEBUG - GET to endpoint: media/2225551411521252818_11941534388/info/ returned response: 2020-01-20 18:22:05,681 - DEBUG - GET to endpoint: media/2225551411521252818_11941534388/comments/ returned response:

Any update on the fix? @fighterii

@jhumms can you run the development branch? There is a better log options to debug this issue.

Will do, I'll have the results soon.

I think I've found the solution, change this line
sys.path.append(os.path.join(sys.path[0], "../")) to sys.path.insert(0,os.path.join(sys.path[0], "../")).

I've raised this issue https://github.com/instagrambot/instabot/issues/1240.

I have the full logs now !

so i tried to run ultimate.py .. it'snot liking the post either

here's the log file
instabot_1716914682752.log

@Abdulsamipy that was the one I was running. Which, @fighterii I have the results, but the error log doesn't seem to be much more detailed than the last:
2020-01-21 15:26:52,369 - INFO - Going to like 29 medias.
2020-01-21 15:29:54,409 - ERROR - Request returns 400 error!
2020-01-21 15:29:54,412 - INFO - Instagram's error message: Media not found or unavailable
2020-01-21 15:29:54,414 - INFO - Instagram's error message: {}
2020-01-21 15:37:32,465 - ERROR - Request returns 400 error!
2020-01-21 15:37:32,469 - INFO - Instagram's error message: Media not found or unavailable
2020-01-21 15:37:32,470 - INFO - Instagram's error message: {}
2020-01-21 15:40:55,217 - INFO - DONE: Total liked 0 medias.
2020-01-21 16:26:47,963 - INFO - Going to like media with hashtag #cat.
2020-01-21 16:26:48,611 - INFO - Stats saved at 2020-01-21 16:26:48.
2020-01-21 16:26:53,018 - INFO - Going to like 29 medias.
2020-01-21 16:39:41,527 - INFO - DONE: Total liked 0 medias.

hi, guys so i was running the script and today i got a new issue hope this will help figure out the problem
bot: Multiscript
Objective: Like by hashtags

Capture

i am not a expert ..but instagram has changed its HTML ..instapy was able to solve like and comment issue by replacing the path

any update?

Still working on it see Dev branch

I think check_media() is the problem.
If set the parameter check_media = False in` bot.like ', it will work.

check_media

so i edited check_media () in bot_like and to "false" in both def like_medias and def like( still not liking the media by hashtag

I think check_media () is the problem.
If set the parameter check_media = False in` bot.like ', it will work.

I suspect self.api.media_info(media_id) in check_media().

I think check_media () is the problem.
If set the parameter check_media = False in` bot.like ', it will work.

I suspect self.api.media_info(media_id) in check_media().

Capture
im in bot_like.py .. is this it??

I tested like this and it works fine.

hashtag_medias = self.bot.get_total_hashtag_medias(hashtag,  amount=90, filtration=False)
hashtag_id = self.hashtag_id(hashtag)
feed_position = 0

for media in hashtag_medias:
    try:
        self.likeBy(feed_position, hashtag, hashtag_id, media)
     except Exception as error:
         print(error)
    finally:
                feed_position += 1

def likeBy(self, hashtag, hashtag_id, media):
    like_result = False
    if self.bot.reached_limit("likes"):
        return like_result

    like_result = self.bot.like(
        media,
        check_media=False,
        container_module='feed_contextual_hashtag',
        feed_position=feed_position,
        hashtag_name=hashtag,
        hashtag_id=hashtag_id
    )
    print("like action: {}".format(like_result))

    return like_result

def hashtag_id(self, hashtag):
    hashtag_id = None
    if self.bot.api.search_tags(hashtag):
        for tag in self.bot.api.last_json["results"]:
            if tag["name"] == hashtag:
                hashtag_id = tag["id"]
                return hashtag_id
        else:
            self.bot.logger.error(
                "Hashtag ID of {} not found within api response".format(
                    hashtag)
            )
            self.bot.logger.debug(
                "Last JSON results: {}".format(
                    self.bot.api.last_json["results"])
            )
            return hashtag_id

I tested like this and it works fine.

hashtag_medias = self.bot.get_total_hashtag_medias(hashtag,  amount=90, filtration=False)
hashtag_id = self.hashtag_id(hashtag)
feed_position = 0

for media in hashtag_medias:
    try:
        self.likeBy(feed_position, hashtag, hashtag_id, media)
     except Exception as error:
         print(error)
    finally:
                feed_position += 1

def likeBy(self, hashtag, hashtag_id, media):
    like_result = False
    if self.bot.reached_limit("likes"):
        return like_result

    like_result = self.bot.like(
        media,
        check_media=False,
        container_module='feed_contextual_hashtag',
        feed_position=feed_position,
        hashtag_name=hashtag,
        hashtag_id=hashtag_id
    )
    print("like action: {}".format(like_result))

    return like_result

def hashtag_id(self, hashtag):
    hashtag_id = None
    if self.bot.api.search_tags(hashtag):
        for tag in self.bot.api.last_json["results"]:
            if tag["name"] == hashtag:
                hashtag_id = tag["id"]
                return hashtag_id
        else:
            self.bot.logger.error(
                "Hashtag ID of {} not found within api response".format(
                    hashtag)
            )
            self.bot.logger.debug(
                "Last JSON results: {}".format(
                    self.bot.api.last_json["results"])
            )
            return hashtag_id

pardon me ... can you tell me from which file you copied this set of code. .. cause i can't seem to find the code inside bot_like.py

you can check here:
https://github.com/instagrambot/instabot/blob/master/instabot/bot/bot_like.py

I tested like this and it works fine.

hashtag_medias = self.bot.get_total_hashtag_medias(hashtag,  amount=90, filtration=False)
hashtag_id = self.hashtag_id(hashtag)
feed_position = 0

for media in hashtag_medias:
    try:
        self.likeBy(feed_position, hashtag, hashtag_id, media)
     except Exception as error:
         print(error)
    finally:
                feed_position += 1

def likeBy(self, hashtag, hashtag_id, media):
    like_result = False
    if self.bot.reached_limit("likes"):
        return like_result

    like_result = self.bot.like(
        media,
        check_media=False,
        container_module='feed_contextual_hashtag',
        feed_position=feed_position,
        hashtag_name=hashtag,
        hashtag_id=hashtag_id
    )
    print("like action: {}".format(like_result))

    return like_result

def hashtag_id(self, hashtag):
    hashtag_id = None
    if self.bot.api.search_tags(hashtag):
        for tag in self.bot.api.last_json["results"]:
            if tag["name"] == hashtag:
                hashtag_id = tag["id"]
                return hashtag_id
        else:
            self.bot.logger.error(
                "Hashtag ID of {} not found within api response".format(
                    hashtag)
            )
            self.bot.logger.debug(
                "Last JSON results: {}".format(
                    self.bot.api.last_json["results"])
            )
            return hashtag_id

pardon me ... can you tell me from which file you copied this set of code. .. cause i can't seem to find the code inside bot_like.py

you can check here:
https://github.com/instagrambot/instabot/blob/master/instabot/bot/bot_like.py

oh! sorry this code is in my custom class

oh! sorry this code is in my custom class

oh .. is it possible for you to update this custom class to dev branch?

oh! sorry this code is in my custom class

oh .. is it possible for you to update this custom class to dev branch?

I am writing test code for you right now.

oh! sorry this code is in my custom class

oh .. is it possible for you to update this custom class to dev branch?

@Abdulsamipy please try this
https://gist.github.com/ElonPark/43df4fe7df78b0cc013b654cefd2a60c

`2020-01-27 17:29:48,521 - DEBUG - GET to endpoint: tags/search/?is_typeahead=true&q=cat&rank_token=27194590479_6cfe777e-001d-4d67-aa62-352e1e261efb returned response: likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given

likeBy() takes 4 positional arguments but 5 were given
2020-01-27 17:29:48,687 - INFO - Total requests: 31`

`2020-01-27 17:29:48,521 - DEBUG - GET to endpoint: tags/search/?is_typeahead=true&q=cat&rank_token=27194590479_6cfe777e-001d-4d67-aa62-352e1e261efb returned response: likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given
likeBy() takes 4 positional arguments but 5 were given

likeBy() takes 4 positional arguments but 5 were given
2020-01-27 17:29:48,687 - INFO - Total requests: 31`

sorry my mistake
i fix it
https://gist.github.com/ElonPark/43df4fe7df78b0cc013b654cefd2a60c

2020-01-27 17 : 29 : 48,521-DEBUG-μ—”λ“œ 포인트둜 κ°€μ Έ 였기 : tags / search /? is_typeahead = true & q = cat & rank_token = 27194590479_6cfe777e-001d-4d67-aa62-352e1e261efb λ°˜ν™˜ 응닡 : <Response [200]> likeBy () 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” likeBy ()κ°€ 주어짐 5 λŠ” 4 개의 μœ„μΉ˜ 인수λ₯Ό κ°–μ§€λ§Œ 5λŠ” likeBy ()κ°€ 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν–ˆμ§€λ§Œ 5λŠ” likeBy ()κ°€ 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” likeBy ()κ°€ 4의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5 μ£Όμ–΄μ§„ likeBy ()을 4 개 μœ„μΉ˜ μΈμˆ˜ν•˜μ§€λ§Œ μ†Œμš” 5 μ£Όμ–΄μ§„ likeBy ()을 4 개 μœ„μΉ˜ 인수 걸리지 만 5 μ£Όμ–΄μ§„ likeBy ()λŠ” 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” 2020-01-27 17 : 29 : 48,687을 λ°›μ•˜μŠ΅λ‹ˆλ‹€-정보-총 μš”μ²­ : 31

sorry my mistake
i fix it
https://gist.github.com/ElonPark/43df4fe7df78b0cc013b654cefd2a60c

GREAT!! ITS WORKING .. can you kindly tell me how can i add this to multi_script_CLI.py

https://github.com/instagrambot/instabot/blob/master/examples/multi_script_CLI.py

2020-01-27 17 : 29 : 48,521-DEBUG-μ—”λ“œ 포인트둜 κ°€μ Έ 였기 : tags / search /? is_typeahead = true & q = cat & rank_token = 27194590479_6cfe777e-001d-4d67-aa62-352e1e261efb λ°˜ν™˜ 응닡 : <Response [200]> likeBy () 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” likeBy ()κ°€ 주어짐 5 λŠ” 4 개의 μœ„μΉ˜ 인수λ₯Ό κ°–μ§€λ§Œ 5λŠ” likeBy ()κ°€ 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν–ˆμ§€λ§Œ 5λŠ” likeBy ()κ°€ 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” likeBy ()κ°€ 4의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5 μ£Όμ–΄μ§„ likeBy ()을 4 개 μœ„μΉ˜ μΈμˆ˜ν•˜μ§€λ§Œ μ†Œμš” 5 μ£Όμ–΄μ§„ likeBy ()을 4 개 μœ„μΉ˜ 인수 걸리지 만 5 μ£Όμ–΄μ§„ likeBy ()λŠ” 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” 2020-01-27 17 : 29 : 48,687을 λ°›μ•˜μŠ΅λ‹ˆλ‹€-정보-총 μš”μ²­ : 31

sorry my mistake
i fix it
https://gist.github.com/ElonPark/43df4fe7df78b0cc013b654cefd2a60c

GREAT!! ITS WORKING .. can you kindly tell me how can i add this to multi_script_CLI.py

https://github.com/instagrambot/instabot/blob/master/examples/multi_script_CLI.py

This is a temporary measure to avoid the problem, not the right solution.

2020-01-27 17 : 29 : 48,521-DEBUG-μ—”λ“œ 포인트둜 κ°€μ Έ 였기 : tags / search /? is_typeahead = true & q = cat & rank_token = 27194590479_6cfe777e-001d-4d67-aa62-352e1e261efb λ°˜ν™˜ 응닡 : <Response [200]> likeBy () 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” likeBy ()κ°€ 주어짐 5 λŠ” 4 개의 μœ„μΉ˜ 인수λ₯Ό κ°–μ§€λ§Œ 5λŠ” likeBy ()κ°€ 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν–ˆμ§€λ§Œ 5λŠ” likeBy ()κ°€ 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” likeBy ()κ°€ 4의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5 μ£Όμ–΄μ§„ likeBy ()을 4 개 μœ„μΉ˜ μΈμˆ˜ν•˜μ§€λ§Œ μ†Œμš” 5 μ£Όμ–΄μ§„ likeBy ()을 4 개 μœ„μΉ˜ 인수 걸리지 만 5 μ£Όμ–΄μ§„ likeBy ()λŠ” 4 개의 μœ„μΉ˜ 인수λ₯Ό μ·¨ν•˜μ§€ 만 5λŠ” 2020-01-27 17 : 29 : 48,687을 λ°›μ•˜μŠ΅λ‹ˆλ‹€-정보-총 μš”μ²­ : 31

sorry my mistake
i fix it
https://gist.github.com/ElonPark/43df4fe7df78b0cc013b654cefd2a60c

GREAT!! ITS WORKING .. can you kindly tell me how can i add this to multi_script_CLI.py
https://github.com/instagrambot/instabot/blob/master/examples/multi_script_CLI.py

This is a temporary measure to avoid the problem, not the right solution.

understood .. thanks alot

I update the master branch. Please retest

I update the master branch. Please retest

so i updated the bot and installed the master branch, tested following bots

Ultimate.py : Not liking the hashtags "getting same log"


9%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 7/82 [06:19<1:11:25, 57.14s/it]2020-01-28 15:16:16,507 - DEBUG - GET to endpoint: media/2231253368547012614_7384072680/info/ returned response: <Response [200]> 2020-01-28 15:16:17,120 - DEBUG - GET to endpoint: media/2231253368547012614_7384072680/info/ returned response: <Response [200]> 2020-01-28 15:16:17,682 - DEBUG - GET to endpoint: media/2231253368547012614_7384072680/comments/ returned response: <Response [200]>


Multi_script_Cli.py: not starting .. "name 'settings' is not defined"
"log"


, in setting_input with open(settings, "w") as f: NameError: name 'settings' is not defined


`

Hey guys, any update?

Yes in the development branch...

@bruvv thanks for your effort .. but Its still the same .. not liking by hashtags

what hashtags? cat 2020-02-02 16:21:11,263 - INFO - Going to like media with hashtag #cat. Getting hashtag media.: 0it [00:00, ?it/s]2020-02-02 16:21:14,960 - DEBUG - GET to endpoint: feed/tag/cat/?max_id=&rank_token=27194590479_721d4d07-ab25-4b06-924e-726adcef1dfe&ranked_content=true& returned response: <Response [200]> 2020-02-02 16:21:15,568 - DEBUG - GET to endpoint: tags/search/?is_typeahead=true&q=cat&rank_token=27194590479_721d4d07-ab25-4b06-924e-726adcef1dfe returned response: <Response [200]> 2020-02-02 16:21:15,571 - INFO - Going to like 86 medias. 0%| | 0/86 [00:00<?, ?it/s]2020-02-02 16:21:16,181 - DEBUG - GET to endpoint: media/2234913471189759863_29323074844/info/ returned response: <Response [200]> 2020-02-02 16:21:16,589 - DEBUG - GET to endpoint: media/2234913471189759863_29323074844/info/ returned response: <Response [200]> 2020-02-02 16:21:17,002 - DEBUG - GET to endpoint: media/2234913471189759863_29323074844/comments/ returned response: <Response [200]> 1%|β–‰ | 1/86 [00:11<16:12, 11.44s/it]2020-02-02 16:21:27,447 - DEBUG - GET to endpoint: media/2234913442509430961_28004739581/info/ returned response: <Response [200]> 2020-02-02 16:21:27,852 - DEBUG - GET to endpoint: media/2234913442509430961_28004739581/info/ returned response: <Response [200]> 2020-02-02 16:21:28,302 - DEBUG - GET to endpoint: media/2234913442509430961_28004739581/comments/ returned response: <Response [200]> 2%|β–ˆβ–‰ | 2/86 [00:22<15:56, 11.39s/it]2020-02-02 16:22:26,634 - DEBUG - GET to endpoint: media/2234913436840325087_2573140/info/ returned response: <Response [200]> 2020-02-02 16:22:27,552 - DEBUG - GET to endpoint: media/2234913436840325087_2573140/info/ returned response: <Response [200]> 2020-02-02 16:22:28,039 - DEBUG - GET to endpoint: media/2234913436840325087_2573140/comments/ returned response: <Response [200]>

+1 same here

I mostly only use the hashtags and users followers functions and I too is getting the same response 200, from both of these functions. I see that lots of the others are having the same issue too, is there any info of the error that I should provide?

anyone still having the response 200 problem..?

@ching222 Yes, I pulled most recent version an hour ago '0.107.0'.

Liking individual medias/bulk medias, downloading photos responds with 200 but does actually make the request. With that said, get_total_user_medias worked fine, get last user medias, get follower info, ids is fine. Looks like this version updated yesterday so need to dig into commits to see what actually changed.

edit:

setting check_media = False
resolved it for like() - will need to try other functions

I am not following you @matthieuoliveira what is the error to begin with and what fixed setting check_media ?

@bruvv
Sure,

bot.like(media_id=media_id, username=account, check_media = False) given check_media is False, it returns 200 and the media is liked, given it's true, it never likes the media. Sorry if I wasn't clear. I can test out all endpoints on my end if that will be helpful?

For example,

script.py

bot = Bot(base_path=paths['log_path'] , save_logfile=False)
bot.login(username=login['username'], password=login['password'])
bot.like(media_id, user_id=user_id, check_media=True)

logs

2020-02-14 06:09:47,865 - INFO - Instabot version: 0.107.0 Started
2020-02-14 06:09:47,865 - DEBUG - Bot imported from /usr/local/lib/python3.8/site-packages/instabot/bot/bot.py
2020-02-14 06:09:47,868 - INFO - PRE-LOGIN FLOW!...
2020-02-14 06:09:50,075 - DEBUG - POST to endpoint: accounts/read_msisdn_header/ returned response: <Response [200]>
2020-02-14 06:09:51,235 - DEBUG - POST to endpoint: launcher/sync/ returned response: <Response [200]>
2020-02-14 06:09:53,356 - DEBUG - POST to endpoint: qe/sync/ returned response: <Response [200]>
2020-02-14 06:09:55,488 - DEBUG - POST to endpoint: attribution/log_attribution/ returned response: <Response [200]>
2020-02-14 06:09:57,621 - DEBUG - POST to endpoint: accounts/contact_point_prefill/ returned response: <Response [200]>
2020-02-14 06:10:00,118 - DEBUG - POST to endpoint: accounts/login/ returned response: <Response [200]>
2020-02-14 06:10:00,119 - INFO - Logged-in successfully as 'myaccount123'!
2020-02-14 06:10:00,119 - INFO - LOGIN FLOW! Just logged-in: True
2020-02-14 06:10:01,344 - DEBUG - POST to endpoint: launcher/sync/ returned response: <Response [200]>
2020-02-14 06:10:02,867 - DEBUG - POST to endpoint: qe/sync/ returned response: <Response [200]>
2020-02-14 06:10:06,500 - DEBUG - POST to endpoint: feed/timeline/ returned response: <Response [200]>
2020-02-14 06:10:08,911 - DEBUG - POST to endpoint: feed/reels_tray/ returned response: <Response [200]>
2020-02-14 06:10:11,139 - DEBUG - POST to endpoint: fbsearch/suggested_searches/ returned response: <Response [200]>
2020-02-14 06:10:13,393 - DEBUG - POST to endpoint: fbsearch/suggested_searches/ returned response: <Response [200]>
2020-02-14 06:10:15,645 - DEBUG - POST to endpoint: direct_v2/ranked_recipients/ returned response: <Response [200]>
2020-02-14 06:10:17,897 - DEBUG - POST to endpoint: direct_v2/ranked_recipients/ returned response: <Response [200]>
2020-02-14 06:10:20,679 - DEBUG - POST to endpoint: direct_v2/inbox/ returned response: <Response [200]>
2020-02-14 06:10:21,996 - DEBUG - GET to endpoint: direct_v2/get_presence/ returned response: <Response [200]>
2020-02-14 06:10:24,578 - DEBUG - GET to endpoint: news/inbox/?limited_activity=true&show_su=true returned response: <Response [200]>
2020-02-14 06:10:26,886 - DEBUG - GET to endpoint: loom/fetch_config/ returned response: <Response [200]>
2020-02-14 06:10:28,119 - DEBUG - GET to endpoint: users/profile_notice/ returned response: <Response [200]>
2020-02-14 06:10:29,522 - DEBUG - POST to endpoint: qp/batch_fetch/ returned response: <Response [200]>
2020-02-14 06:10:31,794 - DEBUG - POST to endpoint: discover/explore/ returned response: <Response [200]>
2020-02-14 06:10:31,800 - DEBUG - Loading Checkpoint file from: /app/config/myaccount123.checkpoint
2020-02-14 06:10:34,137 - DEBUG - GET to endpoint: users/target_account_123/usernameinfo/ returned response: <Response [200]>
2020-02-14 06:10:36,900 - DEBUG - GET to endpoint: media/media_id_123/info/ returned response: <Response [200]>
2020-02-14 06:10:39,207 - DEBUG - GET to endpoint: media/media_id_123/info/ returned response: <Response [200]>
2020-02-14 06:10:40,472 - DEBUG - GET to endpoint: media/media_id_123/comments/ returned response: <Response [200]>
2020-02-14 06:10:40,474 - DEBUG - Saving Checkpoint file to: /app/config/myaccount123.checkpoint
2020-02-14 06:10:40,477 - INFO - Total requests: 25

I got the same error. Script is not able to like medias

bot.like(media_id=media_id, username=account, check_media = False)

hey, can you tell me where do i have to add this code
bot.like(media_id=media_id, username=account, check_media = False) in multi_script_CLI

Was this page helpful?
0 / 5 - 0 ratings