Metadata-Version: 2.4
Name: omnipost-tiktok-creator
Version: 0.1.0rc1
Summary: Local TikTok creator workflow for Omnipost
License: MIT License
        
        Copyright (c) 2026 Omnipost Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Omnipost TikTok Creator (pre-release candidate)

This is a **`0.1.0rc1` preview** for a local-first TikTok creator package. It does not claim that TikTok has approved Omnipost for Production or that the Production OAuth broker is operating.

The current public API capability depends on the TikTok app configuration and the user's authorization. Sandbox authorization is for development and does not make videos publicly publishable. Direct Post requires TikTok Production approval and the `video.publish` scope. Do not treat Sandbox draft upload as Direct Post approval.

## Install a reviewed wheel

After a maintainer has built and reviewed the wheel, install it in a Python 3.10+ environment:

```sh
python -m venv .venv
. .venv/bin/activate
python -m pip install ./dist/omnipost_tiktok_creator-0.1.0rc1-py3-none-any.whl
```

No third-party runtime packages are declared. Build/install tooling may fetch setuptools when needed.

## Maintainer source preparation

Run the allowlist packer on the authorized remote build host after the TikTok source is reviewed and committed. From this folder:

```sh
python3 -B build_candidate.py /path/to/omnipost --output /tmp/omnipost-tiktok-creator-source
(cd /tmp/omnipost-tiktok-creator-source && python3 -m build --wheel)
```

The first command rejects missing, untracked, modified, or staged upstream inputs. The second command builds the wheel into `dist/` and may require the `build` frontend on that remote host. Review the wheel contents before any distribution. Do not use a working copy with credentials, private account data, or unreviewed changes as a release source.

## Configure and run

Before authorizing, configure a TikTok Developer app with the Desktop Login Kit loopback callback `http://127.0.0.1:8765/tiktok/callback/` and the needed Sandbox products/scopes. Add the test account as a Sandbox target user and have that person complete TikTok consent and the Developer Terms when prompted. Use only credentials issued for the app you control. Keep credentials private and use a dedicated OS account. The package stores local tokens under `~/.omnipost/tokens` with owner-only permissions. The Sandbox app client secret is prompted without echo and written to that private directory; never put it on a command line or in a file committed to Git.

```sh
omnipost-tiktok configure-sandbox
omnipost-tiktok authorize-sandbox rewindmap --direct-post
omnipost-tiktok profile rewindmap
omnipost-tiktok creator-info rewindmap
omnipost-tiktok upload-draft rewindmap ./video.mp4
omnipost-tiktok status rewindmap PUBLISH_ID
omnipost-tiktok studio rewindmap
```

The `--direct-post` option asks for `video.publish` as well as Sandbox scopes; it succeeds only if TikTok has enabled that scope for the app. Sandbox still cannot publish public videos. OAuth prints the consent URL; open it yourself in a browser signed into the target TikTok account, complete consent, then return to the terminal. `studio` starts its local server and opens the local interface in a browser by default. Use `--mode production` for the profile, creator-info, draft-upload, and status commands only after Production approval and broker readiness. The studio itself provides Sandbox and Production selection; Production selection is not approval.

`ffprobe` must be installed and available on `PATH` for Direct Post, which checks the selected video's duration. Draft upload does not use that Direct Post duration probe.

OAuth opens the TikTok consent flow and uses the configured loopback callback. A creator must complete TikTok's own consent and review screens. Uploading a draft does not publish it; finish the action in TikTok when its app requires creator confirmation. The local interface binds to the user's machine and should not be exposed to a public network.

The CLI exposes distinct `configure-production` and `authorize-production ACCOUNT_LABEL` commands. They print a warning because Production approval has not been obtained and the server-side OAuth broker has not been verified end to end. `configure-production` accepts only the public client key; the Production client secret belongs on the server and must never be supplied to this package.

## Production status

Production authorization, public Direct Post, and automatic publishing are unavailable until TikTok approves the app and the production server-side OAuth broker is deployed, secured, and verified. The broker's client secret must remain server-side; do not put it in this package, a desktop app, an environment file committed to Git, or a public artifact. The currently configured broker URL is a code setting, not evidence that a working broker exists.

## License

MIT. The distribution must include the repository's `LICENSE` text and copyright notice.

## Release candidate limitations

The source packer fails closed until every upstream source file in `MANIFEST.json` is tracked by Git and clean in both the index and working tree. This is intentional: it prevents this process from silently packaging unreviewed working changes. A maintainer must review and commit the TikTok source before producing an archive. Run the packer from this directory with the Omnipost repository root as its sole argument; it creates a new output directory and refuses to overwrite an existing destination.
