File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -364,18 +364,15 @@ async def fetch_title(s: aiohttp.ClientSession, url):
364
364
else :
365
365
domain2 = ''
366
366
async with aiohttp .ClientSession (headers = _headers ) as session :
367
- tasks = []
368
367
if domain :
369
368
url_domain = f"{ parsed_url .scheme } ://{ domain } "
370
- tasks .append (fetch_title (session , url_domain ))
371
- if domain2 :
369
+ domain_title = await fetch_title (session , url_domain )
370
+
371
+ if not domain_title :
372
372
url_subdomain = f"{ parsed_url .scheme } ://{ domain2 } "
373
- tasks . append ( fetch_title (session , url_subdomain ) )
373
+ await fetch_title (session , url_subdomain )
374
374
375
- results = await asyncio .gather (* tasks )
376
- domain_title = results [0 ] if len (results ) > 0 else ""
377
- domain_title2 = results [1 ] if len (results ) > 1 else ""
378
- site_title = domain_title or domain_title2 or ""
375
+ site_title = domain_title or ""
379
376
return site_title
380
377
381
378
@logger .catch ()
You can’t perform that action at this time.
0 commit comments