def extract_twitter_username(username_or_url):
split_url = urlsplit(username_or_url)
if split_url.netloc == 'twitter.com':
return re.sub(r'^/([^/]+).*', r'\1', split_url.path)
return username_or_url.strip().lstrip('@')
base.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录