urlicon 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {urlicon-0.2.2 → urlicon-0.2.4}/PKG-INFO +2 -2
- {urlicon-0.2.2 → urlicon-0.2.4}/README.md +1 -1
- {urlicon-0.2.2 → urlicon-0.2.4}/pyproject.toml +1 -1
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon/urlicon.py +12 -4
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon.egg-info/PKG-INFO +2 -2
- {urlicon-0.2.2 → urlicon-0.2.4}/setup.cfg +0 -0
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon/urls.py +0 -0
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon.egg-info/SOURCES.txt +0 -0
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon.egg-info/dependency_links.txt +0 -0
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon.egg-info/requires.txt +0 -0
- {urlicon-0.2.2 → urlicon-0.2.4}/src/urlicon.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: urlicon
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: `URLicon` helps you to discover an possible icon from a URL.
|
|
5
5
|
Author-email: Cesar Cardoso <hello@cesarcardoso.cc>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -11,7 +11,7 @@ Requires-Dist: dotenv>=0.9.9
|
|
|
11
11
|
Requires-Dist: requests>=2.32.5
|
|
12
12
|
Requires-Dist: unforgettable
|
|
13
13
|
|
|
14
|
-
# URLicon - v0.2.
|
|
14
|
+
# URLicon - v0.2.4
|
|
15
15
|
|
|
16
16
|
`URLicon` helps you to discover an possible icon from a URL.
|
|
17
17
|
|
|
@@ -40,6 +40,11 @@ def get_url_icon(url):
|
|
|
40
40
|
return get_default_img(text=url)
|
|
41
41
|
|
|
42
42
|
|
|
43
|
+
def get_url_content_file_icon(url):
|
|
44
|
+
icon_url = get_url_icon(url)
|
|
45
|
+
return requests_get(icon_url)
|
|
46
|
+
|
|
47
|
+
|
|
43
48
|
def get_meta_icon_from_url(url, url_soup=None):
|
|
44
49
|
soup_icons, url_soup = get_soup_icons_from_url(url, url_soup)
|
|
45
50
|
|
|
@@ -54,9 +59,9 @@ def get_meta_icon_from_url(url, url_soup=None):
|
|
|
54
59
|
img = final_icon["href"]
|
|
55
60
|
|
|
56
61
|
try:
|
|
57
|
-
url_request = requests_get(
|
|
62
|
+
url_request = requests_get(img)
|
|
58
63
|
except:
|
|
59
|
-
return None
|
|
64
|
+
return None, url_soup
|
|
60
65
|
|
|
61
66
|
if url_request is None:
|
|
62
67
|
img = None
|
|
@@ -88,7 +93,10 @@ def get_soup_icons_from_url(url, url_soup=None):
|
|
|
88
93
|
def get_soup_icon_size(soup_icon):
|
|
89
94
|
if not soup_icon.has_attr("sizes"):
|
|
90
95
|
return 1
|
|
91
|
-
|
|
96
|
+
try:
|
|
97
|
+
return int(soup_icon["sizes"].split("x")[0])
|
|
98
|
+
except:
|
|
99
|
+
return 1
|
|
92
100
|
|
|
93
101
|
|
|
94
102
|
def get_favicon_from_url(url):
|
|
@@ -99,7 +107,7 @@ def get_favicon_from_url(url):
|
|
|
99
107
|
except:
|
|
100
108
|
return None
|
|
101
109
|
|
|
102
|
-
if favicon_request is None or "html" in favicon_request[:150]:
|
|
110
|
+
if favicon_request is None or "html" in str(favicon_request)[:150]:
|
|
103
111
|
return None
|
|
104
112
|
else:
|
|
105
113
|
return favicon
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: urlicon
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: `URLicon` helps you to discover an possible icon from a URL.
|
|
5
5
|
Author-email: Cesar Cardoso <hello@cesarcardoso.cc>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -11,7 +11,7 @@ Requires-Dist: dotenv>=0.9.9
|
|
|
11
11
|
Requires-Dist: requests>=2.32.5
|
|
12
12
|
Requires-Dist: unforgettable
|
|
13
13
|
|
|
14
|
-
# URLicon - v0.2.
|
|
14
|
+
# URLicon - v0.2.4
|
|
15
15
|
|
|
16
16
|
`URLicon` helps you to discover an possible icon from a URL.
|
|
17
17
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|