App checklist
What people expect from a put.io app.
Our own apps follow this list. Their source shows how.
Sign-in
- Open OAuth in the system browser, not in a web view.
- Send a random
statewith each OAuth request. Reject a callback whosestatedoes not match. - On a TV, show the device-link code large and poll every few seconds. When the code expires, offer a new one.
- Keep the token in the platform’s secure store, such as Keychain or Keystore.
- Sign the person out only on a
401or when they ask. Keep the token on network errors,429and5xx.
Playback
- Resume from
start_fromwhen the account hasuse_start_fromon, and offer to start over. - Prefer HLS. When a file needs an MP4, show the conversion progress and stop polling when the screen closes.
- Load subtitles from
/files/{id}/subtitlesin the account’s languages. - Keep the video playing when a subtitle or audio track fails to load.
- When a stream URL expires, fetch a new one once before you show an error.
Files and transfers
- Page long lists with
per_pageand the/continueendpoints. - Poll transfers only while your app is on screen.
- Respect
trash_enabled, and confirm before you delete anything for good. - Download to the person’s own device, not through your servers. Downloads from many addresses look like a shared account.
- Keep offline copies across restarts, and free the space when the person removes one.
TV
- Show one clear focus at a time.
- Back closes the top layer first, and focus returns to where the person was.
- A playback error always offers a way back.
Errors and privacy
- On a
429, wait untilX-RateLimit-Reset. IfX-RateLimit-Actioniscaptcha-needed, send the person to put.io to clear it. - Time out requests, and retry only a few times.
- Show a readable message, never raw API error text.
- Keep tokens, file names, URLs and search text out of logs, crash reports and analytics.