Instead of `urlparse(filename)[2]`, can you do `urlparse(filename).path`? It's the same thing, but much clearer to read. You could even split it across two lines:
```python
def get_ext(filename):
    path = urlparse(filename).path)
    return path.rpartition('.')[-1]
```