chris-greening / instascrape

Powerful and flexible Instagram scraping library for Python, providing easy-to-use and expressive tools for accessing data programmatically
https://chris-greening.github.io/instascrape/
MIT License
636 stars 111 forks source link

How to get Photo or video Src ? #131

Open jimmyxp01 opened 3 years ago

jimmyxp01 commented 3 years ago

I want the full link of posts. how to extract this? post link: https://www.instagram.com/p/CP5VLwPMnrF/

Need (Example): https://instagram.fccu20-1.fna.fbcdn.net/v/t51.2885-15/e35/197884809_865699657359940_2163597179560292049_n.jpg?tp=1&_nc_ht=instagram.fccu20-1.fna.fbcdn.net&_nc_cat=104&_nc_ohc=9xGuy1FN8MoAX-Nztrd&edm=AABBvjUBAAAA&ccb=7-4&oh=f0f99f225af923a1b405ceb7546bc4e0&oe=60D9E241&_nc_sid=83d603

Anyone help me. I need A user all photo, video, reel links list. I don't want to download them, just need links like the above one.

alizepistidda commented 3 years ago

check the property of post: flat_json_dict['text']

If you follow this blogpost add in the for-loop the following statement:

for post in chris_photos: if 'text' in post.flat_json_dict: text= post.flat_json_dict['text'] else: text = "NaN"

The variable text will give you now what you need.