isrpa 0.8.4__py3-none-any.whl → 0.8.6__py3-none-any.whl
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.
isrpa/utils.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
|
3
3
|
import requests
|
4
|
+
import tldextract
|
4
5
|
|
5
6
|
|
6
7
|
def getPath(user_name):
|
@@ -95,10 +96,13 @@ def save_file(url, cookies, file_path):
|
|
95
96
|
"""
|
96
97
|
playwright保存文件
|
97
98
|
"""
|
99
|
+
extracted = tldextract.extract(url)
|
100
|
+
top_level_domain = f"{extracted.domain}.{extracted.suffix}"
|
98
101
|
cookie = {}
|
99
102
|
for item in cookies:
|
100
|
-
|
101
|
-
|
103
|
+
if top_level_domain in item.get("domain"):
|
104
|
+
cookie[item["name"]] = item["value"]
|
105
|
+
response = requests.get(url, cookies=cookie)
|
102
106
|
with open(file_path, 'wb') as file:
|
103
107
|
file.write(response.content)
|
104
108
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: isrpa
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.6
|
4
4
|
Summary: isrpa package
|
5
5
|
Home-page: https://github.com/yourusername/mypackage
|
6
6
|
Author: ysq
|
@@ -10,6 +10,8 @@ Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
11
11
|
Requires-Python: >=3.6
|
12
12
|
Description-Content-Type: text/markdown
|
13
|
+
Requires-Dist: requests
|
14
|
+
Requires-Dist: tldextract
|
13
15
|
|
14
16
|
python setup.py sdist bdist_wheel
|
15
17
|
|
@@ -3,8 +3,8 @@ isrpa/Template.py,sha256=UP1uovLvJzXEPGo_hzLrIYOu3vZP8Cf6m3G2hGzQ6XA,1958
|
|
3
3
|
isrpa/Template_Exception.py,sha256=an6eQ1NMB8a9R-J0yyMdwHIZcZeDtdV5f7fWKZQsZ3s,819
|
4
4
|
isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
|
5
5
|
isrpa/message.py,sha256=N0s6hMaC5S-Pi4EhwcSp-ngfBTBQyW6ymU9sI9dUSeE,11329
|
6
|
-
isrpa/utils.py,sha256=
|
7
|
-
isrpa-0.8.
|
8
|
-
isrpa-0.8.
|
9
|
-
isrpa-0.8.
|
10
|
-
isrpa-0.8.
|
6
|
+
isrpa/utils.py,sha256=o4n_9NwhT-aqed5Bo3TokGBmpeXc3WhmlOjnHSa8N8M,51342
|
7
|
+
isrpa-0.8.6.dist-info/METADATA,sha256=t92gXOOQmjOhtkEKLK-itR9TKkS202IDqi2toVH1G_s,511
|
8
|
+
isrpa-0.8.6.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
9
|
+
isrpa-0.8.6.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
10
|
+
isrpa-0.8.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|