[GH-ISSUE #99] Retrieve uploaded session #78

Closed
opened 2026-02-25 20:32:30 +03:00 by kerem · 8 comments
Owner

Originally created by @zmwangx on GitHub (May 9, 2015).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/99

It seems to me that currently there's no way to retrieve an uploaded session (the JSON served to the player is processed, excuse me if I'm wrong), so if one didn't pick a file to save to before the recording (i.e., ran asciinema record without arguments) and immediately uploaded the cast after finishing the session (i.e., Press <Enter> to upload, <Ctrl-C> to cancel. ==> press enter), then the recording is essentially lost locally. The temp file seems to be immediately deleted after a successful upload (I find this unnecessary).

Since the uploaded sessions are public, it would be really nice if all sessions on asciinema.org are available for download (this would even save some AWS bandwidth, assuming one wants to play a nice cast by someone else over and over again, but have to play it online unless it is available for download). If you fear that this would lead to abuse, another great thing would be to let the uploader download his/her own sessions.

(Is there an API trick that I haven't discovered?)

Originally created by @zmwangx on GitHub (May 9, 2015). Original GitHub issue: https://github.com/asciinema/asciinema/issues/99 It seems to me that currently there's no way to retrieve an uploaded session (the JSON served to the player is processed, excuse me if I'm wrong), so if one didn't pick a file to save to before the recording (i.e., ran `asciinema record` without arguments) and immediately uploaded the cast after finishing the session (i.e., `Press <Enter> to upload, <Ctrl-C> to cancel.` ==> press enter), then the recording is essentially lost locally. The temp file seems to be immediately deleted after a successful upload (I find this unnecessary). Since the uploaded sessions are public, it would be really nice if all sessions on asciinema.org are available for download (this would even save some AWS bandwidth, assuming one wants to play a nice cast by someone else over and over again, but have to play it online unless it is available for download). If you fear that this would lead to abuse, another great thing would be to let the uploader download his/her own sessions. (Is there an API trick that I haven't discovered?)
kerem closed this issue 2026-02-25 20:32:30 +03:00
Author
Owner

@ku1ik commented on GitHub (May 10, 2015):

You're correct, the JSON served to the player is a processed one, not the "asciicast v1" format.
Looks like what you're looking for is an endpoint like /a/12345.json. Currently it's being used internally by asciinema.org but I don't see a reason for moving the current one to some other path and serving the actual asciicast JSON from this path. We already have /a/12345.png to serve a screenshot representation of an asciicast, it sounds ok to serve the recording when requested as .json.

<!-- gh-comment-id:100626455 --> @ku1ik commented on GitHub (May 10, 2015): You're correct, the JSON served to the player is a processed one, not the "asciicast v1" format. Looks like what you're looking for is an endpoint like `/a/12345.json`. Currently it's being used internally by asciinema.org but I don't see a reason for moving the current one to some other path and serving the actual asciicast JSON from this path. We already have `/a/12345.png` to serve a screenshot representation of an asciicast, it sounds ok to serve the recording when requested as `.json`.
Author
Owner

@zmwangx commented on GitHub (May 13, 2015):

Sorry, I'm not sure I understood exactly what you meant. If I read it correctly, currently there's no endpoint serving the asciicast JSON, right? Since the /a/12345.json endpoint returns an object with id, duration, stdout_frames_url for processed frames, and snapshot. That's perfectly fine, and there's no reason or need to move it. Just, can we have another endpoint serving the original cast JSON (for reasons and benefits outlined above)?

<!-- gh-comment-id:101559753 --> @zmwangx commented on GitHub (May 13, 2015): Sorry, I'm not sure I understood exactly what you meant. If I read it correctly, currently there's no endpoint serving the asciicast JSON, right? Since the `/a/12345.json` endpoint returns an object with `id`, `duration`, `stdout_frames_url` for processed frames, and `snapshot`. That's perfectly fine, and there's no reason or need to move it. Just, can we have another endpoint serving the original cast JSON (for reasons and benefits outlined above)?
Author
Owner

@ku1ik commented on GitHub (May 13, 2015):

I meant we definitely can have an endpoint serving original cast JSON. That's a good idea. And at the same time I think it would be nice if it lived at /a/12345.json, as this is public API area (html and png live here too). I'd rather move the id/stdout_frames_url/... JSON to some other place because it's kinda private API, so it can live anywhere else. Let me see what I can do about it.

<!-- gh-comment-id:101607903 --> @ku1ik commented on GitHub (May 13, 2015): I meant we definitely can have an endpoint serving original cast JSON. That's a good idea. And at the same time I think it would be nice if it lived at `/a/12345.json`, as this is public API area (html and png live here too). I'd rather move the `id/stdout_frames_url/...` JSON to some other place because it's kinda private API, so it can live anywhere else. Let me see what I can do about it.
Author
Owner

@zmwangx commented on GitHub (May 13, 2015):

That would be great, thanks.

<!-- gh-comment-id:101609243 --> @zmwangx commented on GitHub (May 13, 2015): That would be great, thanks.
Author
Owner

@ku1ik commented on GitHub (May 13, 2015):

It's there. Try wget https://asciinema.org/a/19921.json.

<!-- gh-comment-id:101673895 --> @ku1ik commented on GitHub (May 13, 2015): It's there. Try `wget https://asciinema.org/a/19921.json`.
Author
Owner

@zmwangx commented on GitHub (May 13, 2015):

Awesome!

<!-- gh-comment-id:101739514 --> @zmwangx commented on GitHub (May 13, 2015): Awesome!
Author
Owner

@zmwangx commented on GitHub (May 15, 2015):

I suppose this issue could be closed now? Or maybe the endpoints are still not final and you'd rather keep it open for a little longer?

<!-- gh-comment-id:102248556 --> @zmwangx commented on GitHub (May 15, 2015): I suppose this issue could be closed now? Or maybe the endpoints are still not final and you'd rather keep it open for a little longer?
Author
Owner

@ku1ik commented on GitHub (May 15, 2015):

Yep, closing.

<!-- gh-comment-id:102287914 --> @ku1ik commented on GitHub (May 15, 2015): Yep, closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#78
No description provided.