def extract_url(self, text):
"""
Extract Hackpad Archive URL from a text
:param text:
:return: the located URL as a string
"""
archive_url = None
regexes = [
re.compile('https:\/\/[A-Za-z0-9\.-]*hackpad-export\.s3[^"]*(?=")'),
re.compile('https:\/\/[A-Za-z0-9\.-]*hackpad-export\.s3[^>]*(?=>)')
]
for r in regexes:
matches = r.findall(text)
if matches:
archive_url = html.unescape(matches[0])
self._logger.info("Located download URL: %s" % archive_url)
break
return archive_url
hackpad_mail_processor.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录