Skip to content

Instantly share code, notes, and snippets.

@0xF6
Created May 17, 2019 21:34
Show Gist options
  • Save 0xF6/e8b8b913274291a1d939c298022f01d3 to your computer and use it in GitHub Desktop.
Save 0xF6/e8b8b913274291a1d939c298022f01d3 to your computer and use it in GitHub Desktop.
VK Sticker to Telegram Sticker
// Open stickers preview and run this code in console
$(".im_stickerpack_preview").each(function (index, value) {
var url = $(value).children().attr("src");
console.log(url);
});
// copy links and replace -128 end in sticker id to -512
var urls = new[] { "https://vk.com/sticker/1-12467-512","https://vk.com/sticker/1-12468-512", ... };
#r MoreLinq.nuget
#r Flurl.nuget
using Flurl;
using MoreLinq;
using System.Linq;
var result = urls.
Select(x =>
new {
bytes = x.GetBytesAsync().Result,
name = x.Split('/').Last()
})
.Pipe(x => File.WriteAllBytes($"./tg/{x.name}.png", x.bytes)).ToArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment