Created
May 17, 2019 21:34
-
-
Save 0xF6/e8b8b913274291a1d939c298022f01d3 to your computer and use it in GitHub Desktop.
VK Sticker to Telegram Sticker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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