File tree 3 files changed +20
-2
lines changed
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ yay -S python-images-upload-cli
49
49
| [ up2sha] ( https://up2sha.re/ ) | + | ` https://up2sha.re/media/raw/{id}.png ` |
50
50
| [ uplio] ( https://upl.io/ ) | + | ` https://upl.io/i/{id}.png ` |
51
51
| [ uploadcare] ( https://uploadcare.com/ ) | + | ` https://ucarecdn.com/{id}/img.png ` |
52
+ | [ vgy] ( https://vgy.me/ ) | + | ` https://i.vgy.me/{id}.png ` |
52
53
53
54
## Usage
54
55
@@ -58,7 +59,7 @@ Usage: images-upload-cli [OPTIONS] IMAGES...
58
59
Upload images via APIs.
59
60
60
61
Options:
61
- -h, --hosting [catbox| fastpic| filecoffee| freeimage| gyazo| imageban| imgbb| imgchest| imgur| pictshare| pixeldrain| pixhost| ptpimg| screenshotting| smms| sxcu| telegraph| thumbsnap| up2sha| uplio| uploadcare| test ]
62
+ -h, --hosting [catbox| fastpic| filecoffee| freeimage| gyazo| imageban| imgbb| imgchest| imgur| pictshare| pixeldrain| pixhost| ptpimg| screenshotting| smms| sxcu| telegraph| thumbsnap| up2sha| uplio| uploadcare| vgy ]
62
63
[default: imgur]
63
64
-b, --bbcode Add bbcode tags.
64
65
-t, --thumbnail Add caption thumbnail and bbcode tags.
@@ -85,6 +86,7 @@ THUMBSNAP_KEY=
85
86
UP2SHA_KEY =
86
87
UPLIO_KEY =
87
88
UPLOADCARE_KEY =
89
+ VGY_KEY =
88
90
```
89
91
90
92
You can set these in environment variables, or in ` .env ` file:
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " images-upload-cli"
3
- version = " 1.0.5 "
3
+ version = " 1.0.6 "
4
4
description = " Upload images via APIs"
5
5
authors = [
" DeadNews <[email protected] >" ]
6
6
license = " MIT"
Original file line number Diff line number Diff line change @@ -318,6 +318,21 @@ def uploadcare_upload(img: bytes) -> str:
318
318
return f"https://ucarecdn.com/{ response .json ()['filename' ]} /{ name } "
319
319
320
320
321
+ def vgy_upload (img : bytes ) -> str :
322
+ key = get_env_val ("VGY_KEY" )
323
+ name = f"img.{ get_img_ext (img )} "
324
+
325
+ response = post (
326
+ url = "https://vgy.me/upload" ,
327
+ data = {"userkey" : key },
328
+ files = {"file[]" : (name , img )},
329
+ )
330
+ if not response .ok :
331
+ raise UploadError (response .json ())
332
+
333
+ return response .json ()["image" ]
334
+
335
+
321
336
UPLOAD : dict [str , Callable [[bytes ], str ]] = {
322
337
"catbox" : catbox_upload ,
323
338
"fastpic" : fastpic_upload ,
@@ -340,6 +355,7 @@ def uploadcare_upload(img: bytes) -> str:
340
355
"up2sha" : up2sha_upload ,
341
356
"uplio" : uplio_upload ,
342
357
"uploadcare" : uploadcare_upload ,
358
+ "vgy" : vgy_upload ,
343
359
}
344
360
345
361
HOSTINGS = tuple (UPLOAD .keys ())
You can’t perform that action at this time.
0 commit comments