Skip to main content

Python client for Upload-Post.com API

Project description

upload-post Python Client

A Python client for the Upload-Post.com API, designed to facilitate interaction with the service. Upload-Post.com allows you to upload videos to multiple social media platforms simultaneously.

PyPI version Python Versions

Features

  • 🚀 Upload videos to TikTok, Instagram, LinkedIn, YouTube, Facebook, X (Twitter), Threads, and Pinterest (platform support based on API availability)
  • 🖼️ Upload photos to TikTok, Instagram, LinkedIn, Facebook, X (Twitter), Threads, and Pinterest
  • ✍️ Upload text posts to LinkedIn, X (Twitter), Facebook, and Threads
  • 🔒 Secure API key authentication
  • 📁 File validation and error handling
  • 📊 Detailed logging
  • 🤖 Both CLI and Python API interfaces

Installation

pip install upload-post

Usage

Command Line Interface

upload-post \
  --api-key "your_api_key_here" \
  --video "/path/to/video.mp4" \
  --title "My Awesome Video" \
  --user "testuser" \
  --platforms tiktok instagram

Python API

from upload_post import UploadPostClient, UploadPostError
from pathlib import Path

# Initialize client
client = UploadPostClient(api_key="your_api_key_here")

# Example: Upload a video
try:
    response_video = client.upload_video(
        video_path="/path/to/video.mp4", # Can also be a URL: "https://example.com/video.mp4"
        title="My Awesome Video",
        user="testuser",
        platforms=["tiktok", "youtube", "linkedin"],
        # TikTok specific
        privacy_level="PUBLIC_TO_EVERYONE",
        disable_comment=False,
        # YouTube specific
        description="Detailed description for YouTube",
        tags=["tutorial", "python", "api"],
        categoryId="22", # "People & Blogs"
        privacyStatus="public",
        # LinkedIn specific
        visibility="PUBLIC", # Required for LinkedIn if not using default
        description="Post commentary for LinkedIn" # Optional, uses title if not set
    )
    print(f"Video upload successful: {response_video}")
except UploadPostError as e:
    print(f"Video upload failed: {e}")

# Example: Upload photos
try:
    response_photos = client.upload_photos(
        photos=["/path/to/image1.jpg", Path("/path/to/image2.png"), "https://example.com/photo3.jpg"],
        user="testuser",
        platforms=["instagram", "facebook"],
        title="My Photo Album",
        caption="Check out these cool photos!",
        # Platform-specific parameters
        facebook_page_id="your_facebook_page_id", # Required for Facebook
        media_type="IMAGE" # For Instagram, "IMAGE" or "STORIES"
    )
    print(f"Photo upload successful: {response_photos}")
except UploadPostError as e:
    print(f"Photo upload failed: {e}")

# Example: Upload a text post
try:
    response_text = client.upload_text(
        user="testuser",
        platforms=["x", "linkedin"],
        title="This is my awesome text post! #Python #API",
        # Platform-specific parameters
        # For LinkedIn, if posting to an organization page:
        # target_linkedin_page_id="your_linkedin_page_id",
        # For Facebook, facebook_page_id is required:
        # facebook_page_id="your_facebook_page_id" 
        # (add 'facebook' to platforms list too)
    )
    print(f"Text post successful: {response_text}")
except UploadPostError as e:
    print(f"Text post failed: {e}")

Error Handling

The client raises UploadPostError exceptions for API errors. Common error scenarios:

  • Invalid API key
  • Missing required parameters
  • File not found
  • Platform not supported
  • API rate limits exceeded

Documentation

For full API documentation and platform availability, see the official Upload-Post.com documentation.

License

MIT License - See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upload_post-0.1.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upload_post-0.1.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file upload_post-0.1.2.tar.gz.

File metadata

  • Download URL: upload_post-0.1.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for upload_post-0.1.2.tar.gz
Algorithm Hash digest
SHA256 46ff5d8f004ce0a34de7776ac9b835c911b0575a62efe0c0816ddf18f6fb4db5
MD5 d2dbcd8964d056b6b54802ba80eefd2f
BLAKE2b-256 1d52b4e750b426cbc5d79371cf80c2539ae908c17a68c34850646c2d0e2e5508

See more details on using hashes here.

File details

Details for the file upload_post-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: upload_post-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for upload_post-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6eb0b3adb48642deaf8cbff9890eddd1a591418f498622f6559d35f39368ccb
MD5 d96e6dafd4cf2c122b7a5858b99602cb
BLAKE2b-256 60a6a09ebafe2f9bdc8515a12a76b60b4a57eb648335075c607ef6f387800237

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page