{"id":35165263,"url":"https://github.com/mayerwin/trakt-tv-backup","last_synced_at":"2026-04-28T09:07:39.946Z","repository":{"id":329255980,"uuid":"1118786100","full_name":"mayerwin/trakt-tv-backup","owner":"mayerwin","description":"A standalone PowerShell script to backup your entire Trakt.tv profile (history, watchlist, ratings, lists, and comments) to JSON (zipped archive) using the OAuth Device Flow.","archived":false,"fork":false,"pushed_at":"2025-12-18T10:02:47.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T16:53:30.076Z","etag":null,"topics":["api","automation","backup","data-export","json","movies","powershell","trakt","trakt-api","trakt-tv","tv-shows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mayerwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-18T09:23:03.000Z","updated_at":"2025-12-18T09:49:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mayerwin/trakt-tv-backup","commit_stats":null,"previous_names":["mayerwin/trakt-tv-backup"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mayerwin/trakt-tv-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Ftrakt-tv-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Ftrakt-tv-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Ftrakt-tv-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Ftrakt-tv-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mayerwin","download_url":"https://codeload.github.com/mayerwin/trakt-tv-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayerwin%2Ftrakt-tv-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32373589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","automation","backup","data-export","json","movies","powershell","trakt","trakt-api","trakt-tv","tv-shows"],"created_at":"2025-12-28T19:28:03.091Z","updated_at":"2026-04-28T09:07:39.939Z","avatar_url":"https://github.com/mayerwin.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trakt.tv Backup Script (PowerShell)\n\nA standalone, single-file PowerShell script to backup your entire [Trakt.tv](https://trakt.tv) user profile. \n\nIt uses the **OAuth Device Flow** for authentication, meaning you can run it purely from the command line without needing a web server or complex callback URLs.\n\n## 🚀 Features\n\n* **Zero Dependencies:** Runs on standard PowerShell (Windows/Linux/macOS).\n* **Complete Backup:** Downloads data that standard CSV exports miss:\n    * Watchlist, Ratings, Collection, Watched History\n    * **Custom Lists** (including the items inside them)\n    * Comments, Likes, Social Graph (Friends/Following)\n    * Account Settings \u0026 Playback Progress\n* **Self-Healing:** Automatically handles token refreshing. Run it once to authorize, and it will keep working forever (as long as it runs at least once every 3 months).\n* **Smart Pagination:** Handles large libraries by automatically looping through pages.\n* **Portable:** Creates a neat `.zip` file with all your data.\n\n## 🛠️ Setup\n\n### 1. Create a Trakt API App\nTo use this script, you (or the user) need a Client ID and Secret from Trakt.\n1.  Go to [Trakt API Applications](https://trakt.tv/oauth/applications).\n2.  Click **New Application**.\n3.  **Name:** `My Backup Script` (or anything you like).\n4.  **Redirect URI:** `urn:ietf:wg:oauth:2.0:oob` (Important!).\n5.  Save the app.\n6.  Copy the **Client ID** and **Client Secret**.\n\n### 2. Installation\nClone this repository or download the script.\n```powershell\ngit clone [https://github.com/YOUR_USERNAME/trakt-powershell-backup.git](https://github.com/YOUR_USERNAME/trakt-powershell-backup.git)\ncd trakt-powershell-backup\n```\n\n## 💻 Usage\n\n### First Run (Authentication)\nRun the script passing your credentials. You will be prompted to visit a URL and enter a code to authorize the script.\n\n```powershell\n.\\trakt_backup.ps1 -ClientId \"YOUR_CLIENT_ID\" -ClientSecret \"YOUR_CLIENT_SECRET\"\n```\n\nOnce authorized, the script will:\n1.  Save your tokens securely to `trakt_secrets.json`.\n2.  Perform the first full backup.\n3.  Generate a `.zip` file in the same folder.\n\n### Subsequent Runs (Automation)\nFor future runs, you do not need to provide arguments. The script will load the saved tokens from `trakt_secrets.json`.\n\n```powershell\n.\\trakt_backup.ps1\n```\n\nIf the access token is expired, the script will automatically use the refresh token to get a new one and update the `trakt_secrets.json` file.\n\n## 🤖 Automation (Windows Task Scheduler)\nYou can set this to run weekly or monthly.\n\n1.  Open **Task Scheduler**.\n2.  Create a Basic Task.\n3.  **Action:** Start a Program.\n4.  **Program/script:** `powershell.exe`\n5.  **Add arguments:** `-ExecutionPolicy Bypass -File \"C:\\Path\\To\\trakt_backup.ps1\"`\n6.  **Start in:** `C:\\Path\\To\\` (Important: must be the folder containing the secrets file).\n\n## 🔒 Security Note\n* **trakt_secrets.json**: This file contains your access credentials. **NEVER** share this file or commit it to GitHub.\n* **Backups**: The generated `.zip` files contain your personal viewing history.\n\n## 📄 License\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayerwin%2Ftrakt-tv-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayerwin%2Ftrakt-tv-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayerwin%2Ftrakt-tv-backup/lists"}