qrpa 1.0.91__tar.gz → 1.0.93__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.

Potentially problematic release.


This version of qrpa might be problematic. Click here for more details.

Files changed (37) hide show
  1. {qrpa-1.0.91 → qrpa-1.0.93}/PKG-INFO +1 -1
  2. {qrpa-1.0.91 → qrpa-1.0.93}/pyproject.toml +1 -1
  3. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/fun_excel.py +16 -36
  4. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa.egg-info/PKG-INFO +1 -1
  5. {qrpa-1.0.91 → qrpa-1.0.93}/README.md +0 -0
  6. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/RateLimitedSender.py +0 -0
  7. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/__init__.py +0 -0
  8. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/db_migrator.py +0 -0
  9. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/feishu_bot_app.py +0 -0
  10. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/feishu_client.py +0 -0
  11. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/feishu_logic.py +0 -0
  12. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/fun_base.py +0 -0
  13. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/fun_file.py +0 -0
  14. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/fun_web.py +0 -0
  15. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/fun_win.py +0 -0
  16. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/mysql_module/__init__.py +0 -0
  17. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/mysql_module/shein_product_model.py +0 -0
  18. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/mysql_module/shein_return_order_model.py +0 -0
  19. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/shein_daily_report_model.py +0 -0
  20. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/shein_excel.py +0 -0
  21. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/shein_lib.py +0 -0
  22. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/shein_mysql.py +0 -0
  23. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/shein_sqlite.py +0 -0
  24. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/shein_ziniao.py +0 -0
  25. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/temu_chrome.py +0 -0
  26. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/temu_excel.py +0 -0
  27. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/temu_lib.py +0 -0
  28. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/time_utils.py +0 -0
  29. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/time_utils_example.py +0 -0
  30. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa/wxwork.py +0 -0
  31. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa.egg-info/SOURCES.txt +0 -0
  32. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa.egg-info/dependency_links.txt +0 -0
  33. {qrpa-1.0.91 → qrpa-1.0.93}/qrpa.egg-info/top_level.txt +0 -0
  34. {qrpa-1.0.91 → qrpa-1.0.93}/setup.cfg +0 -0
  35. {qrpa-1.0.91 → qrpa-1.0.93}/setup.py +0 -0
  36. {qrpa-1.0.91 → qrpa-1.0.93}/tests/test_db_migrator.py +0 -0
  37. {qrpa-1.0.91 → qrpa-1.0.93}/tests/test_wxwork.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.0.91
3
+ Version: 1.0.93
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qrpa"
7
- version = "1.0.91"
7
+ version = "1.0.93"
8
8
  description = "qsir's rpa library"
9
9
  authors = [{ name = "QSir", email = "1171725650@qq.com" }]
10
10
  readme = "README.md"
@@ -759,43 +759,23 @@ def download_images_concurrently(image_urls, platform='shein', img_save_dir=None
759
759
  results = list(executor.map(lambda url: download_img_v2(url, platform, img_save_path=img_save_dir), image_urls))
760
760
  return results
761
761
 
762
- def get_chromium_executable():
763
- """
764
- 返回 Chromium 可执行文件路径,兼容 PyInstaller 打包后的 exe
765
- """
766
- # PyInstaller 临时目录
767
- if getattr(sys, 'frozen', False):
768
- base_path = Path(sys._MEIPASS)
769
- else:
770
- base_path = Path(__file__).parent
771
-
772
- # 尝试查找打包后的浏览器文件
773
- possible_path = base_path / "playwright" / "driver" / "package" / "chromium_headless_shell-1169" / "chrome-win" / "headless_shell.exe"
774
- if possible_path.exists():
775
- return str(possible_path)
776
-
777
- # fallback: 系统 Playwright 安装目录
778
- local_appdata = Path(os.environ.get("LOCALAPPDATA", ""))
779
- fallback_path = local_appdata / "ms-playwright" / "chromium" / "chrome-win" / "chrome.exe"
780
- if fallback_path.exists():
781
- return str(fallback_path)
782
-
783
- raise FileNotFoundError("Chromium 可执行文件未找到,请先执行 'playwright install' 下载浏览器。")
784
-
785
762
  def download_img_by_chrome(image_url, save_name):
786
- chromium_path = get_chromium_executable()
787
- with sync_playwright() as p:
788
- browser = p.chromium.launch(headless=True, executable_path=chromium_path) # 运行时可以看到浏览器
789
- context = browser.new_context()
790
- page = context.new_page()
791
- # 直接通过Playwright下载图片
792
- response = page.request.get(image_url)
793
- with open(save_name, 'wb') as f:
794
- f.write(response.body()) # 将下载的内容保存为文件
795
- log(f"图片已通过chrome下载并保存为:{save_name}")
796
- # 关闭浏览器
797
- browser.close()
798
- return save_name
763
+ try:
764
+ with sync_playwright() as p:
765
+ browser = p.chromium.launch(headless=True, executable_path=chromium_path) # 运行时可以看到浏览器
766
+ context = browser.new_context()
767
+ page = context.new_page()
768
+ # 直接通过Playwright下载图片
769
+ response = page.request.get(image_url)
770
+ with open(save_name, 'wb') as f:
771
+ f.write(response.body()) # 将下载的内容保存为文件
772
+ log(f"图片已通过chrome下载并保存为:{save_name}")
773
+ # 关闭浏览器
774
+ browser.close()
775
+ return save_name
776
+ except:
777
+ send_exception()
778
+ return None
799
779
 
800
780
  def download_img_v2(image_url, platform='shein', img_save_path=None):
801
781
  image_url = add_https(image_url)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.0.91
3
+ Version: 1.0.93
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes