def get_by_url(self, url):
        m = re.findall(r'(?:https?://)?(?:www\.)?twitter\.com/([^/]+)/?', url)
        if not len(m):
            raise ValueError("Url should be started with https://twitter.com/")

        return self.get_by_slug(m[0])
Return object by url
dataset/ETHPy150Open ramusus/django-twitter-api/twitter_api/models.py/TwitterManager.get_by_url