Skip to content

Commit

Permalink
modify upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Kouhei Aoyagi committed Mar 26, 2024
1 parent 05268d1 commit 34d0aad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Twitter API v2 library.
- Convenience setted parameter methods
- Bearer authentication(OAuth 2.0 Authorization Code Flow with PKCE)
- OAuth1.0a authentication(OAuth 1.0a User Contex)
- Upload Media upload.twitter.com apis
- Optional retriable and timeout and logging
- Optional OAuth with web example
- Optional v1 to v2 parser
Expand Down Expand Up @@ -37,6 +38,9 @@ Twitter API v2 library.
### models
- From v1 to v2

### upload
- Upload Media

## Changes
[CHANGELOG.md](https://github.com/aoyagikouhei/twapi-v2-rs/blob/main/CHANGELOG.md)

Expand Down
10 changes: 1 addition & 9 deletions src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,7 @@ pub async fn upload_media(
let data = post_media_upload_finalize::Data {
media_id: media_id.clone(),
};
let response = post_media_upload_finalize::Api::new(data)
.execute(authentication)
.await?;
if response.0.processing_info.is_none() {
return Ok(response);
}

// ProgressInfo
get_media_upload::Api::new(media_id.clone())
post_media_upload_finalize::Api::new(data)
.execute(authentication)
.await
}
Expand Down

0 comments on commit 34d0aad

Please sign in to comment.