rfc6266
used to be the perfect tool for this job, but it is no longer working as of recently because of various issues.
The latest fork fixes some of it, but still leaves some unaddressed. Such as the fact that LEPL, a package that rfc6266 depends on, has been abandoned and is no longer compliant with Python 3.5+.
So is there a clean and reliable method for parsing a Content-Disposition header that is still working today?
Note: see this question for issues that can't be easily solved (at least in my opinion) by using a quickly hacked together ad-hoc parser.