GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-146341: Add new video MIME types to mimetypes.py by clin1234 · Pull Request #146342 · python/cpython

gh-146341: Add new video MIME types to mimetypes.py #146342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
clin1234 wants to merge 12 commits into python:main
base: main
Loading
Loading
from clin1234:video-mimes
+26 −0
Open

gh-146341: Add new video MIME types to mimetypes.py #146342

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
12 commits
Select commit Hold shift + click to select a range
770c074
Add new video MIME types to mimetypes.py
clin1234 Mar 23, 2026
2c92834
📜🤖 Added by blurb_it.
blurb-it[bot] Mar 23, 2026
634dc9b
Indent
clin1234 Mar 23, 2026
f130c40
Formatting
clin1234 Mar 24, 2026
a3ccedf
Omit comma
clin1234 Mar 24, 2026
b2bd60f
Again...
clin1234 Mar 24, 2026
536c5a6
Add name and GH issue in News fragment
clin1234 Apr 1, 2026
4cae25e
Fix syntax errors in mimetypes.py
clin1234 Apr 2, 2026
3a22e6b
Format
clin1234 Apr 11, 2026
0c20ce2
Drop list
clin1234 Apr 11, 2026
0c69915
CRLF -> LF
clin1234 May 4, 2026
bb699b6
Mark in whatsnew
clin1234 Jul 7, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

2 changes: 2 additions & 0 deletions 2 Doc/whatsnew/3.16.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ mimetypes
Valid extensions must now start with a ``'.'`` or be empty;
undotted extensions raise a :exc:`ValueError`.
(Contributed by Nikita Sobolev in :gh:`149720`.)
* Add more MIME types.
(Contributed by Charlie Lin in :gh:`146342`.)

shutil
------
Expand Down
11 changes: 11 additions & 0 deletions 11 Lib/mimetypes.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,13 @@ def _default_mime_types():
'.sgml' : 'text/x-sgml',
'.vcf' : 'text/x-vcard',
'.xml' : 'text/xml',
'.3gp' : 'video/3gpp',
'.3g2' : 'video/3gpp2',
Comment thread
Comment on lines +692 to +693

@hugovk hugovk Jul 7, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have these earlier in the dict:

        '.3gp'    : 'audio/3gpp',
...
        '.3g2'    : 'audio/3gpp2',

So these new video ones overwrite the audio ones.

Should we change it to the video ones, and remove the audio?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@clin1234 clin1234 Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, they're both official MIME types: iana.org/assignments/media-types/audio/3gpp and iana.org/assignments/media-types/video/3gpp. The only major difference as far as I can tell is that the former cannot contain any visual data

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@clin1234 clin1234 Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, per the official 3GPP TS 26.244 V19.1.0 Specification:

The type "video/3gpp" is valid for all files. It is valid to serve an audio-only file as "video/3gpp".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@clin1234 clin1234 Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And per this RFC: https://www.rfc-editor.org/info/rfc4393/#section-3.2

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@clin1234 clin1234 Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, remove the audio

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
'.m4s' : 'video/iso.segment',
'.lot' : 'video/lottie+json',
'.mkv' : 'video/matroska',
'.mk3d' : 'video/matroska-3d',
'.mj2' : 'video/mj2',
'.mp4' : 'video/mp4',
'.mpeg' : 'video/mpeg',
'.m1v' : 'video/mpeg',
Expand All @@ -700,6 +705,12 @@ def _default_mime_types():
'.ogv' : 'video/ogg',
'.mov' : 'video/quicktime',
'.qt' : 'video/quicktime',
'.pyv' : 'video/vnd.ms-playready.media.pyv',
'.blk' : 'video/vnd.radgamettools.bink',
'.bk2' : 'video/vnd.radgamettools.bink',
'.sswf' : 'video/vnd.sealed.swf',
'.ssw' : 'video/vnd.sealed.swf',
'.yt' : 'video/vnd.youtube.yt',
'.webm' : 'video/webm',
'.avi' : 'video/vnd.avi',
'.m4v' : 'video/x-m4v',
Expand Down
13 changes: 13 additions & 0 deletions 13 Misc/NEWS.d/next/Library/2026-03-23-20-14-57.gh-issue-146341.JSTJlL.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Add the following MIME types corresponding to file extensions:

``.3gp`` for ``video/3gpp``
``.3g2`` for ``video/3gpp2``
``.m4s`` for ``video/iso.segment``
``.lot`` for ``video/lottie+json``
``.mj2`` for ``video/mj2``
``.pyv`` for ``video/vnd.ms-playready.media.pyv``
``.blk`` and ``.bk2`` for ``video/vnd.radgamettools.bink``
``.sswf`` and ``.ssw`` for ``video/vnd.sealed.swf``
``.yt`` for ``video/vnd.youtube.yt``

(Contributed by Charlie Lin in :gh:`146342`.)
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.