Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to upload caption to a video #871

Closed
TamaraM88 opened this issue Apr 2, 2018 · 6 comments
Closed

Unable to upload caption to a video #871

TamaraM88 opened this issue Apr 2, 2018 · 6 comments
Assignees
Milestone

Comments

@TamaraM88
Copy link

Hi guys,

I'm having issue with uploading caption to a video. GraphResponse is successful, but caption is not published.

I'm adding file as:
BinaryAttachment.with("captions_file", fileName, bytes, MediaType.APPLICATION_OCTET_STREAM_TYPE.toString());

If I try CURL from command line (direct call to graph api) caption is published.

Can you please help?

Note: I'm using version 1.44.0, switching to a 2.3.0 doesn't solves the issue.

Thanks!

@nbartels
Copy link
Contributor

nbartels commented Apr 2, 2018

can you please provide the file name and your curl call. You may obfuscate data you don't want to be publicly visible, but please in a way that don't changes important information ;)

@TamaraM88
Copy link
Author

Hi,

fileName is 'Test.en_US.srt'

curl is:

curl -X POST 'https://graph.facebook.com/v2.10/{videoId}/captions?access_token={token}&default_locale=en_US' -F captions_file=@Test.en_US.srt

Thanks!

@nbartels nbartels self-assigned this Apr 4, 2018
@nbartels
Copy link
Contributor

nbartels commented Apr 4, 2018

Hi,

I just wrote a small integration test and tried to add a subtitle to an video.

My code looks like the

InputStream is = getClass().getResourceAsStream("/binary/jellies.srt");
byte[] subtitleAsBytes = getBytesFromInputStream(is);

GraphResponse result = client.publish("<video_id>/captions", GraphResponse.class,
      BinaryAttachment.with("captions_file","jellies.en_US.srt",subtitleAsBytes));

This worked without a problem. The only change between your code and mine is the content type. I did not provide one.

Can you please check your bytes variable (is the data correct) and try without the content type.

@TamaraM88
Copy link
Author

The same is without the content type... I also checked bytes and the data is correct.

Not sure what to do next since I tried different combinations of data... I even tried with delay between video upload and caption upload...

Thanks!

@nbartels
Copy link
Contributor

nbartels commented Apr 5, 2018

Okay. I used an page access token with only two permissions manage_pages and publish_pages.

@TamaraM88
Copy link
Author

I'm using app with more permissions, but that shouldn't be a problem....

@nbartels nbartels added this to the Triaged milestone Nov 24, 2019
@restfb restfb locked and limited conversation to collaborators Feb 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants