junshan-kit 2.1.9__py2.py3-none-any.whl → 2.2.0__py2.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.
junshan_kit/meta.py
CHANGED
@@ -202,17 +202,21 @@ class JianguoyunDownloaderFirefox:
|
|
202
202
|
print("❌ Failed to find or click the download button:", e)
|
203
203
|
raise
|
204
204
|
|
205
|
-
|
206
205
|
def wait_for_download(self, timeout=3600):
|
206
|
+
"""Wait until all downloads are finished (auto-detects browser type)."""
|
207
207
|
print("⏳ Waiting for downloads to finish...")
|
208
208
|
start_time = time.time()
|
209
|
+
|
210
|
+
# Determine the temporary file extension based on the browser type
|
211
|
+
temp_ext = ".crdownload" if "chrome" in self.driver.capabilities["browserName"].lower() else ".part"
|
212
|
+
|
209
213
|
while time.time() - start_time < timeout:
|
210
|
-
|
211
|
-
if
|
214
|
+
downloading = [f for f in os.listdir(self.download_path) if f.endswith(temp_ext)]
|
215
|
+
if not downloading:
|
212
216
|
print("✅ Download completed!")
|
213
|
-
return
|
214
|
-
time.sleep(
|
215
|
-
|
217
|
+
return True
|
218
|
+
time.sleep(2)
|
219
|
+
|
216
220
|
|
217
221
|
def close(self):
|
218
222
|
print("🛑 Closing browser...")
|
@@ -235,14 +239,14 @@ class JianguoyunDownloaderFirefox:
|
|
235
239
|
# MAIN
|
236
240
|
# =============================================================
|
237
241
|
|
238
|
-
|
239
|
-
|
242
|
+
if __name__ == "__main__":
|
243
|
+
url = "https://www.jianguoyun.com/p/DdyHJxUQqdHDDRjvtI0GIAA"
|
240
244
|
|
241
|
-
|
245
|
+
use_chrome = True # Set True to use Chrome, False for Firefox
|
242
246
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
+
if use_chrome:
|
248
|
+
downloader = JianguoyunDownloaderChrome(url)
|
249
|
+
else:
|
250
|
+
downloader = JianguoyunDownloaderFirefox(url)
|
247
251
|
|
248
|
-
|
252
|
+
downloader.run()
|
@@ -1,8 +1,8 @@
|
|
1
1
|
junshan_kit/DataProcessor.py,sha256=AW_1jROexC3s41-RgzqzYVwPI0sOf3tzjiph4qa_Vcw,3882
|
2
2
|
junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
junshan_kit/datahub.py,sha256=I34e26psFS8WK4X6SNucKPLtdBm0Ujzqa0VDIRACah4,5163
|
4
|
-
junshan_kit/meta.py,sha256=
|
4
|
+
junshan_kit/meta.py,sha256=5aHyUPVr3P3yoAdC4DzOZv4AtaO9iX8zGjluwpOly6Q,10017
|
5
5
|
junshan_kit/test.py,sha256=uSckjcr_Wgj__YPTwD6x0GY8Hfn5GBEXIpRf9vIYBbU,91
|
6
|
-
junshan_kit-2.
|
7
|
-
junshan_kit-2.
|
8
|
-
junshan_kit-2.
|
6
|
+
junshan_kit-2.2.0.dist-info/METADATA,sha256=aWDiR4w_Z7sVVrLcqjQNYgt3L-iFWSydzcoiUPqDsg8,329
|
7
|
+
junshan_kit-2.2.0.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
8
|
+
junshan_kit-2.2.0.dist-info/RECORD,,
|
File without changes
|