rolling-reader 0.6.2__tar.gz → 0.6.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rolling-reader
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Local-first web scraper that automatically rolls through HTTP → browser → JS state extraction
5
5
  License: MIT
6
6
  Requires-Python: >=3.11
@@ -1,27 +1,27 @@
1
- [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "rolling-reader"
7
- version = "0.6.2"
8
- description = "Local-first web scraper that automatically rolls through HTTP → browser → JS state extraction"
9
- readme = "README.md"
10
- license = { text = "MIT" }
11
- requires-python = ">=3.11"
12
- dependencies = [
13
- "httpx>=0.28",
14
- "beautifulsoup4>=4.14",
15
- "typer>=0.12",
16
- "playwright>=1.44",
17
- "trafilatura>=1.12",
18
- ]
19
-
20
- [project.scripts]
21
- rr = "rolling_reader.cli:main"
22
-
23
- [tool.hatch.build.targets.wheel]
24
- packages = ["src/rolling_reader"]
25
-
26
- [tool.hatch.build.targets.sdist]
27
- include = ["src/"]
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "rolling-reader"
7
+ version = "0.6.3"
8
+ description = "Local-first web scraper that automatically rolls through HTTP → browser → JS state extraction"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.11"
12
+ dependencies = [
13
+ "httpx>=0.28",
14
+ "beautifulsoup4>=4.14",
15
+ "typer>=0.12",
16
+ "playwright>=1.44",
17
+ "trafilatura>=1.12",
18
+ ]
19
+
20
+ [project.scripts]
21
+ rr = "rolling_reader.cli:main"
22
+
23
+ [tool.hatch.build.targets.wheel]
24
+ packages = ["src/rolling_reader"]
25
+
26
+ [tool.hatch.build.targets.sdist]
27
+ include = ["src/"]
@@ -324,20 +324,22 @@ def launch_chrome(
324
324
  os.makedirs(profile_dir, exist_ok=True)
325
325
  typer.echo("Starting with a fresh profile (login state cleared).", err=True)
326
326
  else:
327
- # 从真实 Chrome profile 同步 cookies(Chrome 已关闭,安全复制)
328
- synced = _sync_cookies_from_real_profile(str(profile_dir))
329
- if synced:
330
- typer.echo("Synced cookies from your Chrome profile.", err=True)
327
+ # rolling-reader 已有自己的 cookies 直接用,不覆盖
328
+ rr_cookies = os.path.join(profile_dir, "Default", "Network", "Cookies")
329
+ has_own_cookies = os.path.exists(rr_cookies) and os.path.getsize(rr_cookies) > 0
330
+ if has_own_cookies:
331
+ typer.echo("Using your saved login state.", err=True)
331
332
  else:
332
- first_time = not any(os.scandir(profile_dir))
333
- if first_time:
333
+ # 首次运行:从真实 Chrome profile 同步 cookies 作为起点
334
+ synced = _sync_cookies_from_real_profile(str(profile_dir))
335
+ if synced:
336
+ typer.echo("Synced cookies from your Chrome profile.", err=True)
337
+ else:
334
338
  typer.echo(
335
339
  "First run: a new browser profile will open.\n"
336
340
  "Log in to any sites you need — your login state will be saved for next time.",
337
341
  err=True,
338
342
  )
339
- else:
340
- typer.echo("Using saved profile (your logins are preserved).", err=True)
341
343
 
342
344
  args = [
343
345
  exe,
File without changes