Skip to content

Commit

Permalink
twitter: update max video upload size from 5MB to 512MB
Browse files Browse the repository at this point in the history
fixes #162
  • Loading branch information
snarfed committed Feb 15, 2019
1 parent 64df34a commit 0424417
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ Changelog
* Instagram:
* Fix individual photo/video link urls for multi-photo/video posts.
* Handle [user-provided alt text](https://instagram-press.com/blog/2018/11/28/creating-a-more-accessible-instagram/) ([#159](https://github.com/snarfed/granary/issues/159)).
* Twitter:
* Update max video upload size from 5MB to 512MB ([#162](https://github.com/snarfed/granary/issues/162).
* `/url`: Return HTTP 400 when fetching the user's URL results in an infinite redirect.
### 1.14 - 2018-11-12
Expand Down
4 changes: 2 additions & 2 deletions granary/tests/test_twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2575,8 +2575,8 @@ def test_create_with_video_too_big(self):
'stream': {'url': 'http://my/video'},
})
self.assertTrue(ret.abort)
self.assertIn("larger than Twitter's 15MB limit.", ret.error_plain)
self.assertIn("larger than Twitter's 15MB limit.", ret.error_html)
self.assertIn("larger than Twitter's 512MB limit.", ret.error_plain)
self.assertIn("larger than Twitter's 512MB limit.", ret.error_html)

def test_create_with_video_wrong_type(self):
self.expect_urlopen('http://my/video', '',
Expand Down
3 changes: 2 additions & 1 deletion granary/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
'image/gif', 'image/webp',))
VIDEO_MIME_TYPES = frozenset(('video/mp4',))
MB = 1024 * 1024
MAX_VIDEO_SIZE = 15 * MB
# https://developer.twitter.com/en/docs/media/upload-media/uploading-media/media-best-practices
MAX_VIDEO_SIZE = 512 * MB
UPLOAD_CHUNK_SIZE = 5 * MB
MAX_ALT_LENGTH = 420

Expand Down

0 comments on commit 0424417

Please sign in to comment.