snipp 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.
snipp-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: snipp
3
+ Version: 0.1.0
4
+ Summary: Auto-upload ShadowPlay clips to Snipp.
5
+ Home-page: https://github.com/yourusername/snipp
6
+ Author: Snipp
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: watchdog
13
+ Requires-Dist: requests
14
+ Requires-Dist: pyperclip
15
+ Requires-Dist: colorama
16
+ Dynamic: author
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
+ <p align="center">
26
+ <a href="https://snipp.gg"><img src="https://cdn.snipp.gg/logo_light.png" alt="Snipp Logo" width="158" /></a>
27
+ </p>
28
+
29
+ # Snipp + ShadowPlay
30
+
31
+ A simple Python package that automatically uploads NVIDIA ShadowPlay clips to [Snipp](https://snipp.gg), making your gaming highlight sharing seamless.
32
+
33
+ ## 🎯 Purpose
34
+
35
+ This package is built **exclusively for use with [Snipp](https://snipp.gg)**. It streamlines your workflow by automatically uploading your clips and copying shareable links to your clipboard.
36
+
37
+ ## 🚀 Features
38
+
39
+ - Monitors your ShadowPlay video folder for new clips
40
+ - Uploads clips to Snipp via the Snipp API
41
+ - Copies the shareable URL to your clipboard automatically
42
+
43
+ ## ⚙️ Requirements
44
+
45
+ - Python 3.8 or higher
46
+ - NVIDIA ShadowPlay (with local clip saving enabled)
47
+ - A valid API key from [Snipp Console](https://snipp.gg/settings/console)
48
+
49
+ Dependencies (automatically installed with the package):
50
+ - `requests`
51
+ - `pyperclip`
52
+ - `watchdog`
53
+ - `colorama`
54
+
55
+ ## 💪 Installation
56
+
57
+ ```bash
58
+ pip install snipp
59
+ ```
60
+
61
+ ## 🔐 Configuration
62
+
63
+ 1. **Get your API Key**
64
+ Visit the [Snipp Console](https://snipp.gg/settings/console) and generate a key.
65
+
66
+ 2. **Set your API Key**
67
+ Either:
68
+ - Export it as an environment variable:
69
+ ```bash
70
+ export SNIPP_API_KEY=your-api-key
71
+ ```
72
+ - Or save it to a file:
73
+ ```bash
74
+ echo "your-api-key" > ~/.snipp_uploader
75
+ ```
76
+
77
+ ## ▶️ Usage
78
+
79
+ Once installed and configured, run:
80
+
81
+ ```bash
82
+ snipp-shadowplay
83
+ ```
84
+
85
+ The script will start watching your `~/Videos` folder and upload new `.mp4` files automatically.
86
+
87
+ ## ✅ Usage Policy
88
+
89
+ - This package is **authorised solely for use with Snipp**.
90
+ - **Do not modify it to interact with other services**. Violations may lead to API key revocation or account suspension.
91
+
92
+ ## 🤝 Contributing
93
+
94
+ We welcome suggestions and improvements for better integration with Snipp:
95
+
96
+ - Open an issue
97
+ - Submit a pull request that adheres to our [Terms of Service](https://snipp.gg/terms)
98
+
99
+ ## 📄 Licence
100
+
101
+ MIT Licence © 2025 Snipp. See [LICENCE](LICENCE) for full details.
102
+
103
+ ## ⚠️ Disclaimer
104
+
105
+ This package is provided "as is" and only for use with [Snipp](https://snipp.gg). Users must adhere to the [Terms of Service](https://snipp.gg/terms).
snipp-0.1.0/README.md ADDED
@@ -0,0 +1,81 @@
1
+ <p align="center">
2
+ <a href="https://snipp.gg"><img src="https://cdn.snipp.gg/logo_light.png" alt="Snipp Logo" width="158" /></a>
3
+ </p>
4
+
5
+ # Snipp + ShadowPlay
6
+
7
+ A simple Python package that automatically uploads NVIDIA ShadowPlay clips to [Snipp](https://snipp.gg), making your gaming highlight sharing seamless.
8
+
9
+ ## 🎯 Purpose
10
+
11
+ This package is built **exclusively for use with [Snipp](https://snipp.gg)**. It streamlines your workflow by automatically uploading your clips and copying shareable links to your clipboard.
12
+
13
+ ## 🚀 Features
14
+
15
+ - Monitors your ShadowPlay video folder for new clips
16
+ - Uploads clips to Snipp via the Snipp API
17
+ - Copies the shareable URL to your clipboard automatically
18
+
19
+ ## ⚙️ Requirements
20
+
21
+ - Python 3.8 or higher
22
+ - NVIDIA ShadowPlay (with local clip saving enabled)
23
+ - A valid API key from [Snipp Console](https://snipp.gg/settings/console)
24
+
25
+ Dependencies (automatically installed with the package):
26
+ - `requests`
27
+ - `pyperclip`
28
+ - `watchdog`
29
+ - `colorama`
30
+
31
+ ## 💪 Installation
32
+
33
+ ```bash
34
+ pip install snipp
35
+ ```
36
+
37
+ ## 🔐 Configuration
38
+
39
+ 1. **Get your API Key**
40
+ Visit the [Snipp Console](https://snipp.gg/settings/console) and generate a key.
41
+
42
+ 2. **Set your API Key**
43
+ Either:
44
+ - Export it as an environment variable:
45
+ ```bash
46
+ export SNIPP_API_KEY=your-api-key
47
+ ```
48
+ - Or save it to a file:
49
+ ```bash
50
+ echo "your-api-key" > ~/.snipp_uploader
51
+ ```
52
+
53
+ ## ▶️ Usage
54
+
55
+ Once installed and configured, run:
56
+
57
+ ```bash
58
+ snipp-shadowplay
59
+ ```
60
+
61
+ The script will start watching your `~/Videos` folder and upload new `.mp4` files automatically.
62
+
63
+ ## ✅ Usage Policy
64
+
65
+ - This package is **authorised solely for use with Snipp**.
66
+ - **Do not modify it to interact with other services**. Violations may lead to API key revocation or account suspension.
67
+
68
+ ## 🤝 Contributing
69
+
70
+ We welcome suggestions and improvements for better integration with Snipp:
71
+
72
+ - Open an issue
73
+ - Submit a pull request that adheres to our [Terms of Service](https://snipp.gg/terms)
74
+
75
+ ## 📄 Licence
76
+
77
+ MIT Licence © 2025 Snipp. See [LICENCE](LICENCE) for full details.
78
+
79
+ ## ⚠️ Disclaimer
80
+
81
+ This package is provided "as is" and only for use with [Snipp](https://snipp.gg). Users must adhere to the [Terms of Service](https://snipp.gg/terms).
snipp-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
snipp-0.1.0/setup.py ADDED
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="snipp",
5
+ version="0.1.0",
6
+ packages=find_packages(),
7
+ install_requires=[
8
+ "watchdog",
9
+ "requests",
10
+ "pyperclip",
11
+ "colorama"
12
+ ],
13
+ entry_points={
14
+ "console_scripts": [
15
+ "snipp-shadowplay=snipp_uploader.cli:main"
16
+ ]
17
+ },
18
+ author="Snipp",
19
+ description="Auto-upload ShadowPlay clips to Snipp.",
20
+ long_description=open("README.md", encoding="utf-8").read(),
21
+ long_description_content_type="text/markdown",
22
+ url="https://github.com/yourusername/snipp",
23
+ classifiers=[
24
+ "Programming Language :: Python :: 3",
25
+ "License :: OSI Approved :: MIT License",
26
+ "Operating System :: OS Independent",
27
+ ],
28
+ python_requires=">=3.8",
29
+ )
File without changes
@@ -0,0 +1,9 @@
1
+ from .watcher import start_watching
2
+ from .config import get_api_key
3
+
4
+ def main():
5
+ try:
6
+ api_key = get_api_key()
7
+ start_watching(api_key)
8
+ except Exception as e:
9
+ print(f"[ERROR] {e}")
@@ -0,0 +1,11 @@
1
+ import os
2
+
3
+ def get_api_key():
4
+ return os.getenv("SNIPP_API_KEY") or load_from_config()
5
+
6
+ def load_from_config():
7
+ config_path = os.path.expanduser("~/.snipp_uploader")
8
+ if os.path.exists(config_path):
9
+ with open(config_path) as f:
10
+ return f.read().strip()
11
+ raise RuntimeError("API key not found. Set SNIPP_API_KEY env or ~/.snipp_uploader file.")
@@ -0,0 +1,18 @@
1
+ import os
2
+ import time
3
+ from colorama import Fore, Style
4
+
5
+ def wait_for_file_completion(file_path):
6
+ start_time = time.time()
7
+ size = -1
8
+ while time.time() - start_time < 10:
9
+ if not os.access(file_path, os.R_OK):
10
+ time.sleep(0.2)
11
+ continue
12
+ current_size = os.path.getsize(file_path)
13
+ if current_size == size and current_size > 0:
14
+ return True
15
+ size = current_size
16
+ time.sleep(0.2)
17
+ print(f"{Fore.YELLOW}[WARNING] Waiting for clip to finish processing...{Style.RESET_ALL}")
18
+ return False
@@ -0,0 +1,69 @@
1
+ import os
2
+ import time
3
+ import requests
4
+ import pyperclip
5
+ from watchdog.observers import Observer
6
+ from watchdog.events import FileSystemEventHandler
7
+ from colorama import init, Fore, Style
8
+ from .utils import wait_for_file_completion
9
+
10
+ init()
11
+
12
+ class VideoHandler(FileSystemEventHandler):
13
+ def __init__(self, api_key):
14
+ self.api_key = api_key
15
+
16
+ def on_created(self, event):
17
+ if not event.is_directory and event.src_path.lower().endswith(".mp4"):
18
+ print(f"{Fore.BLUE}[INFO] New video file detected. Uploading...{Style.RESET_ALL}")
19
+ upload_video(event.src_path, self.api_key)
20
+
21
+ def upload_video(file_path, api_key):
22
+ if not wait_for_file_completion(file_path):
23
+ return
24
+ file_size = os.path.getsize(file_path)
25
+ if file_size > 1_073_741_824:
26
+ print(f"{Fore.RED}[ERROR] Upload skipped: File size exceeds upload limit.{Style.RESET_ALL}")
27
+ return
28
+ try:
29
+ with open(file_path, "rb") as video_file:
30
+ files = {"file": (os.path.basename(file_path), video_file, "video/mp4")}
31
+ response = requests.post(
32
+ "https://eu-west.snipp.gg/upload",
33
+ headers={"api-key": api_key, "Accept": "application/json"},
34
+ files=files
35
+ )
36
+ if response.status_code in (200, 201):
37
+ try:
38
+ url = response.json().get("url")
39
+ if url:
40
+ pyperclip.copy(url)
41
+ print(f"{Fore.GREEN}[SUCCESS] Uploaded clip: {url}{Style.RESET_ALL}")
42
+ except ValueError:
43
+ print(f"{Fore.RED}[ERROR] Invalid response: {response.text}{Style.RESET_ALL}")
44
+ else:
45
+ try:
46
+ error_message = response.json().get("error", response.text)
47
+ except ValueError:
48
+ error_message = response.text
49
+ print(f"{Fore.RED}[ERROR] Upload failed: {error_message}{Style.RESET_ALL}")
50
+ except Exception as e:
51
+ print(f"{Fore.RED}[ERROR] Upload failed: {e}{Style.RESET_ALL}")
52
+
53
+ def start_watching(api_key):
54
+ videos_path = os.path.join(os.path.expanduser("~"), "Videos")
55
+ if not os.path.exists(videos_path):
56
+ print(f"{Fore.RED}[ERROR] Directory not found: {videos_path}{Style.RESET_ALL}")
57
+ return
58
+
59
+ observer = Observer()
60
+ observer.schedule(VideoHandler(api_key), videos_path, recursive=True)
61
+ observer.start()
62
+ print(f"{Fore.BLUE}[INFO] Snipp + ShadowPlay started.{Style.RESET_ALL}")
63
+ try:
64
+ while True:
65
+ time.sleep(1)
66
+ except KeyboardInterrupt:
67
+ observer.stop()
68
+ print(f"{Fore.BLUE}[INFO] Snipp + ShadowPlay stopped.{Style.RESET_ALL}")
69
+ observer.join()
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: snipp
3
+ Version: 0.1.0
4
+ Summary: Auto-upload ShadowPlay clips to Snipp.
5
+ Home-page: https://github.com/yourusername/snipp
6
+ Author: Snipp
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: watchdog
13
+ Requires-Dist: requests
14
+ Requires-Dist: pyperclip
15
+ Requires-Dist: colorama
16
+ Dynamic: author
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
+ <p align="center">
26
+ <a href="https://snipp.gg"><img src="https://cdn.snipp.gg/logo_light.png" alt="Snipp Logo" width="158" /></a>
27
+ </p>
28
+
29
+ # Snipp + ShadowPlay
30
+
31
+ A simple Python package that automatically uploads NVIDIA ShadowPlay clips to [Snipp](https://snipp.gg), making your gaming highlight sharing seamless.
32
+
33
+ ## 🎯 Purpose
34
+
35
+ This package is built **exclusively for use with [Snipp](https://snipp.gg)**. It streamlines your workflow by automatically uploading your clips and copying shareable links to your clipboard.
36
+
37
+ ## 🚀 Features
38
+
39
+ - Monitors your ShadowPlay video folder for new clips
40
+ - Uploads clips to Snipp via the Snipp API
41
+ - Copies the shareable URL to your clipboard automatically
42
+
43
+ ## ⚙️ Requirements
44
+
45
+ - Python 3.8 or higher
46
+ - NVIDIA ShadowPlay (with local clip saving enabled)
47
+ - A valid API key from [Snipp Console](https://snipp.gg/settings/console)
48
+
49
+ Dependencies (automatically installed with the package):
50
+ - `requests`
51
+ - `pyperclip`
52
+ - `watchdog`
53
+ - `colorama`
54
+
55
+ ## 💪 Installation
56
+
57
+ ```bash
58
+ pip install snipp
59
+ ```
60
+
61
+ ## 🔐 Configuration
62
+
63
+ 1. **Get your API Key**
64
+ Visit the [Snipp Console](https://snipp.gg/settings/console) and generate a key.
65
+
66
+ 2. **Set your API Key**
67
+ Either:
68
+ - Export it as an environment variable:
69
+ ```bash
70
+ export SNIPP_API_KEY=your-api-key
71
+ ```
72
+ - Or save it to a file:
73
+ ```bash
74
+ echo "your-api-key" > ~/.snipp_uploader
75
+ ```
76
+
77
+ ## ▶️ Usage
78
+
79
+ Once installed and configured, run:
80
+
81
+ ```bash
82
+ snipp-shadowplay
83
+ ```
84
+
85
+ The script will start watching your `~/Videos` folder and upload new `.mp4` files automatically.
86
+
87
+ ## ✅ Usage Policy
88
+
89
+ - This package is **authorised solely for use with Snipp**.
90
+ - **Do not modify it to interact with other services**. Violations may lead to API key revocation or account suspension.
91
+
92
+ ## 🤝 Contributing
93
+
94
+ We welcome suggestions and improvements for better integration with Snipp:
95
+
96
+ - Open an issue
97
+ - Submit a pull request that adheres to our [Terms of Service](https://snipp.gg/terms)
98
+
99
+ ## 📄 Licence
100
+
101
+ MIT Licence © 2025 Snipp. See [LICENCE](LICENCE) for full details.
102
+
103
+ ## ⚠️ Disclaimer
104
+
105
+ This package is provided "as is" and only for use with [Snipp](https://snipp.gg). Users must adhere to the [Terms of Service](https://snipp.gg/terms).
@@ -0,0 +1,13 @@
1
+ README.md
2
+ setup.py
3
+ snipp-uploader/__init__.py
4
+ snipp-uploader/cli.py
5
+ snipp-uploader/config.py
6
+ snipp-uploader/utils.py
7
+ snipp-uploader/watcher.py
8
+ snipp.egg-info/PKG-INFO
9
+ snipp.egg-info/SOURCES.txt
10
+ snipp.egg-info/dependency_links.txt
11
+ snipp.egg-info/entry_points.txt
12
+ snipp.egg-info/requires.txt
13
+ snipp.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ snipp-shadowplay = snipp_uploader.cli:main
@@ -0,0 +1,4 @@
1
+ watchdog
2
+ requests
3
+ pyperclip
4
+ colorama
@@ -0,0 +1 @@
1
+ snipp-uploader