jack 1 an în urmă
părinte
comite
290ec75a0f
1 a modificat fișierele cu 18 adăugiri și 8 ștergeri
  1. 18 8
      flaticon/flaticon.py

+ 18 - 8
flaticon/flaticon.py

@@ -13,7 +13,8 @@ import httpx
 from playwright.sync_api import sync_playwright
 
 target = 'flaticon'
-step = 2  # 1 = 获取img链接, 2 = 下载图片, 3 = 1 + 2
+step = 1  # 1 = 获取img链接, 2 = 下载图片, 3 = 1 + 2
+remote_databases = 1
 local_proxy = 0
 title_selector = '#pack-view__inner > section.pack-view__header > h1'  # 获取标题选择器
 img_selector = '#pack-view__inner > section.search-result > ul > li:nth-child({}) > div > a > img'  # 获取图片的url
@@ -22,13 +23,22 @@ not_find_page_selector = '#viewport > div.errorpage.e404 > h1'  # 当无法获
 
 project_root = os.path.join(os.path.abspath(__file__).split('ResourceCollection')[0] + 'ResourceCollection')
 
-psql_params = {
-    "host": "home.erhe.link",
-    "port": 55434,
-    "user": "psql",
-    "password": "psql",
-    "dbname": "collect"
-}
+if remote_databases:
+    psql_params = {
+        "host": "home.erhe.link",
+        "port": 55434,
+        "user": "psql",
+        "password": "psql",
+        "dbname": "collect"
+    }
+else:
+    psql_params = {
+        "host": "192.168.100.146",
+        "port": 5434,
+        "user": "psql",
+        "password": "psql",
+        "dbname": "collect"
+    }
 
 
 def open_browser(target_urls):