ramtinak / InstagramApiSharp

A complete Private Instagram API for .NET (C#, VB.NET).
MIT License
779 stars 239 forks source link

"int too big to convert" on uploading media #608

Open haririan opened 5 months ago

haririan commented 5 months ago

### Important note

I've:

Issue category

Language

Usage

Operating System

Describe your issue

this is how i try to add image var mediaImage = new InstaImageUpload {

            Height = 0,
            Width = 0,
            Uri = @"ali.jpg"
        };

        var result = await api.MediaProcessor.UploadPhotoAsync(mediaImage, "COMMENT");

Screenshots

image
fancifulcoder commented 4 months ago

Hello, were you able to solve the problem?

SailleshPawar commented 4 months ago

I am also facing the same issue in .net core. image

fancifulcoder commented 4 months ago

I was able to solve it this way.

image

image

SailleshPawar commented 4 months ago

@fancifulcoder I am still facing the same error. Though If I use the repository examples project it works for me seems like some library is missing for me.

rickmsg79 commented 3 months ago

@fancifulcoder or @SailleshPawar did you come up with a solution? I'm facing the same error. I'm using a jpg of 115kb, so it's already very small.

SailleshPawar commented 3 months ago

@rickmsg79 I just stopped using this library due to no support of .NET core.
If you use the sample project in the repo and use the required dependencies then it works fine,

rickmsg79 commented 3 months ago

@SailleshPawar thanks! what do you end up using for net core? another library?

SailleshPawar commented 2 months ago

got the warning from instagram that the account will be blocked so stopped using it and stopped the poc for now.

marciusbezerra commented 4 weeks ago

I have the same problem here, however, I decided to create my own service within my project, which handles the entire oAuth flow until sending the media.

There is no way to depend on this component.

marciusbezerra commented 2 weeks ago

To fix the error, I did this in the source code I received...

image

The method was returning a very large number that should just be an integer for Instagram.

This way it worked, if they accept a PullRequest I can even send it, but for now I'm using it this way for myself.

ramtinak commented 2 weeks ago

Hi, Sorry to all of you, I don't check this repository regularly, I'll update uploading parts (story/video/DM/reels) in next few weeks as a gift to all of you.

Also ReelsProcessor added in case if someone uses it. Thanks for contributing.

Regards.