Skip to content

Commit 96eaecb

Browse files
committed
feat(api): add cdn_url to post response
Include direct CDN link to Instagram media in API response to provide alternative access method
1 parent ebf7c2f commit 96eaecb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ This Docker image is compatible with the following architectures:
1515
- JSON response containing:
1616
- the `shortcode`,
1717
- the path to the downloaded video file,
18-
- the post description (caption).
18+
- the post description (caption),
19+
- the `cdn_url` (direct link to the video/image on Instagram's CDN).
1920
- `/health` endpoint to check the service status.
2021

2122
## API
@@ -39,7 +40,8 @@ Successful response (`200 OK`):
3940
{
4041
"shortcode": "SHORTCODE",
4142
"video": "/data/instaloader/SHORTCODE/SHORTCODE.mp4",
42-
"description": "Post caption or empty string"
43+
"description": "Post caption or empty string",
44+
"cdn_url": "https://scontent-..."
4345
}
4446
```
4547

app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def scrape_post(shortcode):
5050
return jsonify({
5151
"shortcode": shortcode,
5252
"video": f"/data/instaloader/{shortcode}/{shortcode}.mp4",
53-
"description": post.caption or ""
53+
"description": post.caption or "",
54+
"cdn_url": post.video_url if post.is_video else post.url
5455
})
5556

5657

0 commit comments

Comments
 (0)