mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 15:14:31 -04:00
better progress output
This commit is contained in:
parent
33ba29ea90
commit
56d382235f
5 changed files with 28 additions and 29 deletions
|
@ -233,8 +233,9 @@ def fetch_page_title(url, default=True):
|
|||
default = url
|
||||
|
||||
try:
|
||||
sys.stdout.write('.')
|
||||
sys.stdout.flush()
|
||||
if SHOW_PROGRESS:
|
||||
sys.stdout.write('.')
|
||||
sys.stdout.flush()
|
||||
html_content = urllib.request.urlopen(url, timeout=10).read().decode('utf-8')
|
||||
match = re.search('<title>(.*?)</title>', html_content)
|
||||
return match.group(1) if match else default or None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue