Comments (2)
I found it on other bot, i hope it help: https://github.com/LopesX/instabot.py/blob/master/src/instabot.py#L351
def get_media_id_by_tag(self, tag):
""" Get media ID set, by your hashtag or location """
if self.login_status:
if tag.startswith('l:'):
tag = tag.replace('l:', '')
self.by_location = True
log_string = "Get Media by location: %s" % (tag)
self.write_log(log_string)
if self.login_status == 1:
url_location = self.url_location % (tag)
try:
r = self.s.get(url_location)
all_data = json.loads(r.text)
self.media_by_tag = list(all_data['graphql']['location']['edge_location_to_media']['edges'])
except:
self.media_by_tag = []
self.write_log("Except on get_media!")
logging.exception("get_media_id_by_tag")
else:
return 0
else:
log_string = "Get Media by tag: %s" % (tag)
self.by_location = False
self.write_log(log_string)
if self.login_status == 1:
url_tag = self.url_tag % (tag)
try:
r = self.s.get(url_tag)
all_data = json.loads(r.text)
self.media_by_tag = list(all_data['graphql']['hashtag']['edge_hashtag_to_media']['edges'])
except:
self.media_by_tag = []
self.write_log("Except on get_media!")
logging.exception("get_media_id_by_tag")
else:
return 0
from igbot.
Nice. Can you please implement it in our bot? Let's make a Pull Request.
from igbot.
Related Issues (20)
- How can I get the number of followers and the number of following? HOT 1
- [BUG] Aspect ratio should be rounded HOT 1
- [BUG] upload_video.py not working? HOT 2
- [BUG] Message_user.py Request Return 400 HOT 1
- [BUG] CHANGE THIS TITLE TO YOUR ISSUE HOT 1
- [BUG] Message is not being delivered by bot HOT 2
- [BUG] Message is not being delivered by bot HOT 1
- [BUG] Message is not being delivered by bot HOT 2
- Follower Request Approval Custom number HOT 1
- Custom Approve Pending Follow Requests number HOT 2
- Approve Pending Follow Requests custom number of requests HOT 4
- [QUESTION] where do i set the ammount of feed post and the age the bot will comment HOT 1
- Error running any script HOT 1
- [BUG] checkpoint_challenge_required HOT 4
- ERROR - Request returns 400 error! Instagram's error message: Uploaded image isn't in the right format HOT 1
- welecmo.py
- instagram detects the bot in 10 minutes and only follows 8 people HOT 1
- [BUG] repost_best_photos_from_users.py just doesnt upload anything to my page HOT 1
- [QUESTION] How can I install it? HOT 1
- Providing 2FA code for the login as an option for the input HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from igbot.