This is a code to download PDFs or Images that are uploaded to google drive and have "NO ACCESS TO DOWNLOAD THEM". This is just for fun code, not meant for exploitation usage!
Fork this repository by clicking on the fork button on the top of this page. This will create a copy of this repository in your account.
For Mac User, shortcut is:
Command + Option + i
For Windows user, shortcut is:
Control + Shift + c
IMP!!: Make sure that inspect element tab is open, then reload the page and instantly open the pdf file
Make sure that you see some file names as :
img?ck=drive.......
This type of files are the pages of the pdf.
After that you can see many img?ck=drive...
loads up on the network page
After scrolling all the way to the bottom, wait for 10 or 15 seconds to load up all the files (depending upon your network connectivity).
OR,
Check how much size it has transferred (if transferred value is almost closed to original value then its done!)
let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
if (!/^blob:/.test(img.src)) {
console.log("invalid src");
continue;
}
let can = document.createElement('canvas');
let con = can.getContext("2d");
con.imageSmoothingEnabled = false; // added line
can.width = img.width;
can.height = img.height;
con.drawImage(img, 0, 0, img.width, img.height);
let imgData = can.toDataURL("image/jpeg", 1.0);
pdf.addImage(imgData, 'JPEG', 0, 0);
pdf.addPage();
}
pdf.save("download.pdf");
};
jspdf.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js';
document.body.appendChild(jspdf);
Simply paste the code here and press Enter
8. After that all the image files in the pdf will converted into one PDF and automatically downloaded when its done
Thank You! from Sourasish Mondal
Please fork this repo and make sure to give it a star!!!!