diff --git a/.env.example b/.env.example index 7b3e0bc..c1cc218 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,10 @@ IMDB_COOKIE_UBID_MAIN=133-3657396-5532224 # example: ls517879007,ls084017844,ls093412639 # if value equals to `all` it will auto sync all your lists IMDB_LIST_IDS=all +# IMDb user id can be found within the URL when you have your profile/watchlist/ratings/lists opened (need to be loggen in) +# example: ur90652269 +# if value equals to `scrape` or you omit adding it, your user id will be scraped from the web +IMDB_USER_ID=scrape # Trakt access token for your API app (info in the README file) TRAKT_ACCESS_TOKEN=b89d620b5ef4dcc72a20300fb5e5c0b207b6d42ff9095dd574311b46aca41024 # Trakt client id of your API app (https://trakt.tv/oauth/applications/new) diff --git a/pkg/providers/sync.go b/pkg/providers/sync.go index e0a9ddd..9838a45 100644 --- a/pkg/providers/sync.go +++ b/pkg/providers/sync.go @@ -24,7 +24,10 @@ func Sync() { } func (u *user) populateData(ic *imdb.Client, tc *trakt.Client) { - ic.Config.UserId = ic.UserIdScrape() + ic.Config.UserId = os.Getenv("IMDB_USER_ID") + if ic.Config.UserId == "" || ic.Config.UserId == "scrape" { + ic.Config.UserId = ic.UserIdScrape() + } ic.Config.WatchlistId = ic.WatchlistIdScrape() tc.Config.UserId = tc.UserIdGet() imdbListIdsString := os.Getenv(imdb.ListIdsKey)