tbr-deal-finder 0.1.3__py3-none-any.whl → 0.1.4__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.
- tbr_deal_finder/retailer/audible.py +34 -3
- {tbr_deal_finder-0.1.3.dist-info → tbr_deal_finder-0.1.4.dist-info}/METADATA +4 -4
- {tbr_deal_finder-0.1.3.dist-info → tbr_deal_finder-0.1.4.dist-info}/RECORD +6 -6
- {tbr_deal_finder-0.1.3.dist-info → tbr_deal_finder-0.1.4.dist-info}/WHEEL +0 -0
- {tbr_deal_finder-0.1.3.dist-info → tbr_deal_finder-0.1.4.dist-info}/entry_points.txt +0 -0
- {tbr_deal_finder-0.1.3.dist-info → tbr_deal_finder-0.1.4.dist-info}/licenses/LICENSE +0 -0
@@ -7,7 +7,7 @@ import readline # type: ignore
|
|
7
7
|
|
8
8
|
import audible
|
9
9
|
import click
|
10
|
-
from audible.login import
|
10
|
+
from audible.login import build_init_cookies
|
11
11
|
|
12
12
|
from tbr_deal_finder import TBR_DEALS_PATH
|
13
13
|
from tbr_deal_finder.config import Config
|
@@ -19,10 +19,41 @@ _AUTH_PATH = TBR_DEALS_PATH.joinpath("audible.json")
|
|
19
19
|
|
20
20
|
def login_url_callback(url: str) -> str:
|
21
21
|
"""Helper function for login with external browsers."""
|
22
|
+
|
22
23
|
try:
|
23
|
-
|
24
|
+
from playwright.sync_api import sync_playwright # type: ignore
|
25
|
+
use_playwright = True
|
24
26
|
except ImportError:
|
25
|
-
|
27
|
+
use_playwright = False
|
28
|
+
|
29
|
+
if use_playwright:
|
30
|
+
with sync_playwright() as p:
|
31
|
+
iphone = p.devices["iPhone 12 Pro"]
|
32
|
+
browser = p.webkit.launch(headless=False)
|
33
|
+
context = browser.new_context(
|
34
|
+
**iphone
|
35
|
+
)
|
36
|
+
cookies = []
|
37
|
+
for name, value in build_init_cookies().items():
|
38
|
+
cookies.append(
|
39
|
+
{
|
40
|
+
"name": name,
|
41
|
+
"value": value,
|
42
|
+
"url": url
|
43
|
+
}
|
44
|
+
)
|
45
|
+
context.add_cookies(cookies)
|
46
|
+
page = browser.new_page()
|
47
|
+
page.goto(url)
|
48
|
+
|
49
|
+
while True:
|
50
|
+
page.wait_for_timeout(600)
|
51
|
+
if "/ap/maplanding" in page.url:
|
52
|
+
response_url = page.url
|
53
|
+
break
|
54
|
+
|
55
|
+
browser.close()
|
56
|
+
return response_url
|
26
57
|
|
27
58
|
message = f"""\
|
28
59
|
Please copy the following url and insert it into a web browser of your choice to log into Amazon.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: tbr-deal-finder
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.4
|
4
4
|
Summary: Track price drops and find deals on books in your TBR list across audiobook and ebook formats.
|
5
5
|
License: MIT
|
6
6
|
License-File: LICENSE
|
@@ -106,7 +106,7 @@ tbr-deal-finder setup
|
|
106
106
|
|
107
107
|
#### UV
|
108
108
|
```sh
|
109
|
-
uv run -m tbr_deal_finder.
|
109
|
+
uv run -m tbr_deal_finder.cli setup
|
110
110
|
```
|
111
111
|
|
112
112
|
You will be prompted to:
|
@@ -131,7 +131,7 @@ tbr-deal-finder [COMMAND]
|
|
131
131
|
|
132
132
|
#### UV
|
133
133
|
```sh
|
134
|
-
uv run -m tbr_deal_finder.
|
134
|
+
uv run -m tbr_deal_finder.cli [COMMAND]
|
135
135
|
```
|
136
136
|
|
137
137
|
Example:
|
@@ -140,7 +140,7 @@ tbr-deal-finder latest-deals
|
|
140
140
|
|
141
141
|
# or
|
142
142
|
|
143
|
-
uv run -m tbr_deal_finder.
|
143
|
+
uv run -m tbr_deal_finder.cli latest-deals
|
144
144
|
```
|
145
145
|
|
146
146
|
## Updating your TBR
|
@@ -10,12 +10,12 @@ tbr_deal_finder/queries/get_active_deals.sql,sha256=jILZK5UVNPLbbKWgqMW0brEZyCb9
|
|
10
10
|
tbr_deal_finder/queries/get_deals_found_at.sql,sha256=1vAE8PsAvfFi0SbvoUw8pvLwRN9VGYTJ7AVI3rmxXEI,122
|
11
11
|
tbr_deal_finder/queries/latest_deal_last_ran_most_recent_success.sql,sha256=W4cNMAHtcW2DzQyPL8SHHFcbVZQKVK2VfTzazxC3LJU,107
|
12
12
|
tbr_deal_finder/retailer/__init__.py,sha256=WePMSN7vi4EL_uPiAH6ogNNE-kRQe4OHT4CYGTKvBSk,243
|
13
|
-
tbr_deal_finder/retailer/audible.py,sha256=
|
13
|
+
tbr_deal_finder/retailer/audible.py,sha256=7z7rDQBcCwOhdATU4BJjsJ-QBP0HnxscMSGPmzN_K2k,4408
|
14
14
|
tbr_deal_finder/retailer/chirp.py,sha256=mi2uIhiXHxMnlRgtd1BZULEZbpF_K2HzxWubV4v_vvc,3540
|
15
15
|
tbr_deal_finder/retailer/librofm.py,sha256=M4WvGh3Gf3LVUE3KOCVtNKJB8koQasgybUFhKBvqBe0,4476
|
16
16
|
tbr_deal_finder/retailer/models.py,sha256=zEwyM_0ildB8p38sxfpE6p2dIvtwAjeaul-GkJlk2Fo,1012
|
17
|
-
tbr_deal_finder-0.1.
|
18
|
-
tbr_deal_finder-0.1.
|
19
|
-
tbr_deal_finder-0.1.
|
20
|
-
tbr_deal_finder-0.1.
|
21
|
-
tbr_deal_finder-0.1.
|
17
|
+
tbr_deal_finder-0.1.4.dist-info/METADATA,sha256=oLSiX7Bb6Spb3DAAxB6cu0qMsWUfk8LnQgLtzGh76Ho,4157
|
18
|
+
tbr_deal_finder-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
19
|
+
tbr_deal_finder-0.1.4.dist-info/entry_points.txt,sha256=y_KG1k8xVCY8gngSZ-na2bkK-tTLUdOc_qZ9Djwldv0,60
|
20
|
+
tbr_deal_finder-0.1.4.dist-info/licenses/LICENSE,sha256=rNc0wNPn4d4HHu6ZheJzeUaz_FbJ4rj2Dr2FjAivkNg,1064
|
21
|
+
tbr_deal_finder-0.1.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|