Skip to content

Commit 4f5370e

Browse files
Merge pull request #296 from plivo/update-supported-media
update supported media
2 parents 4f29e49 + 9b48259 commit 4f5370e

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Change Log
2+
## [4.59.2](https://github.com/plivo/plivo-ruby/tree/v4.62.1) (2025-08-06)
3+
**Feature - Expanded Media Type Support for Media Upload**
4+
- Added support for additional media file formats: GIF, MP3, WAV, OGG, 3GPP, 3GPP2, VCARD, CSV, XLS, XLSX, and PLAIN text files
5+
26
## [4.59.1](https://github.com/plivo/plivo-python/tree/v4.59.1) (2025-05-28)
37
- Fixed signature validation.
48

plivo/resources/media.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,29 @@ def upload(self, media_file):
2424
fileList = []
2525
for media_url in media_file:
2626
file_extension = media_url.strip().split('.')[-1].lower()
27-
if file_extension not in ['jpeg', 'jpg', 'png', 'xcf', 'plain', 'pdf', 'mpeg', 'mp4']:
27+
if file_extension not in ['jpeg', 'jpg', 'png', 'gif', 'mp3', 'mp4', 'mpeg', 'wav', 'ogg', '3gpp', '3gpp2', 'vcard', 'csv', 'pdf', 'xls', 'xlsx', 'xcf', 'plain']:
2828
raise ValidationError(
29-
'File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF'
29+
'File format of the file to be uploaded should be one of JPG, JPEG, PNG, GIF, MP3, MP4, MPEG, WAV, OGG, 3GPP, 3GPP2, VCARD, CSV, PDF, XLS, XLSX, XCF, or TEXT'
3030
)
3131
content_types = {
3232
'jpeg': 'image/jpeg',
3333
'jpg': 'image/jpeg',
3434
'png': 'image/png',
35+
'gif': 'image/gif',
36+
'mp3': 'audio/mp3',
37+
'mp4': 'video/mp4',
38+
'mpeg': 'audio/mpeg',
39+
'wav': 'audio/wav',
40+
'ogg': 'audio/ogg',
41+
'3gpp': 'video/3gpp',
42+
'3gpp2': 'video/3gpp2',
43+
'vcard': 'text/vcard',
44+
'csv': 'text/csv',
3545
'pdf': 'application/pdf',
46+
'xls': 'application/vnd.ms-excel',
47+
'xlsx': 'application/vnd.ms-excel',
3648
'xcf': 'image/xcf',
37-
'text': 'text/plain',
38-
'mpeg': 'video/mpeg',
39-
'mp4': 'video/mp4'
49+
'plain': 'text/plain'
4050
}
4151
print(media_url)
4252
import os

plivo/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = '4.59.1'
2+
__version__ = '4.59.2'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='plivo',
13-
version='4.59.1',
13+
version='4.59.2',
1414
description='A Python SDK to make voice calls & send SMS using Plivo and to generate Plivo XML',
1515
long_description=long_description,
1616
url='https://github.com/plivo/plivo-python',

0 commit comments

Comments
 (0)