fnb-roc-website/scraper/scraper.py
2025-05-26 18:36:11 -04:00

18 lines
555 B
Python

# wait between 1050 and 1150 seconds
import instaloader
from time import sleep
from random import randint
from os import listdir
L = instaloader.Instaloader()
L.load_session_from_file("down.loader54321")
profile_of_interest = instaloader.Profile.from_username(L.context, "rocfnb")
files = listdir('.')
for post in profile_of_interest.get_posts():
if not post.shortcode in files :
L.download_post(post, target=post.shortcode)
sleep(randint(1050, 1150))
else:
print("Already downloaded " + post.shortcode +", skipping...")