def ctx_for_video(self, vurl):
        "Get a context dict for a given video URL"
        ctx = self.get_context_dict()
        for portal, match, context_fn in self.PORTALS:
            if match.search(vurl):
                try:
                    ctx.update(context_fn(vurl))
                    ctx["portal"] = portal
                    break
                except AttributeError:
                    continue
        return ctx
Get a context dict for a given video URL
feincms/content/video/models.py