From c2025cfdf07a56859c447a4eac7e1546f4a168ae Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Fri, 28 Jun 2024 12:31:31 +0530 Subject: arranged dir --- download_script.py | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 download_script.py (limited to 'download_script.py') diff --git a/download_script.py b/download_script.py deleted file mode 100644 index a9d07c4..0000000 --- a/download_script.py +++ /dev/null @@ -1,25 +0,0 @@ - -import instaloader -import os - -L = instaloader.Instaloader() -L.login('xtester2', 'teTeD7QojvhOdvEGa50u6FFJo') -PROFILES = ["aao.remote.ho.jaye"] -BASE_DIR = "/home/genos/imp/work/project/insta/downloads" - -os.makedirs(BASE_DIR, exist_ok=True) - -def download_posts(profile): - profile_dir = os.path.join(BASE_DIR, profile) - os.makedirs(profile_dir, exist_ok=True) - L.dirname_pattern = profile_dir - posts = instaloader.Profile.from_username(L.context, profile).get_posts() - for post in posts: - if post.typename == 'GraphVideo': # Only download videos - L.download_post(post, target=profile) - elif post.typename == 'GraphImage': # Only download images - L.download_post(post, target=profile) - -for profile in PROFILES: - download_posts(profile) - \ No newline at end of file -- cgit v1.2.3-59-g8ed1b