watchwhere 0.2.0 → 0.2.2
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.
- package/README.md +15 -12
- package/package.json +1 -1
- package/src/commands/search.ts +3 -3
- package/src/tmdb.ts +8 -1
package/README.md
CHANGED
|
@@ -16,33 +16,36 @@ Needs [Bun](https://bun.sh) (≥ 1.1).
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
bun install -g watchwhere
|
|
19
|
-
|
|
20
|
-
ww init # asks for region + your subscriptions
|
|
19
|
+
ww init # asks for region + subscriptions
|
|
21
20
|
ww matrix # search a movie
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
That's it.
|
|
23
|
+
That's it. No TMDB token, no signup — calls go through a hosted proxy by
|
|
24
|
+
default.
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
your `~/.zshrc` or `~/.bashrc`.
|
|
26
|
+
## with your own TMDB token
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Prefer to talk to TMDB directly? Get a free v4 Read Access Token from
|
|
28
|
+
Don't want to use the hosted proxy? Get a free v4 Read Access Token from
|
|
32
29
|
[themoviedb.org/settings/api](https://www.themoviedb.org/settings/api)
|
|
33
|
-
(
|
|
30
|
+
(the **v4 Read Access Token**, not the v3 API key), then:
|
|
34
31
|
|
|
35
32
|
```bash
|
|
36
|
-
|
|
37
|
-
ww init # paste your token, then region + subs
|
|
33
|
+
WATCHWHERE_PROXY=off ww init # asks for token, region, subs
|
|
38
34
|
ww matrix
|
|
39
35
|
```
|
|
40
36
|
|
|
37
|
+
Or point at your own self-hosted proxy:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
export WATCHWHERE_PROXY=https://your-proxy.example.com
|
|
41
|
+
ww init
|
|
42
|
+
```
|
|
43
|
+
|
|
41
44
|
## commands
|
|
42
45
|
|
|
43
46
|
```
|
|
44
47
|
ww <title> search and show providers
|
|
45
|
-
ww init set up
|
|
48
|
+
ww init set up region, subscriptions (and token, if not using proxy)
|
|
46
49
|
ww subs edit subscriptions
|
|
47
50
|
ww lang change UI language (en / tr)
|
|
48
51
|
ww region change region
|
package/package.json
CHANGED
package/src/commands/search.ts
CHANGED
|
@@ -131,15 +131,15 @@ async function displayItem(
|
|
|
131
131
|
const ads = regionData.ads ?? [];
|
|
132
132
|
if (ads.length > 0) {
|
|
133
133
|
console.log();
|
|
134
|
-
console.log(` ${pad(m.ads,
|
|
134
|
+
console.log(` ${pad(m.ads, 10)}${joinNames(ads)}`);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
const rent = regionData.rent ?? [];
|
|
138
138
|
const buy = regionData.buy ?? [];
|
|
139
139
|
if (rent.length > 0 || buy.length > 0) {
|
|
140
140
|
if (ads.length === 0) console.log();
|
|
141
|
-
if (rent.length > 0) console.log(` ${pad(m.rent,
|
|
142
|
-
if (buy.length > 0) console.log(` ${pad(m.buy,
|
|
141
|
+
if (rent.length > 0) console.log(` ${pad(m.rent, 10)}${joinNames(rent)}`);
|
|
142
|
+
if (buy.length > 0) console.log(` ${pad(m.buy, 10)}${joinNames(buy)}`);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
if (regionData.link) {
|
package/src/tmdb.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const HOSTED_PROXY = "https://watchwhere-proxy.ethsmaa.workers.dev";
|
|
2
|
+
const proxyEnv = process.env.WATCHWHERE_PROXY;
|
|
3
|
+
const PROXY =
|
|
4
|
+
proxyEnv === undefined
|
|
5
|
+
? HOSTED_PROXY
|
|
6
|
+
: proxyEnv === "" || proxyEnv === "off"
|
|
7
|
+
? undefined
|
|
8
|
+
: proxyEnv.replace(/\/$/, "");
|
|
2
9
|
const TMDB_BASE = PROXY ? `${PROXY}/tmdb` : "https://api.themoviedb.org/3";
|
|
3
10
|
const FETCH_TIMEOUT_MS = 10_000;
|
|
4
11
|
const DEFAULT_TMDB_LANGUAGE = "en-US";
|