• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to download all Instagram users’ photos and videos

AnonyViet by AnonyViet
January 25, 2023
in Software
0

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

Join the channel Telegram of the AnonyViet 👉 Link 👈

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 14

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

How to download all photos and videos of Instagram users 15

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 photos and videos of Instagram users 16

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 17

Copy the Insta ID you want.

How to download all photos and videos of Instagram users 18

Next click on “get media user insta”.

How to download all photos and videos of Instagram users 19

Then paste the ID you just copied and press OK.

How to download all photos and videos of Instagram users 20

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 21

Once completed, the browser will ask you to download the file link. Save it somewhere easy to remember.

How to download all photos and videos of Instagram users 22

Next, you download the FBMediaDownloader tool here and install more NodeJS (version 14 and above) 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 23

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 24

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 25

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.

The article achieved: 5/5 – (100 votes)

Tags: DownloadInstagramphotosusersvideos
Previous Post

Instructions to connect Windows 365 Cloud PC with Remote Desktop

Next Post

Lesson 217: Advanced Filter in Excel

AnonyViet

AnonyViet

Related Posts

Samsung Galaxy Z Fold 8 Ultra and Z Fold 7: Is it worth upgrading?
Software

Samsung Galaxy Z Fold 8 Ultra and Z Fold 7: Is it worth upgrading?

July 28, 2026
Instructions on how to get 1 year of VIP Hidely VPN for free
Software

Instructions on how to get 1 year of VIP Hidely VPN for free

July 25, 2026
Instructions on how to block strange devices from accessing your home Wifi
Software

Instructions on how to block strange devices from accessing your home Wifi

July 25, 2026
Instructions on how to get Norton 360 Deluxe for 1 year for free
Software

Instructions on how to get Norton 360 Deluxe for 1 year for free

July 19, 2026
Is Xiaomi Redmi A7 a valuable choice in the popular smartphone segment?
Software

Is Xiaomi Redmi A7 a valuable choice in the popular smartphone segment?

July 14, 2026
Compact design, durable battery, excellent camera: Review of OPPO Reno 16 Pro 5G
Software

Compact design, durable battery, excellent camera: Review of OPPO Reno 16 Pro 5G

July 12, 2026
Next Post
Lesson 217: Advanced Filter in Excel

Lesson 217: Advanced Filter in Excel

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted

Recent News

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

July 29, 2026
What is quantum resistant cryptography? Why must the Internet change?

What is quantum resistant cryptography? Why must the Internet change?

July 29, 2026
Instructions for receiving ChatGPT Plus for 1 month for free in 2026

Instructions for receiving ChatGPT Plus for 1 month for free in 2026

July 28, 2026
Samsung Galaxy Z Fold 8 Ultra and Z Fold 7: Is it worth upgrading?

Samsung Galaxy Z Fold 8 Ultra and Z Fold 7: Is it worth upgrading?

July 28, 2026
MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

July 29, 2026
What is quantum resistant cryptography? Why must the Internet change?

What is quantum resistant cryptography? Why must the Internet change?

July 29, 2026
Instructions for receiving ChatGPT Plus for 1 month for free in 2026

Instructions for receiving ChatGPT Plus for 1 month for free in 2026

July 28, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

July 29, 2026
What is quantum resistant cryptography? Why must the Internet change?

What is quantum resistant cryptography? Why must the Internet change?

July 29, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply