• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
LLODO – Education and technology

LLODO - Education and technology

Find your international education - university and college study education programs, student Exam, and course information.

  • Technology News
  • Blog Anony
  • Technology Quiz

How to download all Instagram users’ photos and videos

05/08/2022 by admin Leave a Comment

In this article, I will guide you to download all photos and videos of Instagram users. I will use the tool of Mr. Hoang Tran. If you find it interesting, you can give it 1 star on his github here.

How to download all Instagram users' photos and videos

How to download all Instagram users’ photos and videos

First, copy the code below.

javascript: (function () {
  if (window.location.host === "www.instagram.com") {
    console.log("Đang lấy user id ...");
    fetch(location.href + "?__a=1")
      .then((response) => response.json())
      .then((json) => {
        const {
          fbid,
          id,
          username,
          full_name,
          profile_pic_url_hd,
          profile_pic_url,
          edge_owner_to_timeline_media,
        } = json.graphql.user;
        console.log(json.graphql.user);
        window.prompt(`User ID của ${username}:`, id);
      })
      .catch((e) => {
        alert("Lỗi: " + e.toString());
      });
  } else {
    alert(
      "Bookmark này chỉ hoạt động trên trang www.instagram.com\nBạn hãy vào trang www.instagram.com và ấn lại bookmark để lấy token an toàn nhé."
    );
    window.open("https://www.instagram.com");
  }
})();

Then right click on bookmarks and select “Add this page to favorites”.

How to download all photos and videos of Instagram users 40

Rename the name part to “get insta user id” and paste the copied code into the URL and press Save.

How to download all photos and videos of Instagram users 41

Continue to copy the code below.

javascript: (async function () {
  let user_id = prompt("Enter user id:", "");
  if (!user_id) return;

  function getBiggestMediaFromNode(node) {
    if (node.is_video) {
      return getUniversalCdnUrl(node.video_url);
    } else {
      let r = node.display_resources;
      return r[r.length - 1]?.src;
    }
  }

  function download(data, filename, type) {
    var file = new Blob([data], { type: type });
    if (window.navigator.msSaveOrOpenBlob)
      window.navigator.msSaveOrOpenBlob(file, filename);
    else {
      var a = document.createElement("a"),
        url = URL.createObjectURL(file);
      a.href = url;
      a.download = filename;
      document.body.appendChild(a);
      a.click();
      setTimeout(function () {
        document.body.removeChild(a);
        window.URL.revokeObjectURL(url);
      }, 0);
    }
  }

  function getUniversalCdnUrl(cdnLink) {
    const cdn = new URL(cdnLink);
    cdn.host = "scontent.cdninstagram.com";
    return cdn.href;
  }

  let all_urls = [];
  let after = "";

  while (true) {
    console.log("FETCHING...");
    let data = await fetch(
      `https://www.instagram.com/graphql/query/?query_hash=396983faee97f4b49ccbe105b4daf7a0&variables={"id":"${user_id}","first":50,"after":"${after}"}`
    );
    let json = await data.json();
    let edges = json?.data?.user?.edge_owner_to_timeline_media?.edges || [];

    console.log(`Found ${edges?.length} medias. Processing...`);

    let urls = [];
    edges.forEach((e) => {
      let childs = e.node?.edge_sidecar_to_children?.edges;

      if (childs) {
        urls.push(...childs.map((c) => getBiggestMediaFromNode(c.node)));
      } else {
        urls.push(getBiggestMediaFromNode(e.node));
      }
    });

    all_urls.push(...urls);
    console.log(`Saved ${urls.length} medias. (TOTAL: ${all_urls.length})`);

    let pageInfo = json?.data?.user?.edge_owner_to_timeline_media?.page_info;
    if (pageInfo?.has_next_page) {
      after = pageInfo?.end_cursor;
    } else {
      console.log("[STOP] THIS IS THE LAST PAGE.");
      break;
    }
  }
  console.log(all_urls);

  download(all_urls.join("\n"), user_id, ".txt");
})();

Rename the part name to “get media user insta”paste the above copied code into the URL field and press Save.

How to download all Instagram users' photos and videos 42

Now you access the instagram page you want to download photos and videos. Then press F12 and switch to the Console tab. Next click on “get insta user id”.

How to download all photos and videos of Instagram users 43

Copy the Insta ID you want.

How to download all Instagram users' photos and videos 44

Next click on “get media user insta”.

How to download all Instagram users' photos and videos 45

Then paste the ID you just copied and press OK.

How to download all photos and videos of Instagram users 46

Please wait a moment for the tool to get the link of photos and videos.

How to download all photos and videos of Instagram users 47

Once done, the browser will ask you to download the file link. Please save it somewhere easy to remember.

How to download all photos and videos of Instagram users 48

Next, you download the tool FBMediaDownloader here and install more NodeJS (version 14 or higher) here.

Open cmd in the downloaded project folder and run the command npm install to install the tool.

Copy the code below and create bookmarks similar to above to get the access token. Then paste the access token into the config.js file.How to download all photos and videos of Instagram users 49

javascript: (function () {
  try {
    const encoded = document.cookie
      .split("; ")
      ?.find((_) => _.startsWith("fbsr"))
      ?.split(".")[1];
    if (encoded) {
      const decoded = JSON.parse(atob(encoded));
      console.log(decoded);
      window.prompt("Access token: ", decoded.oauth_token);
    } else {
      alert(
        "Không tìm thấy thông tin access token trong cookie!\nBạn đã đăng nhập instagram chưa??"
      );
    }
  } catch (e) {
    alert("Lỗi: " + e.toString());
  }
})();

Next run the command node index.js in cmd or VScode and you will see below interface. Press 6 to download the image from the file link. Then drag the file link into cmd or you can also type the path yourself. Finally, enter the folder name.

How to download all photos and videos of Instagram users 50

You access the downloaded project folder > download > from-file > samdoesarts. And here are your results.

How to download all photos and videos of Instagram users 51

So you have successfully downloaded photos from someone else’s instagram. In addition to photos, you can also download videos. If you find it interesting, please give 1 star to his github.

Filed Under: Blog Anony Tagged With: Anony Hack, News Tech Anony

Related posts:

  1. Use AI to turn sketches into real photos
  2. Tips to find other people’s information on the Internet
  3. Calendar’s File .ics phishing attack technique
  4. How to fix “This Site Can’t Be Reached” error ERR_ADDRESS_UNREACHABLE
  5. How to Get Free Remitano’s RENEC Tokens
  6. 14 Google Sheets functions that Excel doesn’t have
  7. Experience in Website Security Testing
  8. Change Header to Bypass WAF when scanning Website vulnerabilities with Scan Tools
  9. List of 15 largest hacked companies in history
  10. Use Netcat to Transfer Files in Windows and Linux
  11. Top 3 Safe and Clean Game Crack Download Websites
  12. TOP 5 Wifi Routers under 500,000 VND suitable for families in 2022
  13. How to secretly Track your phone using xfi endpoint
  14. AZDIGI Discount up to 90% of Hosting/VPS prices on the occasion of April 30
  15. How to reopen recently closed Tabs on Chrome browser
  16. How to merge multiple Chrome windows into 1 window?
  17. How to package Python code
  18. What is Google Dork? Update Google Hacking Dork 2022
  19. Share Code to get 2FA code like 2fa.live
  20. Review the application i-Speed ​​​​to measure Internet speed

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • 30 meters from the ground to the roof of 10 floors
  • British newspaper calls cryptocurrencies “environmental destroyers”, “faded dreams”
  • Look forward to a series of genuine technology toys on sale, all “genuine” brands with up to 50% discount
  • Why can astronauts still make phone calls in the vacuum of space?
  • With only 100 USD and 10 seconds, the security expert successfully unlocked and started the Tesla electric car




Categories

  • Blog Anony (381)
  • Family and Friends 1 (63)
  • Family and Friends 2 (80)
  • Family and Friends 3 (80)
  • Family and Friends 4 (84)
  • Family and Friends 5 (82)
  • Grade 1 Math (61)
  • Grade 2 Math (96)
  • Grade 3 English (68)
  • Grade 3 Math (67)
  • Grade 4 English (68)
  • Grade 4 Math (77)
  • Grade 5 English (68)
  • Grade 5 Math (88)
  • Grade 6 English (104)
  • Grade 6 Math (67)
  • Grade 6 Physics (30)
  • Grade 7 English (104)
  • Grade 7 Math (57)
  • Grade 7 Physics (30)
  • Grade 8 Biology (64)
  • Grade 8 Chemistry (43)
  • Grade 8 English (104)
  • Grade 8 Math (75)
  • Grade 8 Physics (29)
  • Grade 9 Biology (63)
  • Grade 9 Chemistry (56)
  • Grade 9 English (104)
  • Grade 9 Math (61)
  • Grade 9 Physics (62)
  • Houseware (126)
  • Learning English (50)
  • Linux Quiz (300)
  • Software (31)
  • Technology News (7,259)
  • Technology Quiz (850)
  • Windows Quiz (200)

Copyright (c) 2022 · LLODO.COM - About Us - Privacy Policy - Contact Us - Site map
Link: Question Answer English - Hoc edu - Internet Do