Skip to content

Commit

Permalink
fix(major): configuration for store images in ghost database, flags a…
Browse files Browse the repository at this point in the history
…nd debug informations
  • Loading branch information
LinceMathew committed Feb 20, 2024
1 parent ed4be22 commit ff5763f
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 138 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/glee.go",
"args": ["sample_post.md"]
}
]
}
5 changes: 4 additions & 1 deletion ghost_upload_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ def upload_to_ghost(token, image, hash_name, blog_image_list, logging):
if hash_value in image_name:
logging.debug(f"The image {name} already exists and is being reused.")
return name

print("image",image)
print("hash_name",hash_name)
mulit_encoder = MultipartEncoder(
fields={
"file": (hash_name, open(image, "rb"), "image/png"),
"ref": hash_name,
}
)
# print(mulit_encoder, "mulit_encoder")
boundary_value = mulit_encoder.boundary_value
# print(boundary_value, "boundary_value")
response = {}
response = requests.post(
POSTS_API_BASE,
Expand Down
Loading

0 comments on commit ff5763f

Please sign in to comment.