Skip to content

Commit

Permalink
Deprecating the upgrade_to_1080 option on video uploads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Ursenbach committed Oct 23, 2017
1 parent 07646d4 commit cbb6945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ Once you have an authenticated instance of the `VimeoClient` class, you can also
```python
video_uri = v.replace(
video_uri='video_uri',
filename='your-filename.mp4',
upgrade_to_1080=False)
filename='your-filename.mp4')
```

### Uploading a picture
Expand Down
10 changes: 4 additions & 6 deletions vimeo/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,22 @@ class UploadVideoMixin(object):
UPLOAD_ENDPOINT = '/me/videos'
REPLACE_ENDPOINT = '{video_uri}/files'

def upload(self, filename, upgrade_to_1080=False):
def upload(self, filename):
"""Upload the named file to Vimeo."""
ticket = self.post(
self.UPLOAD_ENDPOINT,
data={'type': 'streaming',
'upgrade_to_1080': 'true' if upgrade_to_1080 else 'false'},
data={'type': 'streaming'},
params={'fields': 'upload_link,complete_uri'})

return self._perform_upload(filename, ticket)

def replace(self, video_uri, filename, upgrade_to_1080=False):
def replace(self, video_uri, filename):
"""Replace the video at the given uri with the named source file."""
uri = self.REPLACE_ENDPOINT.format(video_uri=video_uri)

ticket = self.put(
uri,
data={'type': 'streaming',
'upgrade_to_1080': 'true' if upgrade_to_1080 else 'false'},
data={'type': 'streaming'},
params={'fields': 'upload_link,complete_uri'})

return self._perform_upload(filename, ticket)
Expand Down

0 comments on commit cbb6945

Please sign in to comment.