huaying / instagram-crawler

Get Instagram posts/profile/hashtag data without using Instagram API
MIT License
1.14k stars 283 forks source link

Get mentions, hashtags, likers, likes_plays using the hashtag mode? #51

Open dhsdshdhk opened 5 years ago

dhsdshdhk commented 5 years ago

When searching for hashtag, only 3 fields show up regardless of additional options: key, caption and img_url. Is there a way to get more information, such as the ones available with posts_full?

RichieLee93 commented 5 years ago

When searching for hashtag, only 3 fields show up regardless of additional options: key, caption and img_url. Is there a way to get more information, such as the ones available with posts_full?

Same issue to me.

dhsdshdhk commented 5 years ago

@RichieLee93 I found a better tool, it's called Instaloader and it does a good job at searching hashtags.

RichieLee93 commented 4 years ago

@RichieLee93 I found a better tool, it's called Instaloader and it does a good job at searching hashtags.

Thank you so much!

snoop2head commented 4 years ago

Same issue for me too! I've used --fetch_hashtags option but the output shows up key, caption and url only.

snoop2head commented 4 years ago

For anyone who is interested in searching instagram with hashtag, I've written sample Python code for it using Instaloader below.

import instaloader
L = instaloader.Instaloader(download_pictures=False,
                           download_video_thumbnails=False,
                            download_videos=False,
                            download_geotags=True,
                            download_comments=False,
                            save_metadata=False)

def get_it(nameOfExercise):
    numbers_of_loop = 1000
    while numbers_of_loop > 0:
        for post in L.get_hashtag_posts(nameOfExercise):
            # post is an instance of instaloader.Post
            L.download_post(post, target='#'+nameOfExercise)
            numbers_of_loop-=1
            # print(numbers_of_loop)
            if numbers_of_loop ==0:
                break
        print("loop ended for " + nameOfExercise)

kinds_of_exercise = ["pilates","PT","yoga"]

print(len(kinds_of_exercise))

for item in kinds_of_exercise:
    get_it(item)

Of course, don't forget to check document for Instaloader too!

RAZQII commented 4 years ago

@snoop2head can you show us how to use your code?