Save your entire Onlyfans feed

  • Thread starter anonymous200912
  • Start date
A

anonymous200912

Guest
Hey, just did a quick script which uses onlyfans endpoint to load ALL the posts, then display them on the page, then all you need to do is hit Ctrl + S to save the webpage which will also save the images!

Only thing you will have to do is:
1. Go to onlyfans homepage.
2. Open Dev Tools, go to network tab
3. Find the XHR Request to the posts file
4. Copy the app-token.
5. Paste the below script into the console, but don't hit enter.
6. Paste the app-token into the token variable in the below script.
7. Then hit enter to run the script, it will empty the webpage ready to add all the images it finds, then just wait until it says it's done!

Will work on profiles, but you must change the endpoint so the correct link, for example:
Code:
https://onlyfans.com/api2/v2/users/7949389/

Find the correct endpoint within the XHR requests.

Code:
let currentOffset = 0;
const token = '';
const endpoint = 'https://onlyfans.com/api2/v2/';

document.body.innerHTML = '';

function ajaxLoadAllPosts() {

  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState === 4 && this.status === 200) {
      let data = JSON.parse(this.responseText);
      data.forEach(post => {
        post.media.forEach(media => {
          let image = document.createElement('img');
          image.setAttribute('src', media.source.source);
          document.body.appendChild(image);
        });
      });
      if (data.length > 0) {
        currentOffset = currentOffset + 100;
        ajaxLoadAllPosts(currentOffset);
      } else {
        console.log("%cNo more posts found, you have them all! Now hit Ctrl + S and save the webpage, this will save all the images too!", "background-color:#48c774;color:#fff;padding:4px;border-radius:5px;");
      }
    }
  };
  console.log(`%cFound 100 posts, offset by ${currentOffset}`, 'color:#818181;');
  xhttp.open('GET', `${endpoint}posts?limit=100&offset=${currentOffset}&query=&app-token=${token}`, true);
  xhttp.send();

}
ajaxLoadAllPosts();
 
Last edited by a moderator:
Top