File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ var json = jsoniter.ConfigFastest
21
21
22
22
// TMDb constants
23
23
const (
24
- baseURL = "https://api.themoviedb.org/3"
24
+ defaultBaseURL = "https://api.themoviedb.org/3"
25
+ alternateBaseURL = "https://api.tmdb.org/3"
25
26
permissionURL = "https://www.themoviedb.org/authenticate/"
26
27
authenticationURL = "/authentication/"
27
28
movieURL = "/movie/"
@@ -44,6 +45,8 @@ const (
44
45
watchProvidersURL = "/watch/providers/"
45
46
)
46
47
48
+ var baseURL = defaultBaseURL
49
+
47
50
// Client type is a struct to instantiate this pkg.
48
51
type Client struct {
49
52
// TMDb apiKey to use the client.
@@ -218,6 +221,11 @@ func (c *Client) fmtOptions(
218
221
return options
219
222
}
220
223
224
+ // SetAlternateBaseURL sets an alternate base url.
225
+ func (c * Client ) SetAlternateBaseURL () {
226
+ baseURL = alternateBaseURL
227
+ }
228
+
221
229
// Error type represents an error returned by the TMDB API.
222
230
type Error struct {
223
231
StatusMessage string `json:"status_message,omitempty"`
You can’t perform that action at this time.
0 commit comments