Need a script to work on C# program, here's the full scripts in python and JS
Python -
"
def getInstagramUrlFromMediaId(media_id):
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
shortened_id = ''
while media_id > 0:
remainder = media_id % 64
# dual conversion sign gets the right ID for new posts
media_id = (media_id - remainder) // 64;
# remainder should be casted as an integer to avoid a type error.
shortened_id = alphabet[int(remainder)] + shortened_id
return '[login to view URL]' + shortened_id + '/'
"
JS -
"
function getInstagramUrlFromMediaId(media_id) {
var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
var shortenedId = '';
media_id = [login to view URL](0, [login to view URL]('_'));
while (media_id > 0) {
var remainder = bigInt(media_id).mod(64);
media_id = bigInt(media_id).minus(remainder).divide(64).toString();
shortenedId = [login to view URL](remainder) + shortenedId;
}
return '[login to view URL]' + shortenedId + '/';
}
"