upload-post 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- upload_post-0.1.0/PKG-INFO +94 -0
- upload_post-0.1.0/README.md +70 -0
- upload_post-0.1.0/setup.cfg +4 -0
- upload_post-0.1.0/setup.py +31 -0
- upload_post-0.1.0/upload_post/__init__.py +4 -0
- upload_post-0.1.0/upload_post/api_client.py +70 -0
- upload_post-0.1.0/upload_post/cli.py +52 -0
- upload_post-0.1.0/upload_post.egg-info/PKG-INFO +94 -0
- upload_post-0.1.0/upload_post.egg-info/SOURCES.txt +11 -0
- upload_post-0.1.0/upload_post.egg-info/dependency_links.txt +1 -0
- upload_post-0.1.0/upload_post.egg-info/entry_points.txt +2 -0
- upload_post-0.1.0/upload_post.egg-info/requires.txt +2 -0
- upload_post-0.1.0/upload_post.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: upload-post
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client for Upload-Post.com API
|
|
5
|
+
Home-page: https://www.upload-post.com/
|
|
6
|
+
Author: Manuel Gracia
|
|
7
|
+
Author-email: hi@img2html.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests>=2.25.1
|
|
14
|
+
Requires-Dist: python-dotenv>=0.19.0
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
24
|
+
|
|
25
|
+
# upload-post Python Client
|
|
26
|
+
|
|
27
|
+
A Python client for Upload-Post.com API - upload videos to multiple social media platforms simultaneously.
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/upload-post/)
|
|
30
|
+
[](https://pypi.org/project/upload-post/)
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- 🚀 Upload videos to TikTok, Instagram, Facebook, and YouTube (platform support based on API availability)
|
|
35
|
+
- 🔒 Secure API key authentication
|
|
36
|
+
- 📁 File validation and error handling
|
|
37
|
+
- 📊 Detailed logging
|
|
38
|
+
- 🤖 Both CLI and Python API interfaces
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install upload-post
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
### Command Line Interface
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
upload-post \
|
|
52
|
+
--api-key "your_api_key_here" \
|
|
53
|
+
--video "/path/to/video.mp4" \
|
|
54
|
+
--title "My Awesome Video" \
|
|
55
|
+
--user "testuser" \
|
|
56
|
+
--platforms tiktok instagram
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Python API
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from upload_post import UploadPostClient
|
|
63
|
+
|
|
64
|
+
client = UploadPostClient(api_key="your_api_key_here")
|
|
65
|
+
|
|
66
|
+
response = client.upload_video(
|
|
67
|
+
video_path="/path/to/video.mp4",
|
|
68
|
+
title="My Awesome Video",
|
|
69
|
+
user="testuser",
|
|
70
|
+
platforms=["tiktok", "instagram"]
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Error Handling
|
|
75
|
+
|
|
76
|
+
The client raises `UploadPostError` exceptions for API errors. Common error scenarios:
|
|
77
|
+
|
|
78
|
+
- Invalid API key
|
|
79
|
+
- Missing required parameters
|
|
80
|
+
- File not found
|
|
81
|
+
- Platform not supported
|
|
82
|
+
- API rate limits exceeded
|
|
83
|
+
|
|
84
|
+
## Documentation
|
|
85
|
+
|
|
86
|
+
For full API documentation and platform availability, see the official [Upload-Post.com documentation](https://www.upload-post.com/).
|
|
87
|
+
|
|
88
|
+
## Contributing
|
|
89
|
+
|
|
90
|
+
Contributions are welcome! Please open an issue or PR on our [GitHub repository](https://github.com/yourusername/upload-post-client).
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT License - See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# upload-post Python Client
|
|
2
|
+
|
|
3
|
+
A Python client for Upload-Post.com API - upload videos to multiple social media platforms simultaneously.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/upload-post/)
|
|
6
|
+
[](https://pypi.org/project/upload-post/)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 🚀 Upload videos to TikTok, Instagram, Facebook, and YouTube (platform support based on API availability)
|
|
11
|
+
- 🔒 Secure API key authentication
|
|
12
|
+
- 📁 File validation and error handling
|
|
13
|
+
- 📊 Detailed logging
|
|
14
|
+
- 🤖 Both CLI and Python API interfaces
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install upload-post
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Command Line Interface
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
upload-post \
|
|
28
|
+
--api-key "your_api_key_here" \
|
|
29
|
+
--video "/path/to/video.mp4" \
|
|
30
|
+
--title "My Awesome Video" \
|
|
31
|
+
--user "testuser" \
|
|
32
|
+
--platforms tiktok instagram
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Python API
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from upload_post import UploadPostClient
|
|
39
|
+
|
|
40
|
+
client = UploadPostClient(api_key="your_api_key_here")
|
|
41
|
+
|
|
42
|
+
response = client.upload_video(
|
|
43
|
+
video_path="/path/to/video.mp4",
|
|
44
|
+
title="My Awesome Video",
|
|
45
|
+
user="testuser",
|
|
46
|
+
platforms=["tiktok", "instagram"]
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Error Handling
|
|
51
|
+
|
|
52
|
+
The client raises `UploadPostError` exceptions for API errors. Common error scenarios:
|
|
53
|
+
|
|
54
|
+
- Invalid API key
|
|
55
|
+
- Missing required parameters
|
|
56
|
+
- File not found
|
|
57
|
+
- Platform not supported
|
|
58
|
+
- API rate limits exceeded
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
For full API documentation and platform availability, see the official [Upload-Post.com documentation](https://www.upload-post.com/).
|
|
63
|
+
|
|
64
|
+
## Contributing
|
|
65
|
+
|
|
66
|
+
Contributions are welcome! Please open an issue or PR on our [GitHub repository](https://github.com/yourusername/upload-post-client).
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT License - See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from setuptools import find_packages, setup
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="upload-post",
|
|
8
|
+
version="0.1.0",
|
|
9
|
+
author="Manuel Gracia",
|
|
10
|
+
author_email="hi@img2html.com",
|
|
11
|
+
description="Python client for Upload-Post.com API",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
url="https://www.upload-post.com/",
|
|
15
|
+
packages=find_packages(),
|
|
16
|
+
install_requires=[
|
|
17
|
+
"requests>=2.25.1",
|
|
18
|
+
"python-dotenv>=0.19.0",
|
|
19
|
+
],
|
|
20
|
+
classifiers=[
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
],
|
|
25
|
+
python_requires=">=3.8",
|
|
26
|
+
entry_points={
|
|
27
|
+
"console_scripts": [
|
|
28
|
+
"upload-post=upload_post.cli:main",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Dict, List, Union
|
|
4
|
+
|
|
5
|
+
class UploadPostError(Exception):
|
|
6
|
+
"""Base exception for Upload-Post API errors"""
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
class UploadPostClient:
|
|
10
|
+
BASE_URL = "https://api.upload-post.com/api"
|
|
11
|
+
|
|
12
|
+
def __init__(self, api_key: str):
|
|
13
|
+
self.api_key = api_key
|
|
14
|
+
self.session = requests.Session()
|
|
15
|
+
self.session.headers.update({
|
|
16
|
+
"Authorization": f"Apikey {self.api_key}",
|
|
17
|
+
"User-Agent": f"upload-post-python-client/0.1.0"
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
def upload_video(
|
|
21
|
+
self,
|
|
22
|
+
video_path: Union[str, Path],
|
|
23
|
+
title: str,
|
|
24
|
+
user: str,
|
|
25
|
+
platforms: List[str]
|
|
26
|
+
) -> Dict:
|
|
27
|
+
"""
|
|
28
|
+
Upload a video to specified social media platforms
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
video_path: Path to video file
|
|
32
|
+
title: Video title
|
|
33
|
+
user: User identifier
|
|
34
|
+
platforms: List of platforms (e.g. ["tiktok", "instagram"])
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
API response JSON
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
UploadPostError: If upload fails
|
|
41
|
+
"""
|
|
42
|
+
video_path = Path(video_path)
|
|
43
|
+
if not video_path.exists():
|
|
44
|
+
raise UploadPostError(f"Video file not found: {video_path}")
|
|
45
|
+
|
|
46
|
+
try:
|
|
47
|
+
with video_path.open("rb") as video_file:
|
|
48
|
+
files = {"video": video_file}
|
|
49
|
+
data = {
|
|
50
|
+
"title": title,
|
|
51
|
+
"user": user,
|
|
52
|
+
"platform[]": platforms
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
response = self.session.post(
|
|
56
|
+
f"{self.BASE_URL}/upload",
|
|
57
|
+
files=files,
|
|
58
|
+
data=data
|
|
59
|
+
)
|
|
60
|
+
response.raise_for_status()
|
|
61
|
+
return response.json()
|
|
62
|
+
|
|
63
|
+
except requests.exceptions.RequestException as e:
|
|
64
|
+
raise UploadPostError(
|
|
65
|
+
f"API request failed: {str(e)}"
|
|
66
|
+
) from e
|
|
67
|
+
except (ValueError, TypeError) as e:
|
|
68
|
+
raise UploadPostError(
|
|
69
|
+
f"Invalid response format: {str(e)}"
|
|
70
|
+
) from e
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import logging
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import List
|
|
5
|
+
from . import UploadPostClient, UploadPostError
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
parser = argparse.ArgumentParser(
|
|
11
|
+
description="Upload videos to multiple social platforms via Upload-Post.com API"
|
|
12
|
+
)
|
|
13
|
+
parser.add_argument("--api-key", required=True, help="API authentication key")
|
|
14
|
+
parser.add_argument("--video", required=True, type=Path, help="Path to video file")
|
|
15
|
+
parser.add_argument("--title", required=True, help="Video title")
|
|
16
|
+
parser.add_argument("--user", required=True, help="User identifier")
|
|
17
|
+
parser.add_argument(
|
|
18
|
+
"--platforms",
|
|
19
|
+
nargs="+",
|
|
20
|
+
required=True,
|
|
21
|
+
choices=["tiktok", "instagram", "facebook", "youtube"],
|
|
22
|
+
help="Platforms to upload to"
|
|
23
|
+
)
|
|
24
|
+
parser.add_argument(
|
|
25
|
+
"--verbose",
|
|
26
|
+
action="store_true",
|
|
27
|
+
help="Enable verbose logging"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
args = parser.parse_args()
|
|
31
|
+
|
|
32
|
+
logging.basicConfig(
|
|
33
|
+
level=logging.DEBUG if args.verbose else logging.INFO,
|
|
34
|
+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
client = UploadPostClient(api_key=args.api_key)
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
response = client.upload_video(
|
|
41
|
+
video_path=args.video,
|
|
42
|
+
title=args.title,
|
|
43
|
+
user=args.user,
|
|
44
|
+
platforms=args.platforms
|
|
45
|
+
)
|
|
46
|
+
logger.info(f"Upload successful! Response: {response}")
|
|
47
|
+
except UploadPostError as e:
|
|
48
|
+
logger.error(f"Upload failed: {str(e)}")
|
|
49
|
+
raise SystemExit(1) from e
|
|
50
|
+
|
|
51
|
+
if __name__ == "__main__":
|
|
52
|
+
main()
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: upload-post
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client for Upload-Post.com API
|
|
5
|
+
Home-page: https://www.upload-post.com/
|
|
6
|
+
Author: Manuel Gracia
|
|
7
|
+
Author-email: hi@img2html.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests>=2.25.1
|
|
14
|
+
Requires-Dist: python-dotenv>=0.19.0
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: requires-python
|
|
23
|
+
Dynamic: summary
|
|
24
|
+
|
|
25
|
+
# upload-post Python Client
|
|
26
|
+
|
|
27
|
+
A Python client for Upload-Post.com API - upload videos to multiple social media platforms simultaneously.
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/upload-post/)
|
|
30
|
+
[](https://pypi.org/project/upload-post/)
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- 🚀 Upload videos to TikTok, Instagram, Facebook, and YouTube (platform support based on API availability)
|
|
35
|
+
- 🔒 Secure API key authentication
|
|
36
|
+
- 📁 File validation and error handling
|
|
37
|
+
- 📊 Detailed logging
|
|
38
|
+
- 🤖 Both CLI and Python API interfaces
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install upload-post
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
### Command Line Interface
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
upload-post \
|
|
52
|
+
--api-key "your_api_key_here" \
|
|
53
|
+
--video "/path/to/video.mp4" \
|
|
54
|
+
--title "My Awesome Video" \
|
|
55
|
+
--user "testuser" \
|
|
56
|
+
--platforms tiktok instagram
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Python API
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from upload_post import UploadPostClient
|
|
63
|
+
|
|
64
|
+
client = UploadPostClient(api_key="your_api_key_here")
|
|
65
|
+
|
|
66
|
+
response = client.upload_video(
|
|
67
|
+
video_path="/path/to/video.mp4",
|
|
68
|
+
title="My Awesome Video",
|
|
69
|
+
user="testuser",
|
|
70
|
+
platforms=["tiktok", "instagram"]
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Error Handling
|
|
75
|
+
|
|
76
|
+
The client raises `UploadPostError` exceptions for API errors. Common error scenarios:
|
|
77
|
+
|
|
78
|
+
- Invalid API key
|
|
79
|
+
- Missing required parameters
|
|
80
|
+
- File not found
|
|
81
|
+
- Platform not supported
|
|
82
|
+
- API rate limits exceeded
|
|
83
|
+
|
|
84
|
+
## Documentation
|
|
85
|
+
|
|
86
|
+
For full API documentation and platform availability, see the official [Upload-Post.com documentation](https://www.upload-post.com/).
|
|
87
|
+
|
|
88
|
+
## Contributing
|
|
89
|
+
|
|
90
|
+
Contributions are welcome! Please open an issue or PR on our [GitHub repository](https://github.com/yourusername/upload-post-client).
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT License - See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
setup.py
|
|
3
|
+
upload_post/__init__.py
|
|
4
|
+
upload_post/api_client.py
|
|
5
|
+
upload_post/cli.py
|
|
6
|
+
upload_post.egg-info/PKG-INFO
|
|
7
|
+
upload_post.egg-info/SOURCES.txt
|
|
8
|
+
upload_post.egg-info/dependency_links.txt
|
|
9
|
+
upload_post.egg-info/entry_points.txt
|
|
10
|
+
upload_post.egg-info/requires.txt
|
|
11
|
+
upload_post.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
upload_post
|