Skip to content

Commit 4f16279

Browse files
author
lazero
committed
modify code
1 parent 77d7704 commit 4f16279

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

collect_urls.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import DefaultDict
55
import requests
66
from urllib.parse import urlparse, urlunparse
7-
import rich
7+
# import rich
88

99
# you can check dns for eligible links
1010

@@ -36,10 +36,11 @@
3636
def detect_loop_url(url: str):
3737
ret = False
3838
url_len = len(url)
39-
if url_len % 2 == 0:
40-
# even length
41-
left, right = url[: url_len / 2], url[url_len / 2 :]
42-
ret = left == right
39+
if url:
40+
if url_len % 2 == 0:
41+
# even length
42+
left, right = url[: url_len // 2], url[url_len // 2 :]
43+
ret = left == right
4344
return ret
4445

4546

@@ -216,7 +217,7 @@ def filter_unwanted_hosts_from_urls(urls: list[str]) -> list[str]:
216217
return ret
217218

218219

219-
def collect_all_urls_from_database(app: EmbedApp) -> list[str]:
220+
def collect_all_urls_from_database() -> list[str]:
220221
ret = []
221222
app = EmbedApp()
222223

0 commit comments

Comments
 (0)