-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Context
When uploading a media (GIF or Video). Twitter will always process the media.
Currently, in src/api/media.ts#L278, the condition to wait between two upload status checks of an uploaded media is:
// Wait for the recommended time before checking again
const checkAfterSecs = data.processing_info?.check_after_secs || 1;
await new Promise(resolve => setTimeout(resolve, checkAfterSecs * 1000));If a media takes 30 seconds to be processed by X and X leaves data.processing_info?.check_after_secs empty or always returns 5, then we will make between 6 to 30 additional API calls.
Given:
- The daily limit on free plan is 85 API calls
- Twitter limits chunk upload sizes to 4MB
- For a small 100MB mp4 video it takes 27 API calls to upload all chunks.
- 1 for
INIT - 25 for
APPEND - 1 for
FINALIZE
- 1 for
If if takes 15 additional API calls only to check the status, then a user on a free API plan uses almost half of his allowed usage (27+15=42) for one 100MB video.
Goal
Allow user to specify a minimum waiting time between upload status checks.
- Add optional
minWaitingTimeInSeconds: numberparam toAbstractMedia.upload - Update Readme documentation to explain what this param does.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request