Skip to content

Instantly share code, notes, and snippets.

@mmyjona
Last active July 18, 2017 14:54
Show Gist options
  • Save mmyjona/c70b1e7c0a27cd38514d0daaec9dd935 to your computer and use it in GitHub Desktop.
Save mmyjona/c70b1e7c0a27cd38514d0daaec9dd935 to your computer and use it in GitHub Desktop.
bookmarket to download sticker pack from telegram web
  1. open telegram for web
  2. send a sticker to your self.
  3. click on the sent sticker, wait for the images to download.
  4. click on the bookmarklet or paste the js into console.
  5. profit! use the batch to convert webp to png.
function download(filename, link) {
var element = document.createElement('a');
element.setAttribute('href', link);
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
var person = prompt("Please enter a name for the pack", 'untitled');
for (i = 0; i < $(".stickerset_modal_sticker img").length; i++) {
url = $(".stickerset_modal_sticker img")[i].src;
download(person+'_'+i+".webp",url);
}
javascript:(function()%7Bfunction%20download(filename%2C%20link)%20%7Bvar%20element%20%3D%20document.createElement('a')%3Belement.setAttribute('href'%2C%20link)%3Belement.setAttribute('download'%2C%20filename)%3Belement.style.display%20%3D%20'none'%3Bdocument.body.appendChild(element)%3Belement.click()%3Bdocument.body.removeChild(element)%3B%7Dvar%20person%20%3D%20prompt(%22Please%20enter%20a%20name%20for%20the%20pack%22%2C%20'untitled')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20%24(%22.stickerset_modal_sticker%20img%22).length%3B%20i%2B%2B)%20%7Burl%20%3D%20%24(%22.stickerset_modal_sticker%20img%22)%5Bi%5D.src%3Bdownload(person%2B'_'%2Bi%2B%22.webp%22%2Curl)%3B%7D%7D)()
#Download dwebp (WebP decoder tool) https://developers.google.com/speed/webp/download and add to path
for %%f in (*.webp) do dwebp.exe "%%f" -o "%%~nf.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment