justwatch_client 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +146 -1
- data/lib/just_watch/version.rb +1 -1
- metadata +9 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9258999fdcefdbe1322c829bf4944680fd7899e15b1849d74c7c35297730d1d
|
4
|
+
data.tar.gz: a987d484a9ad6215c09e1125c83ba7f680628b67dfb5a97307890956a1d37d48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd45ab1f768d972ac1e00870d76d94b9043209a3b503be90116e614afed510eba17919872ccfc77d5d5bed3c5f2dcbb446e8d1faebb07a70f082fd43d19bf75
|
7
|
+
data.tar.gz: d101496d1e9e803bf23763d9f0f0172ca0eadacccdde432da20ebba3e9881a244f0a31643d79e1367fce648afa64f7285b16d9eeedc6ab1137383b42bc90c172
|
data/README.md
CHANGED
@@ -1,2 +1,147 @@
|
|
1
|
-
#
|
1
|
+
# Justwatch client
|
2
|
+
|
2
3
|
Ruby Client for JustWatch API
|
4
|
+
|
5
|
+
## How to configure
|
6
|
+
|
7
|
+
If you are using Rails, the better way is to define an initializer in `config/initializers`, defining the default locale and the token (we encourage to not push the token to the repo).
|
8
|
+
|
9
|
+
```
|
10
|
+
# config/initializers/justwatch.rb
|
11
|
+
|
12
|
+
JustWatch::Api.locale = 'es_ES'
|
13
|
+
JustWatch::Api.token = ENV.fetch('JUSTWATCH_API_TOKEN', nil)
|
14
|
+
```
|
15
|
+
|
16
|
+
The locale defined here is the **default**, you can override it in the different calls.
|
17
|
+
|
18
|
+
## General Provider Info
|
19
|
+
|
20
|
+
We can fetch the data for providers with the following call:
|
21
|
+
|
22
|
+
```
|
23
|
+
JustWatch::Provider.list(locale:)
|
24
|
+
```
|
25
|
+
|
26
|
+
| Parameter | Explanation | Example values |
|
27
|
+
| --- | --- | --- |
|
28
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
29
|
+
|
30
|
+
|
31
|
+
## Genres list
|
32
|
+
|
33
|
+
We can fetch the genre list with the following call:
|
34
|
+
|
35
|
+
```
|
36
|
+
JustWatch::Genre.list(locale:)
|
37
|
+
```
|
38
|
+
|
39
|
+
| Parameter | Explanation | Example values |
|
40
|
+
| --- | --- | --- |
|
41
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
42
|
+
|
43
|
+
|
44
|
+
## Country list
|
45
|
+
|
46
|
+
We can fetch the country list with the following call:
|
47
|
+
|
48
|
+
```
|
49
|
+
JustWatch::Country.list(locale:)
|
50
|
+
```
|
51
|
+
|
52
|
+
| Parameter | Explanation | Example values |
|
53
|
+
| --- | --- | --- |
|
54
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
55
|
+
|
56
|
+
|
57
|
+
## Movie offers by ID
|
58
|
+
|
59
|
+
We can fetch the data for a movie using a service ID with the following call:
|
60
|
+
|
61
|
+
```
|
62
|
+
JustWatch::Movie.offers_by_id(id:, service_id_type:, locale:)
|
63
|
+
```
|
64
|
+
|
65
|
+
| Parameter | Explanation | Example values |
|
66
|
+
| --- | --- | --- |
|
67
|
+
| `id` | TMDB, IMDB or Justwatch ID | `12345`, `tt0125439`, `39130` |
|
68
|
+
| `service_id_type` | Service for which the ID has been provided | `tmdb`, `imdb` or `justwatch` |
|
69
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
70
|
+
|
71
|
+
|
72
|
+
## Movie offers by title and year
|
73
|
+
|
74
|
+
We can fetch the data for a movie using title and year with the following call:
|
75
|
+
|
76
|
+
```
|
77
|
+
JustWatch::Movie.offers_by_title_and_year(title:, year:, locale: Api.locale)
|
78
|
+
```
|
79
|
+
|
80
|
+
| Parameter | Explanation | Example values |
|
81
|
+
| --- | --- | --- |
|
82
|
+
| `title` | Movie title | `12 monkeys`, `The Shining` |
|
83
|
+
| `year` | Movie release year | `1999`, `2021` |
|
84
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
85
|
+
|
86
|
+
## TvShow offers by ID
|
87
|
+
|
88
|
+
We can fetch the data for a tv show using a service ID with the following call:
|
89
|
+
|
90
|
+
```
|
91
|
+
JustWatch::TvShow.offers_by_id(id:, service_id_type:, locale:)
|
92
|
+
```
|
93
|
+
|
94
|
+
| Parameter | Explanation | Example values |
|
95
|
+
| --- | --- | --- |
|
96
|
+
| `id` | TMDB, IMDB or Justwatch ID | `12345`, `tt0125439`, `39130` |
|
97
|
+
| `service_id_type` | Service for which the ID has been provided | `tmdb`, `imdb` or `justwatch` |
|
98
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
99
|
+
|
100
|
+
## TvShow offers by title and year
|
101
|
+
|
102
|
+
We can fetch the data for a tv show using the tv show title and the year with the following call:
|
103
|
+
|
104
|
+
```
|
105
|
+
JustWatch::TvShow.offers_by_title_and_year(title:, year:, locale:)
|
106
|
+
```
|
107
|
+
|
108
|
+
| Parameter | Explanation | Example values |
|
109
|
+
| --- | --- | --- |
|
110
|
+
| `title` | Tv show title | `House`, `Lost` |
|
111
|
+
| `year` | Tv show release year | `2004`, `2021` |
|
112
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
113
|
+
|
114
|
+
## Season offers by id and season number
|
115
|
+
|
116
|
+
We can fetch the data for a season using the tv show ID and the season number with the following call:
|
117
|
+
|
118
|
+
```
|
119
|
+
JustWatch::Season.offers_by_id_and_season_number(id:, service_id_type:, season_number:, locale:)
|
120
|
+
```
|
121
|
+
|
122
|
+
| Parameter | Explanation | Example values |
|
123
|
+
| --- | --- | --- |
|
124
|
+
| `id` | TMDB, IMDB or Justwatch **tv show** ID | `12345`, `tt0125439`, `39130` |
|
125
|
+
| `service_id_type` | Service for which the ID has been provided | `tmdb`, `imdb` or `justwatch` |
|
126
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
127
|
+
|
128
|
+
## Season offers by title, year and season number
|
129
|
+
|
130
|
+
We can fetch the data for a season using the tv show tv show title, year and season number with the following call:
|
131
|
+
|
132
|
+
```
|
133
|
+
JustWatch::Season::offers_by_title_year_and_season_number(title:, year:, season_number:, locale:)
|
134
|
+
```
|
135
|
+
|
136
|
+
| Parameter | Explanation | Example values |
|
137
|
+
| --- | --- | --- |
|
138
|
+
| `title` | Tv show title | `House`, `Lost` |
|
139
|
+
| `year` | Tv show release year | `2004`, `2021` |
|
140
|
+
| `season_number` | Tv show season number | `1`, `2` |
|
141
|
+
| `locale` (optional) | Locale you are searching for | `es_ES`, `en_US` |
|
142
|
+
|
143
|
+
## Troubleshoot
|
144
|
+
|
145
|
+
### Locale
|
146
|
+
|
147
|
+
Your JustWatch account is restricted to a bunch of locales. If you are getting Unauthorized errors this could be the reason.
|
data/lib/just_watch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: justwatch_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alejandro Perea
|
@@ -9,78 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '3'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '1'
|
28
|
-
-
|
29
|
-
name: debug
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '1.6'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '1.6'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: rspec
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '3.11'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '3.11'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rubocop
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '1.36'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '1.36'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: webmock
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - "~>"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '3.18'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - "~>"
|
31
|
+
- - "<"
|
82
32
|
- !ruby/object:Gem::Version
|
83
|
-
version: '3
|
33
|
+
version: '3'
|
84
34
|
description: Ruby API Client for JustWatch.
|
85
35
|
email:
|
86
36
|
- alejandro.perea.fdez@gmail.com
|